{"action":"created","comment":{"url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments/70041758","id":70041758,"diff_hunk":"@@ -0,0 +1,124 @@\n+package edu.wpi.grip.ui.codegeneration.tools;\n+\n+import org.opencv.imgcodecs.Imgcodecs;\n+\n+import java.io.File;\n+import java.lang.reflect.InvocationTargetException;\n+\n+import static org.junit.Assert.fail;\n+\n+public class JavaPipelineInterfacer implements PipelineInterfacer {\n+  private Class pipeline;\n+  private Object instance;\n+\n+  public JavaPipelineInterfacer(String className) {\n+    pipeline = PipelineCreator.makeClass(className);\n+    try {\n+      instance = pipeline.getConstructor().newInstance();\n+    } catch (InstantiationException | IllegalAccessException\n+        | IllegalArgumentException | InvocationTargetException\n+        | NoSuchMethodException | SecurityException e) {\n+      e.printStackTrace();\n+      fail(\"Failure to instantiate class \" + className);\n+    }\n+  }\n+\n+  /* (non-Javadoc)\n+   * @see edu.wpi.grip.ui.codegeneration.tools.PipelineInterfacer#setSource(int, java.lang.Object)\n+   */\n+  @Override\n+  public void setSource(int num, Object value) {\n+    try {\n+      pipeline.getMethod(\"setsource\" + num, value.getClass()).invoke(instance, value);\n+    } catch (NoSuchMethodException | SecurityException | IllegalAccessException\n+        | IllegalArgumentException | InvocationTargetException e) {\n+      e.printStackTrace();\n+      fail(\"setsource\" + num + \" is not valid for class \" + value.getClass().getSimpleName() + \"\"\n+          + \" because there was a: \");\n+    }\n+  }\n+\n+  /* (non-Javadoc)\n+   * @see edu.wpi.grip.ui.codegeneration.tools.PipelineInterfacer#setSourceAsObject(int, java\n+   * .lang.Object)\n+   */\n+  @Override\n+  public void setSourceAsObject(int num, Object value) {\n+    try {\n+      pipeline.getMethod(\"setsource\" + num, Object.class).invoke(instance, value);\n+    } catch (NoSuchMethodException | SecurityException | IllegalAccessException\n+        | IllegalArgumentException | InvocationTargetException e) {\n+      e.printStackTrace();\n+      fail(\"setsource\" + num + \" is not valid for class \" + value.getClass().getSimpleName() + \"\"\n+          + \" because there was a: \");\n+    }\n+  }\n+\n+  /* (non-Javadoc)\n+   * @see edu.wpi.grip.ui.codegeneration.tools.PipelineInterfacer#setMatSource(int, java.io.File)\n+   */","path":"ui/src/test/java/edu/wpi/grip/ui/codegeneration/tools/JavaPipelineInterfacer.java","position":59,"original_position":59,"commit_id":"179e3dc27b8f64a1624dfa9aa380148bdfe1e582","original_commit_id":"179e3dc27b8f64a1624dfa9aa380148bdfe1e582","user":{"login":"AustinShalit","id":3799260,"avatar_url":"https://avatars.githubusercontent.com/u/3799260?v=3","gravatar_id":"","url":"https://api.github.com/users/AustinShalit","html_url":"https://github.com/AustinShalit","followers_url":"https://api.github.com/users/AustinShalit/followers","following_url":"https://api.github.com/users/AustinShalit/following{/other_user}","gists_url":"https://api.github.com/users/AustinShalit/gists{/gist_id}","starred_url":"https://api.github.com/users/AustinShalit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AustinShalit/subscriptions","organizations_url":"https://api.github.com/users/AustinShalit/orgs","repos_url":"https://api.github.com/users/AustinShalit/repos","events_url":"https://api.github.com/users/AustinShalit/events{/privacy}","received_events_url":"https://api.github.com/users/AustinShalit/received_events","type":"User","site_admin":false},"body":"This is an Overridden method. Javadoc is not needed -- it is automatically added from the super class.","created_at":"2016-07-08T08:33:08Z","updated_at":"2016-07-08T08:33:08Z","html_url":"https://github.com/WPIRoboticsProjects/GRIP/pull/597#discussion_r70041758","pull_request_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/597","_links":{"self":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments/70041758"},"html":{"href":"https://github.com/WPIRoboticsProjects/GRIP/pull/597#discussion_r70041758"},"pull_request":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/597"}}},"pull_request":{"url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/597","id":72393890,"html_url":"https://github.com/WPIRoboticsProjects/GRIP/pull/597","diff_url":"https://github.com/WPIRoboticsProjects/GRIP/pull/597.diff","patch_url":"https://github.com/WPIRoboticsProjects/GRIP/pull/597.patch","issue_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/597","number":597,"state":"open","locked":false,"title":"Code Generation","user":{"login":"PatrickPenguinTurtle","id":16124010,"avatar_url":"https://avatars.githubusercontent.com/u/16124010?v=3","gravatar_id":"","url":"https://api.github.com/users/PatrickPenguinTurtle","html_url":"https://github.com/PatrickPenguinTurtle","followers_url":"https://api.github.com/users/PatrickPenguinTurtle/followers","following_url":"https://api.github.com/users/PatrickPenguinTurtle/following{/other_user}","gists_url":"https://api.github.com/users/PatrickPenguinTurtle/gists{/gist_id}","starred_url":"https://api.github.com/users/PatrickPenguinTurtle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PatrickPenguinTurtle/subscriptions","organizations_url":"https://api.github.com/users/PatrickPenguinTurtle/orgs","repos_url":"https://api.github.com/users/PatrickPenguinTurtle/repos","events_url":"https://api.github.com/users/PatrickPenguinTurtle/events{/privacy}","received_events_url":"https://api.github.com/users/PatrickPenguinTurtle/received_events","type":"User","site_admin":false},"body":"@osulacam and myself are working on an extension to GRIP that generates code. Eventually it will generate code for the users choice of Java, C++ and Python. For now it only generates Java code. \r\n\r\nThe idea behind this is so that users do not have to run a jvm containing GRIP to get pipelines to run. Instead they would include this file in their code and call the processImage function to run the pipeline once. \r\n\r\nAs mentioned this is in progress and at this time is not finished enough to be merged into GRIP. ","created_at":"2016-06-02T18:23:46Z","updated_at":"2016-07-08T08:33:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da539789288270499aa1f2f0340c68e808a65342","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/597/commits","review_comments_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/597/comments","review_comment_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/597/comments","statuses_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/statuses/179e3dc27b8f64a1624dfa9aa380148bdfe1e582","head":{"label":"osulacam:DataModel","ref":"DataModel","sha":"179e3dc27b8f64a1624dfa9aa380148bdfe1e582","user":{"login":"osulacam","id":7980882,"avatar_url":"https://avatars.githubusercontent.com/u/7980882?v=3","gravatar_id":"","url":"https://api.github.com/users/osulacam","html_url":"https://github.com/osulacam","followers_url":"https://api.github.com/users/osulacam/followers","following_url":"https://api.github.com/users/osulacam/following{/other_user}","gists_url":"https://api.github.com/users/osulacam/gists{/gist_id}","starred_url":"https://api.github.com/users/osulacam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osulacam/subscriptions","organizations_url":"https://api.github.com/users/osulacam/orgs","repos_url":"https://api.github.com/users/osulacam/repos","events_url":"https://api.github.com/users/osulacam/events{/privacy}","received_events_url":"https://api.github.com/users/osulacam/received_events","type":"User","site_admin":false},"repo":{"id":58765533,"name":"GRIP","full_name":"osulacam/GRIP","owner":{"login":"osulacam","id":7980882,"avatar_url":"https://avatars.githubusercontent.com/u/7980882?v=3","gravatar_id":"","url":"https://api.github.com/users/osulacam","html_url":"https://github.com/osulacam","followers_url":"https://api.github.com/users/osulacam/followers","following_url":"https://api.github.com/users/osulacam/following{/other_user}","gists_url":"https://api.github.com/users/osulacam/gists{/gist_id}","starred_url":"https://api.github.com/users/osulacam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osulacam/subscriptions","organizations_url":"https://api.github.com/users/osulacam/orgs","repos_url":"https://api.github.com/users/osulacam/repos","events_url":"https://api.github.com/users/osulacam/events{/privacy}","received_events_url":"https://api.github.com/users/osulacam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/osulacam/GRIP","description":"Program for rapidly developing computer vision applications","fork":true,"url":"https://api.github.com/repos/osulacam/GRIP","forks_url":"https://api.github.com/repos/osulacam/GRIP/forks","keys_url":"https://api.github.com/repos/osulacam/GRIP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/osulacam/GRIP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/osulacam/GRIP/teams","hooks_url":"https://api.github.com/repos/osulacam/GRIP/hooks","issue_events_url":"https://api.github.com/repos/osulacam/GRIP/issues/events{/number}","events_url":"https://api.github.com/repos/osulacam/GRIP/events","assignees_url":"https://api.github.com/repos/osulacam/GRIP/assignees{/user}","branches_url":"https://api.github.com/repos/osulacam/GRIP/branches{/branch}","tags_url":"https://api.github.com/repos/osulacam/GRIP/tags","blobs_url":"https://api.github.com/repos/osulacam/GRIP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/osulacam/GRIP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/osulacam/GRIP/git/refs{/sha}","trees_url":"https://api.github.com/repos/osulacam/GRIP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/osulacam/GRIP/statuses/{sha}","languages_url":"https://api.github.com/repos/osulacam/GRIP/languages","stargazers_url":"https://api.github.com/repos/osulacam/GRIP/stargazers","contributors_url":"https://api.github.com/repos/osulacam/GRIP/contributors","subscribers_url":"https://api.github.com/repos/osulacam/GRIP/subscribers","subscription_url":"https://api.github.com/repos/osulacam/GRIP/subscription","commits_url":"https://api.github.com/repos/osulacam/GRIP/commits{/sha}","git_commits_url":"https://api.github.com/repos/osulacam/GRIP/git/commits{/sha}","comments_url":"https://api.github.com/repos/osulacam/GRIP/comments{/number}","issue_comment_url":"https://api.github.com/repos/osulacam/GRIP/issues/comments{/number}","contents_url":"https://api.github.com/repos/osulacam/GRIP/contents/{+path}","compare_url":"https://api.github.com/repos/osulacam/GRIP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/osulacam/GRIP/merges","archive_url":"https://api.github.com/repos/osulacam/GRIP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/osulacam/GRIP/downloads","issues_url":"https://api.github.com/repos/osulacam/GRIP/issues{/number}","pulls_url":"https://api.github.com/repos/osulacam/GRIP/pulls{/number}","milestones_url":"https://api.github.com/repos/osulacam/GRIP/milestones{/number}","notifications_url":"https://api.github.com/repos/osulacam/GRIP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/osulacam/GRIP/labels{/name}","releases_url":"https://api.github.com/repos/osulacam/GRIP/releases{/id}","deployments_url":"https://api.github.com/repos/osulacam/GRIP/deployments","created_at":"2016-05-13T19:02:08Z","updated_at":"2016-05-13T19:02:10Z","pushed_at":"2016-07-07T20:48:01Z","git_url":"git://github.com/osulacam/GRIP.git","ssh_url":"git@github.com:osulacam/GRIP.git","clone_url":"https://github.com/osulacam/GRIP.git","svn_url":"https://github.com/osulacam/GRIP","homepage":"http://wpiroboticsprojects.github.io/GRIP","size":45079,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"WPIRoboticsProjects:master","ref":"master","sha":"946d8bc07ee424718ed9b28067e64fd183a7cca4","user":{"login":"WPIRoboticsProjects","id":14004340,"avatar_url":"https://avatars.githubusercontent.com/u/14004340?v=3","gravatar_id":"","url":"https://api.github.com/users/WPIRoboticsProjects","html_url":"https://github.com/WPIRoboticsProjects","followers_url":"https://api.github.com/users/WPIRoboticsProjects/followers","following_url":"https://api.github.com/users/WPIRoboticsProjects/following{/other_user}","gists_url":"https://api.github.com/users/WPIRoboticsProjects/gists{/gist_id}","starred_url":"https://api.github.com/users/WPIRoboticsProjects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WPIRoboticsProjects/subscriptions","organizations_url":"https://api.github.com/users/WPIRoboticsProjects/orgs","repos_url":"https://api.github.com/users/WPIRoboticsProjects/repos","events_url":"https://api.github.com/users/WPIRoboticsProjects/events{/privacy}","received_events_url":"https://api.github.com/users/WPIRoboticsProjects/received_events","type":"Organization","site_admin":false},"repo":{"id":41505521,"name":"GRIP","full_name":"WPIRoboticsProjects/GRIP","owner":{"login":"WPIRoboticsProjects","id":14004340,"avatar_url":"https://avatars.githubusercontent.com/u/14004340?v=3","gravatar_id":"","url":"https://api.github.com/users/WPIRoboticsProjects","html_url":"https://github.com/WPIRoboticsProjects","followers_url":"https://api.github.com/users/WPIRoboticsProjects/followers","following_url":"https://api.github.com/users/WPIRoboticsProjects/following{/other_user}","gists_url":"https://api.github.com/users/WPIRoboticsProjects/gists{/gist_id}","starred_url":"https://api.github.com/users/WPIRoboticsProjects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WPIRoboticsProjects/subscriptions","organizations_url":"https://api.github.com/users/WPIRoboticsProjects/orgs","repos_url":"https://api.github.com/users/WPIRoboticsProjects/repos","events_url":"https://api.github.com/users/WPIRoboticsProjects/events{/privacy}","received_events_url":"https://api.github.com/users/WPIRoboticsProjects/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WPIRoboticsProjects/GRIP","description":"Program for rapidly developing computer vision applications","fork":false,"url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP","forks_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/forks","keys_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/teams","hooks_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/hooks","issue_events_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/events{/number}","events_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/events","assignees_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/assignees{/user}","branches_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/branches{/branch}","tags_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/tags","blobs_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/refs{/sha}","trees_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/statuses/{sha}","languages_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/languages","stargazers_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/stargazers","contributors_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/contributors","subscribers_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/subscribers","subscription_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/subscription","commits_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/commits{/sha}","git_commits_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/commits{/sha}","comments_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/comments{/number}","issue_comment_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/comments{/number}","contents_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/contents/{+path}","compare_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/merges","archive_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/downloads","issues_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues{/number}","pulls_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls{/number}","milestones_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/milestones{/number}","notifications_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/labels{/name}","releases_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/releases{/id}","deployments_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/deployments","created_at":"2015-08-27T18:59:07Z","updated_at":"2016-06-06T10:25:39Z","pushed_at":"2016-07-08T06:58:08Z","git_url":"git://github.com/WPIRoboticsProjects/GRIP.git","ssh_url":"git@github.com:WPIRoboticsProjects/GRIP.git","clone_url":"https://github.com/WPIRoboticsProjects/GRIP.git","svn_url":"https://github.com/WPIRoboticsProjects/GRIP","homepage":"http://wpiroboticsprojects.github.io/GRIP","size":51825,"stargazers_count":105,"watchers_count":105,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":50,"mirror_url":null,"open_issues_count":105,"forks":50,"open_issues":105,"watchers":105,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/597"},"html":{"href":"https://github.com/WPIRoboticsProjects/GRIP/pull/597"},"issue":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/597"},"comments":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/597/comments"},"review_comments":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/597/comments"},"review_comment":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/597/commits"},"statuses":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/statuses/179e3dc27b8f64a1624dfa9aa380148bdfe1e582"}}}}
{"actor":{"display_login":"AustinShalit"}}