GitHub PullRequestReviewCommentEvent at 2014-12-08 03:00:31
Repository: ola
Actor: nomis52
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/comments/21433054","id":21433054,"diff_hunk":"@@ -0,0 +1,125 @@\n+/*\n+ * This program is free software; you can redistribute it and/or modify\n+ * it under the terms of the GNU General Public License as published by\n+ * the Free Software Foundation; either version 2 of the License, or\n+ * (at your option) any later version.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU Library General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU General Public License\n+ * along with this program; if not, write to the Free Software\n+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n+ *\n+ * OPCDevice.cpp\n+ * The Open Pixel Control Device.\n+ * Copyright (C) 2014 Simon Newton\n+ */\n+\n+#include \"plugins/openpixelcontrol/OPCDevice.h\"\n+\n+#include <sstream>\n+#include <set>\n+#include <string>\n+#include <vector>\n+\n+#include \"ola/Logging.h\"\n+#include \"olad/Preferences.h\"\n+#include \"plugins/openpixelcontrol/OPCClient.h\"\n+#include \"plugins/openpixelcontrol/OPCPort.h\"\n+#include \"plugins/openpixelcontrol/OPCServer.h\"\n+\n+namespace ola {\n+namespace plugin {\n+namespace openpixelcontrol {\n+\n+using ola::AbstractPlugin;\n+using std::ostringstream;\n+using std::set;\n+using std::string;\n+using std::vector;\n+\n+namespace {\n+\n+set<uint8_t> DeDupChannels(const vector<string> &channels) {\n+  set<uint8_t> output;\n+\n+  vector<string>::const_iterator iter = channels.begin();\n+  for (; iter != channels.end(); ++iter) {\n+    uint8_t channel;\n+    if (!StringToInt(*iter, &channel)) {\n+      OLA_WARN << \"Invalid Open Pixel Control channel \" << *iter;\n+      continue;\n+    }\n+    output.insert(channel);\n+  }\n+  return output;\n+}\n+}  // namespace\n+\n+OPCServerDevice::OPCServerDevice(\n+    AbstractPlugin *owner,\n+    PluginAdaptor *plugin_adaptor,\n+    Preferences *preferences,\n+    const ola::network::IPV4SocketAddress listen_addr)\n+    : Device(owner, \"OPC Server: \" + listen_addr.ToString()),\n+      m_plugin_adaptor(plugin_adaptor),\n+      m_preferences(preferences),\n+      m_listen_addr(listen_addr),\n+      m_server(new OPCServer(plugin_adaptor, listen_addr)) {\n+}\n+\n+string OPCServerDevice::DeviceId() const {\n+  return m_listen_addr.ToString();\n+}\n+\n+bool OPCServerDevice::StartHook() {\n+  if (!m_server->Init()) {\n+    return false;\n+  }\n+\n+  ostringstream str;\n+  str << \"listen_\" << m_listen_addr.ToString() << \"_channel\";","path":"plugins/openpixelcontrol/OPCDevice.cpp","position":84,"original_position":84,"commit_id":"ca02b455dc4a2739ceae691be9fe32939d9c64a0","original_commit_id":"ca02b455dc4a2739ceae691be9fe32939d9c64a0","user":{"login":"nomis52","id":4355332,"avatar_url":"https://avatars.githubusercontent.com/u/4355332?v=3","gravatar_id":"","url":"https://api.github.com/users/nomis52","html_url":"https://github.com/nomis52","followers_url":"https://api.github.com/users/nomis52/followers","following_url":"https://api.github.com/users/nomis52/following{/other_user}","gists_url":"https://api.github.com/users/nomis52/gists{/gist_id}","starred_url":"https://api.github.com/users/nomis52/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomis52/subscriptions","organizations_url":"https://api.github.com/users/nomis52/orgs","repos_url":"https://api.github.com/users/nomis52/repos","events_url":"https://api.github.com/users/nomis52/events{/privacy}","received_events_url":"https://api.github.com/users/nomis52/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2014-12-08T03:00:31Z","updated_at":"2014-12-08T03:00:31Z","html_url":"https://github.com/OpenLightingProject/ola/pull/562#discussion_r21433054","pull_request_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/562","_links":{"self":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/comments/21433054"},"html":{"href":"https://github.com/OpenLightingProject/ola/pull/562#discussion_r21433054"},"pull_request":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/562"}}},"pull_request":{"url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/562","id":25620732,"html_url":"https://github.com/OpenLightingProject/ola/pull/562","diff_url":"https://github.com/OpenLightingProject/ola/pull/562.diff","patch_url":"https://github.com/OpenLightingProject/ola/pull/562.patch","issue_url":"https://api.github.com/repos/OpenLightingProject/ola/issues/562","number":562,"state":"closed","locked":false,"title":"Add support for the Open Pixel Control Protocol, Closes #502.","user":{"login":"nomis52","id":4355332,"avatar_url":"https://avatars.githubusercontent.com/u/4355332?v=3","gravatar_id":"","url":"https://api.github.com/users/nomis52","html_url":"https://github.com/nomis52","followers_url":"https://api.github.com/users/nomis52/followers","following_url":"https://api.github.com/users/nomis52/following{/other_user}","gists_url":"https://api.github.com/users/nomis52/gists{/gist_id}","starred_url":"https://api.github.com/users/nomis52/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomis52/subscriptions","organizations_url":"https://api.github.com/users/nomis52/orgs","repos_url":"https://api.github.com/users/nomis52/repos","events_url":"https://api.github.com/users/nomis52/events{/privacy}","received_events_url":"https://api.github.com/users/nomis52/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-12-06T16:41:37Z","updated_at":"2014-12-08T03:00:31Z","closed_at":"2014-12-07T22:29:48Z","merged_at":"2014-12-07T22:29:48Z","merge_commit_sha":"b13292b117a5c24a005bacbe11179155ad0f3ca6","assignee":{"login":"peternewman","id":6216436,"avatar_url":"https://avatars.githubusercontent.com/u/6216436?v=3","gravatar_id":"","url":"https://api.github.com/users/peternewman","html_url":"https://github.com/peternewman","followers_url":"https://api.github.com/users/peternewman/followers","following_url":"https://api.github.com/users/peternewman/following{/other_user}","gists_url":"https://api.github.com/users/peternewman/gists{/gist_id}","starred_url":"https://api.github.com/users/peternewman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peternewman/subscriptions","organizations_url":"https://api.github.com/users/peternewman/orgs","repos_url":"https://api.github.com/users/peternewman/repos","events_url":"https://api.github.com/users/peternewman/events{/privacy}","received_events_url":"https://api.github.com/users/peternewman/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/OpenLightingProject/ola/milestones/1","labels_url":"https://api.github.com/repos/OpenLightingProject/ola/milestones/1/labels","id":894103,"number":1,"title":"0.9.4","description":"Next release. Mostly feature orientated.","creator":{"login":"nomis52","id":4355332,"avatar_url":"https://avatars.githubusercontent.com/u/4355332?v=3","gravatar_id":"","url":"https://api.github.com/users/nomis52","html_url":"https://github.com/nomis52","followers_url":"https://api.github.com/users/nomis52/followers","following_url":"https://api.github.com/users/nomis52/following{/other_user}","gists_url":"https://api.github.com/users/nomis52/gists{/gist_id}","starred_url":"https://api.github.com/users/nomis52/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomis52/subscriptions","organizations_url":"https://api.github.com/users/nomis52/orgs","repos_url":"https://api.github.com/users/nomis52/repos","events_url":"https://api.github.com/users/nomis52/events{/privacy}","received_events_url":"https://api.github.com/users/nomis52/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":4,"state":"open","created_at":"2014-12-06T17:40:20Z","updated_at":"2014-12-08T01:34:03Z","due_on":"2014-12-31T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/562/commits","review_comments_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/562/comments","review_comment_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/comments/{number}","comments_url":"https://api.github.com/repos/OpenLightingProject/ola/issues/562/comments","statuses_url":"https://api.github.com/repos/OpenLightingProject/ola/statuses/ca02b455dc4a2739ceae691be9fe32939d9c64a0","head":{"label":"nomis52:opc","ref":"opc","sha":"ca02b455dc4a2739ceae691be9fe32939d9c64a0","user":{"login":"nomis52","id":4355332,"avatar_url":"https://avatars.githubusercontent.com/u/4355332?v=3","gravatar_id":"","url":"https://api.github.com/users/nomis52","html_url":"https://github.com/nomis52","followers_url":"https://api.github.com/users/nomis52/followers","following_url":"https://api.github.com/users/nomis52/following{/other_user}","gists_url":"https://api.github.com/users/nomis52/gists{/gist_id}","starred_url":"https://api.github.com/users/nomis52/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomis52/subscriptions","organizations_url":"https://api.github.com/users/nomis52/orgs","repos_url":"https://api.github.com/users/nomis52/repos","events_url":"https://api.github.com/users/nomis52/events{/privacy}","received_events_url":"https://api.github.com/users/nomis52/received_events","type":"User","site_admin":false},"repo":{"id":15822023,"name":"ola","full_name":"nomis52/ola","owner":{"login":"nomis52","id":4355332,"avatar_url":"https://avatars.githubusercontent.com/u/4355332?v=3","gravatar_id":"","url":"https://api.github.com/users/nomis52","html_url":"https://github.com/nomis52","followers_url":"https://api.github.com/users/nomis52/followers","following_url":"https://api.github.com/users/nomis52/following{/other_user}","gists_url":"https://api.github.com/users/nomis52/gists{/gist_id}","starred_url":"https://api.github.com/users/nomis52/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomis52/subscriptions","organizations_url":"https://api.github.com/users/nomis52/orgs","repos_url":"https://api.github.com/users/nomis52/repos","events_url":"https://api.github.com/users/nomis52/events{/privacy}","received_events_url":"https://api.github.com/users/nomis52/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nomis52/ola","description":"The Open Lighting Architecture","fork":true,"url":"https://api.github.com/repos/nomis52/ola","forks_url":"https://api.github.com/repos/nomis52/ola/forks","keys_url":"https://api.github.com/repos/nomis52/ola/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nomis52/ola/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nomis52/ola/teams","hooks_url":"https://api.github.com/repos/nomis52/ola/hooks","issue_events_url":"https://api.github.com/repos/nomis52/ola/issues/events{/number}","events_url":"https://api.github.com/repos/nomis52/ola/events","assignees_url":"https://api.github.com/repos/nomis52/ola/assignees{/user}","branches_url":"https://api.github.com/repos/nomis52/ola/branches{/branch}","tags_url":"https://api.github.com/repos/nomis52/ola/tags","blobs_url":"https://api.github.com/repos/nomis52/ola/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nomis52/ola/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nomis52/ola/git/refs{/sha}","trees_url":"https://api.github.com/repos/nomis52/ola/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nomis52/ola/statuses/{sha}","languages_url":"https://api.github.com/repos/nomis52/ola/languages","stargazers_url":"https://api.github.com/repos/nomis52/ola/stargazers","contributors_url":"https://api.github.com/repos/nomis52/ola/contributors","subscribers_url":"https://api.github.com/repos/nomis52/ola/subscribers","subscription_url":"https://api.github.com/repos/nomis52/ola/subscription","commits_url":"https://api.github.com/repos/nomis52/ola/commits{/sha}","git_commits_url":"https://api.github.com/repos/nomis52/ola/git/commits{/sha}","comments_url":"https://api.github.com/repos/nomis52/ola/comments{/number}","issue_comment_url":"https://api.github.com/repos/nomis52/ola/issues/comments/{number}","contents_url":"https://api.github.com/repos/nomis52/ola/contents/{+path}","compare_url":"https://api.github.com/repos/nomis52/ola/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nomis52/ola/merges","archive_url":"https://api.github.com/repos/nomis52/ola/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nomis52/ola/downloads","issues_url":"https://api.github.com/repos/nomis52/ola/issues{/number}","pulls_url":"https://api.github.com/repos/nomis52/ola/pulls{/number}","milestones_url":"https://api.github.com/repos/nomis52/ola/milestones{/number}","notifications_url":"https://api.github.com/repos/nomis52/ola/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nomis52/ola/labels{/name}","releases_url":"https://api.github.com/repos/nomis52/ola/releases{/id}","created_at":"2014-01-11T12:21:27Z","updated_at":"2014-12-02T17:17:01Z","pushed_at":"2014-12-08T03:00:01Z","git_url":"git://github.com/nomis52/ola.git","ssh_url":"git@github.com:nomis52/ola.git","clone_url":"https://github.com/nomis52/ola.git","svn_url":"https://github.com/nomis52/ola","homepage":null,"size":16025,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"OpenLightingProject:master","ref":"master","sha":"18f5f8c73f0938a38fb05537b844ba6b1d6613cc","user":{"login":"OpenLightingProject","id":6199314,"avatar_url":"https://avatars.githubusercontent.com/u/6199314?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenLightingProject","html_url":"https://github.com/OpenLightingProject","followers_url":"https://api.github.com/users/OpenLightingProject/followers","following_url":"https://api.github.com/users/OpenLightingProject/following{/other_user}","gists_url":"https://api.github.com/users/OpenLightingProject/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenLightingProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenLightingProject/subscriptions","organizations_url":"https://api.github.com/users/OpenLightingProject/orgs","repos_url":"https://api.github.com/users/OpenLightingProject/repos","events_url":"https://api.github.com/users/OpenLightingProject/events{/privacy}","received_events_url":"https://api.github.com/users/OpenLightingProject/received_events","type":"Organization","site_admin":false},"repo":{"id":15233168,"name":"ola","full_name":"OpenLightingProject/ola","owner":{"login":"OpenLightingProject","id":6199314,"avatar_url":"https://avatars.githubusercontent.com/u/6199314?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenLightingProject","html_url":"https://github.com/OpenLightingProject","followers_url":"https://api.github.com/users/OpenLightingProject/followers","following_url":"https://api.github.com/users/OpenLightingProject/following{/other_user}","gists_url":"https://api.github.com/users/OpenLightingProject/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenLightingProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenLightingProject/subscriptions","organizations_url":"https://api.github.com/users/OpenLightingProject/orgs","repos_url":"https://api.github.com/users/OpenLightingProject/repos","events_url":"https://api.github.com/users/OpenLightingProject/events{/privacy}","received_events_url":"https://api.github.com/users/OpenLightingProject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenLightingProject/ola","description":"The Open Lighting Architecture","fork":false,"url":"https://api.github.com/repos/OpenLightingProject/ola","forks_url":"https://api.github.com/repos/OpenLightingProject/ola/forks","keys_url":"https://api.github.com/repos/OpenLightingProject/ola/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenLightingProject/ola/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenLightingProject/ola/teams","hooks_url":"https://api.github.com/repos/OpenLightingProject/ola/hooks","issue_events_url":"https://api.github.com/repos/OpenLightingProject/ola/issues/events{/number}","events_url":"https://api.github.com/repos/OpenLightingProject/ola/events","assignees_url":"https://api.github.com/repos/OpenLightingProject/ola/assignees{/user}","branches_url":"https://api.github.com/repos/OpenLightingProject/ola/branches{/branch}","tags_url":"https://api.github.com/repos/OpenLightingProject/ola/tags","blobs_url":"https://api.github.com/repos/OpenLightingProject/ola/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenLightingProject/ola/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenLightingProject/ola/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenLightingProject/ola/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenLightingProject/ola/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenLightingProject/ola/languages","stargazers_url":"https://api.github.com/repos/OpenLightingProject/ola/stargazers","contributors_url":"https://api.github.com/repos/OpenLightingProject/ola/contributors","subscribers_url":"https://api.github.com/repos/OpenLightingProject/ola/subscribers","subscription_url":"https://api.github.com/repos/OpenLightingProject/ola/subscription","commits_url":"https://api.github.com/repos/OpenLightingProject/ola/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenLightingProject/ola/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenLightingProject/ola/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenLightingProject/ola/issues/comments/{number}","contents_url":"https://api.github.com/repos/OpenLightingProject/ola/contents/{+path}","compare_url":"https://api.github.com/repos/OpenLightingProject/ola/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenLightingProject/ola/merges","archive_url":"https://api.github.com/repos/OpenLightingProject/ola/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenLightingProject/ola/downloads","issues_url":"https://api.github.com/repos/OpenLightingProject/ola/issues{/number}","pulls_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenLightingProject/ola/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenLightingProject/ola/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenLightingProject/ola/labels{/name}","releases_url":"https://api.github.com/repos/OpenLightingProject/ola/releases{/id}","created_at":"2013-12-16T18:06:52Z","updated_at":"2014-12-07T22:29:49Z","pushed_at":"2014-12-07T22:29:49Z","git_url":"git://github.com/OpenLightingProject/ola.git","ssh_url":"git@github.com:OpenLightingProject/ola.git","clone_url":"https://github.com/OpenLightingProject/ola.git","svn_url":"https://github.com/OpenLightingProject/ola","homepage":null,"size":18611,"stargazers_count":61,"watchers_count":61,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":70,"forks":32,"open_issues":70,"watchers":61,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/562"},"html":{"href":"https://github.com/OpenLightingProject/ola/pull/562"},"issue":{"href":"https://api.github.com/repos/OpenLightingProject/ola/issues/562"},"comments":{"href":"https://api.github.com/repos/OpenLightingProject/ola/issues/562/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/562/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/562/commits"},"statuses":{"href":"https://api.github.com/repos/OpenLightingProject/ola/statuses/ca02b455dc4a2739ceae691be9fe32939d9c64a0"}}}}