{"action":"created","comment":{"url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/pulls/comments/232473740","pull_request_review_id":173683822,"id":232473740,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjQ3Mzc0MA==","diff_hunk":"@@ -0,0 +1,77 @@\n+using System;\n+using System.Timers;\n+\n+namespace Transportation.Demo.Devices.Base\n+{\n+    public class SimulatedEvent\n+    {\n+        private Timer eventTimer;\n+        private double interval;\n+        private double jitter; \n+        public delegate void eventDelegate();\n+        private long eventCount = 0;\n+\n+        private eventDelegate timerfunction;\n+\n+        // constructor\n+        public SimulatedEvent(double interval, double jitter, eventDelegate timerfunction)\n+        {\n+            // jitter must be a positive value\n+            if (jitter < 0)\n+                throw new ArgumentException(\"Jitter value must be >= 0\");\n+            else\n+                this.jitter = jitter;\n+\n+            // interval must be at greater than or equal to the jitter value\n+            if (interval < jitter)\n+                throw new ArgumentException(\"interval must be >= jitter value\");\n+            else\n+                this.interval = interval;\n+\n+            this.timerfunction = timerfunction;\n+\n+            eventTimer = new Timer(this.CalculateNextInterval());","path":"src/Devices/Base/SimulatedEvent.cs","position":33,"original_position":33,"commit_id":"bfeaba80c76814095f19b8e3257c0359125295e0","original_commit_id":"bfeaba80c76814095f19b8e3257c0359125295e0","user":{"login":"Sarah-Aly","id":26885551,"node_id":"MDQ6VXNlcjI2ODg1NTUx","avatar_url":"https://avatars0.githubusercontent.com/u/26885551?v=4","gravatar_id":"","url":"https://api.github.com/users/Sarah-Aly","html_url":"https://github.com/Sarah-Aly","followers_url":"https://api.github.com/users/Sarah-Aly/followers","following_url":"https://api.github.com/users/Sarah-Aly/following{/other_user}","gists_url":"https://api.github.com/users/Sarah-Aly/gists{/gist_id}","starred_url":"https://api.github.com/users/Sarah-Aly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sarah-Aly/subscriptions","organizations_url":"https://api.github.com/users/Sarah-Aly/orgs","repos_url":"https://api.github.com/users/Sarah-Aly/repos","events_url":"https://api.github.com/users/Sarah-Aly/events{/privacy}","received_events_url":"https://api.github.com/users/Sarah-Aly/received_events","type":"User","site_admin":false},"body":"initialize the timer and call Start instead of giving it CalculateNextInterval here, so that we have one authority place that starts the timers.","created_at":"2018-11-11T04:04:09Z","updated_at":"2018-11-11T04:04:09Z","html_url":"https://github.com/brentstineman/Transit-IOTHub-Demo/pull/46#discussion_r232473740","pull_request_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/pulls/46","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/pulls/comments/232473740"},"html":{"href":"https://github.com/brentstineman/Transit-IOTHub-Demo/pull/46#discussion_r232473740"},"pull_request":{"href":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/pulls/46","id":229751614,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5NzUxNjE0","html_url":"https://github.com/brentstineman/Transit-IOTHub-Demo/pull/46","diff_url":"https://github.com/brentstineman/Transit-IOTHub-Demo/pull/46.diff","patch_url":"https://github.com/brentstineman/Transit-IOTHub-Demo/pull/46.patch","issue_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/issues/46","number":46,"state":"open","locked":false,"title":"Base device","user":{"login":"brentstineman","id":1760519,"node_id":"MDQ6VXNlcjE3NjA1MTk=","avatar_url":"https://avatars3.githubusercontent.com/u/1760519?v=4","gravatar_id":"","url":"https://api.github.com/users/brentstineman","html_url":"https://github.com/brentstineman","followers_url":"https://api.github.com/users/brentstineman/followers","following_url":"https://api.github.com/users/brentstineman/following{/other_user}","gists_url":"https://api.github.com/users/brentstineman/gists{/gist_id}","starred_url":"https://api.github.com/users/brentstineman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brentstineman/subscriptions","organizations_url":"https://api.github.com/users/brentstineman/orgs","repos_url":"https://api.github.com/users/brentstineman/repos","events_url":"https://api.github.com/users/brentstineman/events{/privacy}","received_events_url":"https://api.github.com/users/brentstineman/received_events","type":"User","site_admin":false},"body":"This PR implements a base device class that other device specific implementations can leverage. It moves some functions from the device host (the console applications) to the base class and the device specific implementations. \r\n\r\nThis PR also introduces a SimulatedEvent class that can be used to easily create multiple simulated events based on an interval and a 'jitter' value (variation in the interval). These events are added to a collection managed by the base device and have global start/stop methods at the base device class to enable them to be easily started. \r\n\r\nclose #1 ","created_at":"2018-11-09T16:40:12Z","updated_at":"2018-11-11T04:04:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a7887c37cce0bc3c2381891d22e0a9e005789eee","assignee":null,"assignees":[],"requested_reviewers":[{"login":"caschw","id":1590379,"node_id":"MDQ6VXNlcjE1OTAzNzk=","avatar_url":"https://avatars0.githubusercontent.com/u/1590379?v=4","gravatar_id":"","url":"https://api.github.com/users/caschw","html_url":"https://github.com/caschw","followers_url":"https://api.github.com/users/caschw/followers","following_url":"https://api.github.com/users/caschw/following{/other_user}","gists_url":"https://api.github.com/users/caschw/gists{/gist_id}","starred_url":"https://api.github.com/users/caschw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caschw/subscriptions","organizations_url":"https://api.github.com/users/caschw/orgs","repos_url":"https://api.github.com/users/caschw/repos","events_url":"https://api.github.com/users/caschw/events{/privacy}","received_events_url":"https://api.github.com/users/caschw/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/pulls/46/commits","review_comments_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/pulls/46/comments","review_comment_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/issues/46/comments","statuses_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/statuses/bfeaba80c76814095f19b8e3257c0359125295e0","head":{"label":"brentstineman:BaseDevice","ref":"BaseDevice","sha":"bfeaba80c76814095f19b8e3257c0359125295e0","user":{"login":"brentstineman","id":1760519,"node_id":"MDQ6VXNlcjE3NjA1MTk=","avatar_url":"https://avatars3.githubusercontent.com/u/1760519?v=4","gravatar_id":"","url":"https://api.github.com/users/brentstineman","html_url":"https://github.com/brentstineman","followers_url":"https://api.github.com/users/brentstineman/followers","following_url":"https://api.github.com/users/brentstineman/following{/other_user}","gists_url":"https://api.github.com/users/brentstineman/gists{/gist_id}","starred_url":"https://api.github.com/users/brentstineman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brentstineman/subscriptions","organizations_url":"https://api.github.com/users/brentstineman/orgs","repos_url":"https://api.github.com/users/brentstineman/repos","events_url":"https://api.github.com/users/brentstineman/events{/privacy}","received_events_url":"https://api.github.com/users/brentstineman/received_events","type":"User","site_admin":false},"repo":{"id":151582980,"node_id":"MDEwOlJlcG9zaXRvcnkxNTE1ODI5ODA=","name":"Transit-IOTHub-Demo","full_name":"brentstineman/Transit-IOTHub-Demo","private":false,"owner":{"login":"brentstineman","id":1760519,"node_id":"MDQ6VXNlcjE3NjA1MTk=","avatar_url":"https://avatars3.githubusercontent.com/u/1760519?v=4","gravatar_id":"","url":"https://api.github.com/users/brentstineman","html_url":"https://github.com/brentstineman","followers_url":"https://api.github.com/users/brentstineman/followers","following_url":"https://api.github.com/users/brentstineman/following{/other_user}","gists_url":"https://api.github.com/users/brentstineman/gists{/gist_id}","starred_url":"https://api.github.com/users/brentstineman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brentstineman/subscriptions","organizations_url":"https://api.github.com/users/brentstineman/orgs","repos_url":"https://api.github.com/users/brentstineman/repos","events_url":"https://api.github.com/users/brentstineman/events{/privacy}","received_events_url":"https://api.github.com/users/brentstineman/received_events","type":"User","site_admin":false},"html_url":"https://github.com/brentstineman/Transit-IOTHub-Demo","description":"A demo/simulation of a transition solution using Azure IOT Hub","fork":false,"url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo","forks_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/forks","keys_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/teams","hooks_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/hooks","issue_events_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/issues/events{/number}","events_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/events","assignees_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/assignees{/user}","branches_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/branches{/branch}","tags_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/tags","blobs_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/git/refs{/sha}","trees_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/statuses/{sha}","languages_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/languages","stargazers_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/stargazers","contributors_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/contributors","subscribers_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/subscribers","subscription_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/subscription","commits_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/commits{/sha}","git_commits_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/git/commits{/sha}","comments_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/comments{/number}","issue_comment_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/issues/comments{/number}","contents_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/contents/{+path}","compare_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/merges","archive_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/downloads","issues_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/issues{/number}","pulls_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/pulls{/number}","milestones_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/milestones{/number}","notifications_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/labels{/name}","releases_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/releases{/id}","deployments_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/deployments","created_at":"2018-10-04T14:12:31Z","updated_at":"2018-11-08T16:13:19Z","pushed_at":"2018-11-09T17:35:56Z","git_url":"git://github.com/brentstineman/Transit-IOTHub-Demo.git","ssh_url":"git@github.com:brentstineman/Transit-IOTHub-Demo.git","clone_url":"https://github.com/brentstineman/Transit-IOTHub-Demo.git","svn_url":"https://github.com/brentstineman/Transit-IOTHub-Demo","homepage":null,"size":121,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":26,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":7,"open_issues":26,"watchers":1,"default_branch":"master"}},"base":{"label":"brentstineman:master","ref":"master","sha":"12be0198e2ee71af16edad96be9e141ee96b8d48","user":{"login":"brentstineman","id":1760519,"node_id":"MDQ6VXNlcjE3NjA1MTk=","avatar_url":"https://avatars3.githubusercontent.com/u/1760519?v=4","gravatar_id":"","url":"https://api.github.com/users/brentstineman","html_url":"https://github.com/brentstineman","followers_url":"https://api.github.com/users/brentstineman/followers","following_url":"https://api.github.com/users/brentstineman/following{/other_user}","gists_url":"https://api.github.com/users/brentstineman/gists{/gist_id}","starred_url":"https://api.github.com/users/brentstineman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brentstineman/subscriptions","organizations_url":"https://api.github.com/users/brentstineman/orgs","repos_url":"https://api.github.com/users/brentstineman/repos","events_url":"https://api.github.com/users/brentstineman/events{/privacy}","received_events_url":"https://api.github.com/users/brentstineman/received_events","type":"User","site_admin":false},"repo":{"id":151582980,"node_id":"MDEwOlJlcG9zaXRvcnkxNTE1ODI5ODA=","name":"Transit-IOTHub-Demo","full_name":"brentstineman/Transit-IOTHub-Demo","private":false,"owner":{"login":"brentstineman","id":1760519,"node_id":"MDQ6VXNlcjE3NjA1MTk=","avatar_url":"https://avatars3.githubusercontent.com/u/1760519?v=4","gravatar_id":"","url":"https://api.github.com/users/brentstineman","html_url":"https://github.com/brentstineman","followers_url":"https://api.github.com/users/brentstineman/followers","following_url":"https://api.github.com/users/brentstineman/following{/other_user}","gists_url":"https://api.github.com/users/brentstineman/gists{/gist_id}","starred_url":"https://api.github.com/users/brentstineman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brentstineman/subscriptions","organizations_url":"https://api.github.com/users/brentstineman/orgs","repos_url":"https://api.github.com/users/brentstineman/repos","events_url":"https://api.github.com/users/brentstineman/events{/privacy}","received_events_url":"https://api.github.com/users/brentstineman/received_events","type":"User","site_admin":false},"html_url":"https://github.com/brentstineman/Transit-IOTHub-Demo","description":"A demo/simulation of a transition solution using Azure IOT Hub","fork":false,"url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo","forks_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/forks","keys_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/teams","hooks_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/hooks","issue_events_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/issues/events{/number}","events_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/events","assignees_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/assignees{/user}","branches_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/branches{/branch}","tags_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/tags","blobs_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/git/refs{/sha}","trees_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/statuses/{sha}","languages_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/languages","stargazers_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/stargazers","contributors_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/contributors","subscribers_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/subscribers","subscription_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/subscription","commits_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/commits{/sha}","git_commits_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/git/commits{/sha}","comments_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/comments{/number}","issue_comment_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/issues/comments{/number}","contents_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/contents/{+path}","compare_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/merges","archive_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/downloads","issues_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/issues{/number}","pulls_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/pulls{/number}","milestones_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/milestones{/number}","notifications_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/labels{/name}","releases_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/releases{/id}","deployments_url":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/deployments","created_at":"2018-10-04T14:12:31Z","updated_at":"2018-11-08T16:13:19Z","pushed_at":"2018-11-09T17:35:56Z","git_url":"git://github.com/brentstineman/Transit-IOTHub-Demo.git","ssh_url":"git@github.com:brentstineman/Transit-IOTHub-Demo.git","clone_url":"https://github.com/brentstineman/Transit-IOTHub-Demo.git","svn_url":"https://github.com/brentstineman/Transit-IOTHub-Demo","homepage":null,"size":121,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":26,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":7,"open_issues":26,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/pulls/46"},"html":{"href":"https://github.com/brentstineman/Transit-IOTHub-Demo/pull/46"},"issue":{"href":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/issues/46"},"comments":{"href":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/brentstineman/Transit-IOTHub-Demo/statuses/bfeaba80c76814095f19b8e3257c0359125295e0"}},"author_association":"OWNER"}}
{"actor":{"display_login":"Sarah-Aly"}}