{"action":"created","comment":{"url":"https://api.github.com/repos/vpsinc/DCSimScala/pulls/comments/42563034","id":42563034,"diff_hunk":"@@ -13,33 +11,77 @@ import org.snmp4j.smi.Integer32\n  * Created by jakewang on 10/12/15.\n  */\n \n+/**\n+ * Container to store the status of the UPS\n+ */\n+class UpsStatusObject () {\n+  var name: String = null\n+  var ip: String = null\n+  var srcIp: String = null\n+\n+  var id: UUID = null\n+\n+  var port: Integer = null\n+  var maxUtilityPower: Integer = null\n+  var utilityPower: Integer = null\n+  var batteryPower: Integer = null\n+  var batteryChargeRate: Integer = null\n+  var powerLimit: Integer = null\n+  var prevPowerLimit: Integer = null\n+  var lastConnectTime: Integer = null\n+  var connectionStatus: Integer = null\n+  var lastConnectLimitTime: Integer = null\n+  var connectionLimitStatus: Integer = null\n+\n+  var batterySOC: Integer = null\n+  var batteryDod: Integer = null\n+  var batterySocChange: Integer = null\n+  var avgPingTime: Integer = null\n+\n+  var autoCharge: Boolean = false\n+  var peakShaveEnable: Boolean = false\n+  var upsMode: Boolean = false\n+  var outputOn: Boolean = false\n+}\n+\n+/**\n+ * Actor that mimics a UPS\n+ *\n+ * @param rackRef ActorRef to the rack that this UPS belongs to\n+ * @param upsName String Name of the UPS\n+ * @param upsIp String IPAddress in the format x.x.x.x that the SNMP agent should operate on\n+ * @param upsPort Integer Port number that the SNMP agent will listen on\n+ * @param options UPSActor options (ported from previous js version)\n+ */\n class UpsActor(rackRef: ActorRef, upsName: String, upsIp: String, upsPort: Integer, options: String)  extends Actor {\n \n-  val name = \"[UPS: \" + upsName + \"]\"\n-  val id = UUID.random\n-  val ip = upsIp\n-  val port = upsPort\n+  var status : UpsStatusObject = new UpsStatusObject()\n+  status.name = \"[UPS: \" + upsName + \"]\"\n+  status.id = UUID.random\n+  status.ip = upsIp\n+  status.srcIp = \"\"\n+  status.port = upsPort\n+  status.autoCharge = false\n+  status.utilityPower = 0\n+  status.upsMode = false\n+  status.peakShaveEnable = true\n+  status.outputOn = true\n+  status.maxUtilityPower = 0\n+  status.batteryPower = 0\n+  status.batteryChargeRate = 0\n+  status.powerLimit = 3273\n+  status.prevPowerLimit = 3273\n+  status.lastConnectTime = 0\n+  status.connectionStatus = -1\n+  status.connectionLimitStatus = -1\n+  status.lastConnectLimitTime = 0\n+\n+  // Internal state that is not sent via the status object\n   val batteryCapacity = 1100\n   val maxInputPower = 6000\n   val maxOutputPower = 6000\n-  var autoCharge: Boolean = false\n-\n-  var dcsimAgent = new DCSimAgent(upsIp,upsPort, self)","path":"src/main/scala/Rack/UpsActor.scala","position":87,"original_position":87,"commit_id":"dee7fbbc04359d2a697120c7cfc0270e474b71c6","original_commit_id":"dee7fbbc04359d2a697120c7cfc0270e474b71c6","user":{"login":"elkanwang","id":4806046,"avatar_url":"https://avatars.githubusercontent.com/u/4806046?v=3","gravatar_id":"","url":"https://api.github.com/users/elkanwang","html_url":"https://github.com/elkanwang","followers_url":"https://api.github.com/users/elkanwang/followers","following_url":"https://api.github.com/users/elkanwang/following{/other_user}","gists_url":"https://api.github.com/users/elkanwang/gists{/gist_id}","starred_url":"https://api.github.com/users/elkanwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elkanwang/subscriptions","organizations_url":"https://api.github.com/users/elkanwang/orgs","repos_url":"https://api.github.com/users/elkanwang/repos","events_url":"https://api.github.com/users/elkanwang/events{/privacy}","received_events_url":"https://api.github.com/users/elkanwang/received_events","type":"User","site_admin":false},"body":"format the space","created_at":"2015-10-20T22:25:17Z","updated_at":"2015-10-20T22:25:17Z","html_url":"https://github.com/vpsinc/DCSimScala/pull/1#discussion_r42563034","pull_request_url":"https://api.github.com/repos/vpsinc/DCSimScala/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/vpsinc/DCSimScala/pulls/comments/42563034"},"html":{"href":"https://github.com/vpsinc/DCSimScala/pull/1#discussion_r42563034"},"pull_request":{"href":"https://api.github.com/repos/vpsinc/DCSimScala/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/vpsinc/DCSimScala/pulls/1","id":48257430,"html_url":"https://github.com/vpsinc/DCSimScala/pull/1","diff_url":"https://github.com/vpsinc/DCSimScala/pull/1.diff","patch_url":"https://github.com/vpsinc/DCSimScala/pull/1.patch","issue_url":"https://api.github.com/repos/vpsinc/DCSimScala/issues/1","number":1,"state":"open","locked":false,"title":"Samuel/hooking up ups","user":{"login":"swmyuen","id":6742040,"avatar_url":"https://avatars.githubusercontent.com/u/6742040?v=3","gravatar_id":"","url":"https://api.github.com/users/swmyuen","html_url":"https://github.com/swmyuen","followers_url":"https://api.github.com/users/swmyuen/followers","following_url":"https://api.github.com/users/swmyuen/following{/other_user}","gists_url":"https://api.github.com/users/swmyuen/gists{/gist_id}","starred_url":"https://api.github.com/users/swmyuen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swmyuen/subscriptions","organizations_url":"https://api.github.com/users/swmyuen/orgs","repos_url":"https://api.github.com/users/swmyuen/repos","events_url":"https://api.github.com/users/swmyuen/events{/privacy}","received_events_url":"https://api.github.com/users/swmyuen/received_events","type":"User","site_admin":false},"body":"ups stuff\r\n\r\nThings left to do:\r\n- Send messages to rack\r\n- Dispatcher to send status\r\n- How timestamps are handled\r\n- Testing lol","created_at":"2015-10-20T21:02:37Z","updated_at":"2015-10-20T22:25:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f320a147041bccc9d3bb1514f8dec2fc1576f96","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/vpsinc/DCSimScala/pulls/1/commits","review_comments_url":"https://api.github.com/repos/vpsinc/DCSimScala/pulls/1/comments","review_comment_url":"https://api.github.com/repos/vpsinc/DCSimScala/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vpsinc/DCSimScala/issues/1/comments","statuses_url":"https://api.github.com/repos/vpsinc/DCSimScala/statuses/dee7fbbc04359d2a697120c7cfc0270e474b71c6","head":{"label":"vpsinc:samuel/hooking-up-ups","ref":"samuel/hooking-up-ups","sha":"dee7fbbc04359d2a697120c7cfc0270e474b71c6","user":{"login":"vpsinc","id":7947106,"avatar_url":"https://avatars.githubusercontent.com/u/7947106?v=3","gravatar_id":"","url":"https://api.github.com/users/vpsinc","html_url":"https://github.com/vpsinc","followers_url":"https://api.github.com/users/vpsinc/followers","following_url":"https://api.github.com/users/vpsinc/following{/other_user}","gists_url":"https://api.github.com/users/vpsinc/gists{/gist_id}","starred_url":"https://api.github.com/users/vpsinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpsinc/subscriptions","organizations_url":"https://api.github.com/users/vpsinc/orgs","repos_url":"https://api.github.com/users/vpsinc/repos","events_url":"https://api.github.com/users/vpsinc/events{/privacy}","received_events_url":"https://api.github.com/users/vpsinc/received_events","type":"Organization","site_admin":false},"repo":{"id":44127359,"name":"DCSimScala","full_name":"vpsinc/DCSimScala","owner":{"login":"vpsinc","id":7947106,"avatar_url":"https://avatars.githubusercontent.com/u/7947106?v=3","gravatar_id":"","url":"https://api.github.com/users/vpsinc","html_url":"https://github.com/vpsinc","followers_url":"https://api.github.com/users/vpsinc/followers","following_url":"https://api.github.com/users/vpsinc/following{/other_user}","gists_url":"https://api.github.com/users/vpsinc/gists{/gist_id}","starred_url":"https://api.github.com/users/vpsinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpsinc/subscriptions","organizations_url":"https://api.github.com/users/vpsinc/orgs","repos_url":"https://api.github.com/users/vpsinc/repos","events_url":"https://api.github.com/users/vpsinc/events{/privacy}","received_events_url":"https://api.github.com/users/vpsinc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vpsinc/DCSimScala","description":"Scala implementation of DCSim","fork":false,"url":"https://api.github.com/repos/vpsinc/DCSimScala","forks_url":"https://api.github.com/repos/vpsinc/DCSimScala/forks","keys_url":"https://api.github.com/repos/vpsinc/DCSimScala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vpsinc/DCSimScala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vpsinc/DCSimScala/teams","hooks_url":"https://api.github.com/repos/vpsinc/DCSimScala/hooks","issue_events_url":"https://api.github.com/repos/vpsinc/DCSimScala/issues/events{/number}","events_url":"https://api.github.com/repos/vpsinc/DCSimScala/events","assignees_url":"https://api.github.com/repos/vpsinc/DCSimScala/assignees{/user}","branches_url":"https://api.github.com/repos/vpsinc/DCSimScala/branches{/branch}","tags_url":"https://api.github.com/repos/vpsinc/DCSimScala/tags","blobs_url":"https://api.github.com/repos/vpsinc/DCSimScala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vpsinc/DCSimScala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vpsinc/DCSimScala/git/refs{/sha}","trees_url":"https://api.github.com/repos/vpsinc/DCSimScala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vpsinc/DCSimScala/statuses/{sha}","languages_url":"https://api.github.com/repos/vpsinc/DCSimScala/languages","stargazers_url":"https://api.github.com/repos/vpsinc/DCSimScala/stargazers","contributors_url":"https://api.github.com/repos/vpsinc/DCSimScala/contributors","subscribers_url":"https://api.github.com/repos/vpsinc/DCSimScala/subscribers","subscription_url":"https://api.github.com/repos/vpsinc/DCSimScala/subscription","commits_url":"https://api.github.com/repos/vpsinc/DCSimScala/commits{/sha}","git_commits_url":"https://api.github.com/repos/vpsinc/DCSimScala/git/commits{/sha}","comments_url":"https://api.github.com/repos/vpsinc/DCSimScala/comments{/number}","issue_comment_url":"https://api.github.com/repos/vpsinc/DCSimScala/issues/comments{/number}","contents_url":"https://api.github.com/repos/vpsinc/DCSimScala/contents/{+path}","compare_url":"https://api.github.com/repos/vpsinc/DCSimScala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vpsinc/DCSimScala/merges","archive_url":"https://api.github.com/repos/vpsinc/DCSimScala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vpsinc/DCSimScala/downloads","issues_url":"https://api.github.com/repos/vpsinc/DCSimScala/issues{/number}","pulls_url":"https://api.github.com/repos/vpsinc/DCSimScala/pulls{/number}","milestones_url":"https://api.github.com/repos/vpsinc/DCSimScala/milestones{/number}","notifications_url":"https://api.github.com/repos/vpsinc/DCSimScala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vpsinc/DCSimScala/labels{/name}","releases_url":"https://api.github.com/repos/vpsinc/DCSimScala/releases{/id}","created_at":"2015-10-12T18:50:16Z","updated_at":"2015-10-12T19:00:07Z","pushed_at":"2015-10-20T21:31:36Z","git_url":"git://github.com/vpsinc/DCSimScala.git","ssh_url":"git@github.com:vpsinc/DCSimScala.git","clone_url":"https://github.com/vpsinc/DCSimScala.git","svn_url":"https://github.com/vpsinc/DCSimScala","homepage":null,"size":1264,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"vpsinc:master","ref":"master","sha":"cd3b022c34e8a4a141f0dcde476544266a3cfa43","user":{"login":"vpsinc","id":7947106,"avatar_url":"https://avatars.githubusercontent.com/u/7947106?v=3","gravatar_id":"","url":"https://api.github.com/users/vpsinc","html_url":"https://github.com/vpsinc","followers_url":"https://api.github.com/users/vpsinc/followers","following_url":"https://api.github.com/users/vpsinc/following{/other_user}","gists_url":"https://api.github.com/users/vpsinc/gists{/gist_id}","starred_url":"https://api.github.com/users/vpsinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpsinc/subscriptions","organizations_url":"https://api.github.com/users/vpsinc/orgs","repos_url":"https://api.github.com/users/vpsinc/repos","events_url":"https://api.github.com/users/vpsinc/events{/privacy}","received_events_url":"https://api.github.com/users/vpsinc/received_events","type":"Organization","site_admin":false},"repo":{"id":44127359,"name":"DCSimScala","full_name":"vpsinc/DCSimScala","owner":{"login":"vpsinc","id":7947106,"avatar_url":"https://avatars.githubusercontent.com/u/7947106?v=3","gravatar_id":"","url":"https://api.github.com/users/vpsinc","html_url":"https://github.com/vpsinc","followers_url":"https://api.github.com/users/vpsinc/followers","following_url":"https://api.github.com/users/vpsinc/following{/other_user}","gists_url":"https://api.github.com/users/vpsinc/gists{/gist_id}","starred_url":"https://api.github.com/users/vpsinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpsinc/subscriptions","organizations_url":"https://api.github.com/users/vpsinc/orgs","repos_url":"https://api.github.com/users/vpsinc/repos","events_url":"https://api.github.com/users/vpsinc/events{/privacy}","received_events_url":"https://api.github.com/users/vpsinc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vpsinc/DCSimScala","description":"Scala implementation of DCSim","fork":false,"url":"https://api.github.com/repos/vpsinc/DCSimScala","forks_url":"https://api.github.com/repos/vpsinc/DCSimScala/forks","keys_url":"https://api.github.com/repos/vpsinc/DCSimScala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vpsinc/DCSimScala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vpsinc/DCSimScala/teams","hooks_url":"https://api.github.com/repos/vpsinc/DCSimScala/hooks","issue_events_url":"https://api.github.com/repos/vpsinc/DCSimScala/issues/events{/number}","events_url":"https://api.github.com/repos/vpsinc/DCSimScala/events","assignees_url":"https://api.github.com/repos/vpsinc/DCSimScala/assignees{/user}","branches_url":"https://api.github.com/repos/vpsinc/DCSimScala/branches{/branch}","tags_url":"https://api.github.com/repos/vpsinc/DCSimScala/tags","blobs_url":"https://api.github.com/repos/vpsinc/DCSimScala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vpsinc/DCSimScala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vpsinc/DCSimScala/git/refs{/sha}","trees_url":"https://api.github.com/repos/vpsinc/DCSimScala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vpsinc/DCSimScala/statuses/{sha}","languages_url":"https://api.github.com/repos/vpsinc/DCSimScala/languages","stargazers_url":"https://api.github.com/repos/vpsinc/DCSimScala/stargazers","contributors_url":"https://api.github.com/repos/vpsinc/DCSimScala/contributors","subscribers_url":"https://api.github.com/repos/vpsinc/DCSimScala/subscribers","subscription_url":"https://api.github.com/repos/vpsinc/DCSimScala/subscription","commits_url":"https://api.github.com/repos/vpsinc/DCSimScala/commits{/sha}","git_commits_url":"https://api.github.com/repos/vpsinc/DCSimScala/git/commits{/sha}","comments_url":"https://api.github.com/repos/vpsinc/DCSimScala/comments{/number}","issue_comment_url":"https://api.github.com/repos/vpsinc/DCSimScala/issues/comments{/number}","contents_url":"https://api.github.com/repos/vpsinc/DCSimScala/contents/{+path}","compare_url":"https://api.github.com/repos/vpsinc/DCSimScala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vpsinc/DCSimScala/merges","archive_url":"https://api.github.com/repos/vpsinc/DCSimScala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vpsinc/DCSimScala/downloads","issues_url":"https://api.github.com/repos/vpsinc/DCSimScala/issues{/number}","pulls_url":"https://api.github.com/repos/vpsinc/DCSimScala/pulls{/number}","milestones_url":"https://api.github.com/repos/vpsinc/DCSimScala/milestones{/number}","notifications_url":"https://api.github.com/repos/vpsinc/DCSimScala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vpsinc/DCSimScala/labels{/name}","releases_url":"https://api.github.com/repos/vpsinc/DCSimScala/releases{/id}","created_at":"2015-10-12T18:50:16Z","updated_at":"2015-10-12T19:00:07Z","pushed_at":"2015-10-20T21:31:36Z","git_url":"git://github.com/vpsinc/DCSimScala.git","ssh_url":"git@github.com:vpsinc/DCSimScala.git","clone_url":"https://github.com/vpsinc/DCSimScala.git","svn_url":"https://github.com/vpsinc/DCSimScala","homepage":null,"size":1264,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vpsinc/DCSimScala/pulls/1"},"html":{"href":"https://github.com/vpsinc/DCSimScala/pull/1"},"issue":{"href":"https://api.github.com/repos/vpsinc/DCSimScala/issues/1"},"comments":{"href":"https://api.github.com/repos/vpsinc/DCSimScala/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/vpsinc/DCSimScala/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/vpsinc/DCSimScala/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vpsinc/DCSimScala/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/vpsinc/DCSimScala/statuses/dee7fbbc04359d2a697120c7cfc0270e474b71c6"}}}}