{"action":"created","comment":{"url":"https://api.github.com/repos/mxcube/HardwareRepository/pulls/comments/169634040","pull_request_review_id":98189944,"id":169634040,"diff_hunk":"@@ -0,0 +1,115 @@\n+#\n+#  Project: MXCuBE\n+#  https://github.com/mxcube.\n+#\n+#  This file is part of MXCuBE software.\n+#\n+#  MXCuBE 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 3 of the License, or\n+#  (at your option) any later version.\n+#\n+#  MXCuBE 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 General Public License for more details.\n+#\n+#  You should have received a copy of the GNU General Public License\n+#  along with MXCuBE.  If not, see <http://www.gnu.org/licenses/>.\n+\n+import logging\n+from random import random\n+from HardwareRepository.BaseHardwareObjects import HardwareObject\n+\n+\n+__credits__ = [\"MXCuBE collaboration\"]\n+__version__ = \"2.3.\"\n+__category__ = \"General\"\n+\n+\n+class FluxMockup(HardwareObject):\n+\n+    def __init__(self, name):\n+        HardwareObject.__init__(self, name)\n+\n+        self.flux_value = None\n+        self.flux_info = {}\n+        self.beam_info = None\n+        self.transmission = None\n+\n+    def init(self):\n+        \"\"\"Reads config xml, initiates all necessary hwobj, channels and cmds\n+        \"\"\"\n+   \n+        self.flux_value = 1\n+        self.beam_info_hwobj = self.getObjectByRole(\"beam_info\")\n+        self.connect(self.beam_info_hwobj,\n+                     \"beamInfoChanged\",\n+                     self.beam_info_changed)\n+        self.beam_info_changed(self.beam_info_hwobj.get_beam_info())\n+\n+        self.transmission_hwobj = self.getObjectByRole(\"transmission\")\n+        self.connect(self.transmission_hwobj,\n+                     \"attFactorChanged\",\n+                     self.transmission_changed)\n+        self.transmission_changed(self.transmission_hwobj.getAttFactor())\n+\n+    def beam_info_changed(self, beam_info):\n+        self.beam_info = beam_info\n+        #self.update_flux_value()\n+\n+    def transmission_changed(self, transmission):\n+        self.transmission = transmission\n+        #self.update_flux_value()\n+\n+    def set_flux(self, flux_value):\n+        self.flux_value = flux_value\n+        #self.origin_flux_value = copy(flux_value)\n+        #self.origin_beam_info = copy(self.beam_info)\n+        #self.origin_transmission = copy(self.transmission)\n+        self.update_flux_value()\n+\n+    def get_flux(self):\n+        return self.flux_value\n+\n+    def get_flux_info(self):\n+        return self.flux_info\n+\n+    def update_flux_value(self):\n+        self.flux_info = {\"flux\" : self.flux_value,\n+                          \"beam_info\": self.beam_info,\n+                          \"transmission\": self.transmission}\n+        self.emit('fluxChanged', self.flux_info)\n+        \"\"\"","path":"HardwareObjects/FluxMockup.py","position":83,"original_position":83,"commit_id":"08f2cdddb054a6ded46603d45c20a69803ef488c","original_commit_id":"08f2cdddb054a6ded46603d45c20a69803ef488c","user":{"login":"marcus-oscarsson","id":4331447,"avatar_url":"https://avatars0.githubusercontent.com/u/4331447?v=4","gravatar_id":"","url":"https://api.github.com/users/marcus-oscarsson","html_url":"https://github.com/marcus-oscarsson","followers_url":"https://api.github.com/users/marcus-oscarsson/followers","following_url":"https://api.github.com/users/marcus-oscarsson/following{/other_user}","gists_url":"https://api.github.com/users/marcus-oscarsson/gists{/gist_id}","starred_url":"https://api.github.com/users/marcus-oscarsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcus-oscarsson/subscriptions","organizations_url":"https://api.github.com/users/marcus-oscarsson/orgs","repos_url":"https://api.github.com/users/marcus-oscarsson/repos","events_url":"https://api.github.com/users/marcus-oscarsson/events{/privacy}","received_events_url":"https://api.github.com/users/marcus-oscarsson/received_events","type":"User","site_admin":false},"body":"Its maybe but this entire block seems to be commented ?","created_at":"2018-02-21T13:24:09Z","updated_at":"2018-02-21T13:24:09Z","html_url":"https://github.com/mxcube/HardwareRepository/pull/141#discussion_r169634040","pull_request_url":"https://api.github.com/repos/mxcube/HardwareRepository/pulls/141","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/mxcube/HardwareRepository/pulls/comments/169634040"},"html":{"href":"https://github.com/mxcube/HardwareRepository/pull/141#discussion_r169634040"},"pull_request":{"href":"https://api.github.com/repos/mxcube/HardwareRepository/pulls/141"}}},"pull_request":{"url":"https://api.github.com/repos/mxcube/HardwareRepository/pulls/141","id":170192968,"html_url":"https://github.com/mxcube/HardwareRepository/pull/141","diff_url":"https://github.com/mxcube/HardwareRepository/pull/141.diff","patch_url":"https://github.com/mxcube/HardwareRepository/pull/141.patch","issue_url":"https://api.github.com/repos/mxcube/HardwareRepository/issues/141","number":141,"state":"open","locked":false,"title":"[master] Small fixes for abstrac and mockup","user":{"login":"IvarsKarpics","id":7237709,"avatar_url":"https://avatars2.githubusercontent.com/u/7237709?v=4","gravatar_id":"","url":"https://api.github.com/users/IvarsKarpics","html_url":"https://github.com/IvarsKarpics","followers_url":"https://api.github.com/users/IvarsKarpics/followers","following_url":"https://api.github.com/users/IvarsKarpics/following{/other_user}","gists_url":"https://api.github.com/users/IvarsKarpics/gists{/gist_id}","starred_url":"https://api.github.com/users/IvarsKarpics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvarsKarpics/subscriptions","organizations_url":"https://api.github.com/users/IvarsKarpics/orgs","repos_url":"https://api.github.com/users/IvarsKarpics/repos","events_url":"https://api.github.com/users/IvarsKarpics/events{/privacy}","received_events_url":"https://api.github.com/users/IvarsKarpics/received_events","type":"User","site_admin":false},"body":"\t* HardwareObjects/AbstractCollect.py: emit progressInit signal in abstractCollect and not in Mockup\r\n\t* HardwareObjects/CollectMockup.py\r\n\t* HardwareObjects/DiffractometerMockup.py: added set_phase and fixed centering\r\n\t* new FluxMockup and PlateManipulatorMockup","created_at":"2018-02-20T13:33:48Z","updated_at":"2018-02-21T13:24:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1956402266e35e99e137c15f41a13e80838e6a17","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mxcube/HardwareRepository/pulls/141/commits","review_comments_url":"https://api.github.com/repos/mxcube/HardwareRepository/pulls/141/comments","review_comment_url":"https://api.github.com/repos/mxcube/HardwareRepository/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mxcube/HardwareRepository/issues/141/comments","statuses_url":"https://api.github.com/repos/mxcube/HardwareRepository/statuses/08f2cdddb054a6ded46603d45c20a69803ef488c","head":{"label":"mxcube:mockup","ref":"mockup","sha":"08f2cdddb054a6ded46603d45c20a69803ef488c","user":{"login":"mxcube","id":4322027,"avatar_url":"https://avatars2.githubusercontent.com/u/4322027?v=4","gravatar_id":"","url":"https://api.github.com/users/mxcube","html_url":"https://github.com/mxcube","followers_url":"https://api.github.com/users/mxcube/followers","following_url":"https://api.github.com/users/mxcube/following{/other_user}","gists_url":"https://api.github.com/users/mxcube/gists{/gist_id}","starred_url":"https://api.github.com/users/mxcube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxcube/subscriptions","organizations_url":"https://api.github.com/users/mxcube/orgs","repos_url":"https://api.github.com/users/mxcube/repos","events_url":"https://api.github.com/users/mxcube/events{/privacy}","received_events_url":"https://api.github.com/users/mxcube/received_events","type":"Organization","site_admin":false},"repo":{"id":9835063,"name":"HardwareRepository","full_name":"mxcube/HardwareRepository","owner":{"login":"mxcube","id":4322027,"avatar_url":"https://avatars2.githubusercontent.com/u/4322027?v=4","gravatar_id":"","url":"https://api.github.com/users/mxcube","html_url":"https://github.com/mxcube","followers_url":"https://api.github.com/users/mxcube/followers","following_url":"https://api.github.com/users/mxcube/following{/other_user}","gists_url":"https://api.github.com/users/mxcube/gists{/gist_id}","starred_url":"https://api.github.com/users/mxcube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxcube/subscriptions","organizations_url":"https://api.github.com/users/mxcube/orgs","repos_url":"https://api.github.com/users/mxcube/repos","events_url":"https://api.github.com/users/mxcube/events{/privacy}","received_events_url":"https://api.github.com/users/mxcube/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mxcube/HardwareRepository","description":"Back-end level of MXCuBE","fork":false,"url":"https://api.github.com/repos/mxcube/HardwareRepository","forks_url":"https://api.github.com/repos/mxcube/HardwareRepository/forks","keys_url":"https://api.github.com/repos/mxcube/HardwareRepository/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mxcube/HardwareRepository/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mxcube/HardwareRepository/teams","hooks_url":"https://api.github.com/repos/mxcube/HardwareRepository/hooks","issue_events_url":"https://api.github.com/repos/mxcube/HardwareRepository/issues/events{/number}","events_url":"https://api.github.com/repos/mxcube/HardwareRepository/events","assignees_url":"https://api.github.com/repos/mxcube/HardwareRepository/assignees{/user}","branches_url":"https://api.github.com/repos/mxcube/HardwareRepository/branches{/branch}","tags_url":"https://api.github.com/repos/mxcube/HardwareRepository/tags","blobs_url":"https://api.github.com/repos/mxcube/HardwareRepository/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mxcube/HardwareRepository/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mxcube/HardwareRepository/git/refs{/sha}","trees_url":"https://api.github.com/repos/mxcube/HardwareRepository/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mxcube/HardwareRepository/statuses/{sha}","languages_url":"https://api.github.com/repos/mxcube/HardwareRepository/languages","stargazers_url":"https://api.github.com/repos/mxcube/HardwareRepository/stargazers","contributors_url":"https://api.github.com/repos/mxcube/HardwareRepository/contributors","subscribers_url":"https://api.github.com/repos/mxcube/HardwareRepository/subscribers","subscription_url":"https://api.github.com/repos/mxcube/HardwareRepository/subscription","commits_url":"https://api.github.com/repos/mxcube/HardwareRepository/commits{/sha}","git_commits_url":"https://api.github.com/repos/mxcube/HardwareRepository/git/commits{/sha}","comments_url":"https://api.github.com/repos/mxcube/HardwareRepository/comments{/number}","issue_comment_url":"https://api.github.com/repos/mxcube/HardwareRepository/issues/comments{/number}","contents_url":"https://api.github.com/repos/mxcube/HardwareRepository/contents/{+path}","compare_url":"https://api.github.com/repos/mxcube/HardwareRepository/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mxcube/HardwareRepository/merges","archive_url":"https://api.github.com/repos/mxcube/HardwareRepository/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mxcube/HardwareRepository/downloads","issues_url":"https://api.github.com/repos/mxcube/HardwareRepository/issues{/number}","pulls_url":"https://api.github.com/repos/mxcube/HardwareRepository/pulls{/number}","milestones_url":"https://api.github.com/repos/mxcube/HardwareRepository/milestones{/number}","notifications_url":"https://api.github.com/repos/mxcube/HardwareRepository/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mxcube/HardwareRepository/labels{/name}","releases_url":"https://api.github.com/repos/mxcube/HardwareRepository/releases{/id}","deployments_url":"https://api.github.com/repos/mxcube/HardwareRepository/deployments","created_at":"2013-05-03T11:57:41Z","updated_at":"2016-11-25T09:28:02Z","pushed_at":"2018-02-20T13:33:49Z","git_url":"git://github.com/mxcube/HardwareRepository.git","ssh_url":"git@github.com:mxcube/HardwareRepository.git","clone_url":"https://github.com/mxcube/HardwareRepository.git","svn_url":"https://github.com/mxcube/HardwareRepository","homepage":"","size":4587,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":9,"license":null,"forks":20,"open_issues":9,"watchers":0,"default_branch":"master"}},"base":{"label":"mxcube:master","ref":"master","sha":"9de8e95074212d22358c98872277a4c7b9b8ae4a","user":{"login":"mxcube","id":4322027,"avatar_url":"https://avatars2.githubusercontent.com/u/4322027?v=4","gravatar_id":"","url":"https://api.github.com/users/mxcube","html_url":"https://github.com/mxcube","followers_url":"https://api.github.com/users/mxcube/followers","following_url":"https://api.github.com/users/mxcube/following{/other_user}","gists_url":"https://api.github.com/users/mxcube/gists{/gist_id}","starred_url":"https://api.github.com/users/mxcube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxcube/subscriptions","organizations_url":"https://api.github.com/users/mxcube/orgs","repos_url":"https://api.github.com/users/mxcube/repos","events_url":"https://api.github.com/users/mxcube/events{/privacy}","received_events_url":"https://api.github.com/users/mxcube/received_events","type":"Organization","site_admin":false},"repo":{"id":9835063,"name":"HardwareRepository","full_name":"mxcube/HardwareRepository","owner":{"login":"mxcube","id":4322027,"avatar_url":"https://avatars2.githubusercontent.com/u/4322027?v=4","gravatar_id":"","url":"https://api.github.com/users/mxcube","html_url":"https://github.com/mxcube","followers_url":"https://api.github.com/users/mxcube/followers","following_url":"https://api.github.com/users/mxcube/following{/other_user}","gists_url":"https://api.github.com/users/mxcube/gists{/gist_id}","starred_url":"https://api.github.com/users/mxcube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxcube/subscriptions","organizations_url":"https://api.github.com/users/mxcube/orgs","repos_url":"https://api.github.com/users/mxcube/repos","events_url":"https://api.github.com/users/mxcube/events{/privacy}","received_events_url":"https://api.github.com/users/mxcube/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mxcube/HardwareRepository","description":"Back-end level of MXCuBE","fork":false,"url":"https://api.github.com/repos/mxcube/HardwareRepository","forks_url":"https://api.github.com/repos/mxcube/HardwareRepository/forks","keys_url":"https://api.github.com/repos/mxcube/HardwareRepository/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mxcube/HardwareRepository/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mxcube/HardwareRepository/teams","hooks_url":"https://api.github.com/repos/mxcube/HardwareRepository/hooks","issue_events_url":"https://api.github.com/repos/mxcube/HardwareRepository/issues/events{/number}","events_url":"https://api.github.com/repos/mxcube/HardwareRepository/events","assignees_url":"https://api.github.com/repos/mxcube/HardwareRepository/assignees{/user}","branches_url":"https://api.github.com/repos/mxcube/HardwareRepository/branches{/branch}","tags_url":"https://api.github.com/repos/mxcube/HardwareRepository/tags","blobs_url":"https://api.github.com/repos/mxcube/HardwareRepository/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mxcube/HardwareRepository/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mxcube/HardwareRepository/git/refs{/sha}","trees_url":"https://api.github.com/repos/mxcube/HardwareRepository/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mxcube/HardwareRepository/statuses/{sha}","languages_url":"https://api.github.com/repos/mxcube/HardwareRepository/languages","stargazers_url":"https://api.github.com/repos/mxcube/HardwareRepository/stargazers","contributors_url":"https://api.github.com/repos/mxcube/HardwareRepository/contributors","subscribers_url":"https://api.github.com/repos/mxcube/HardwareRepository/subscribers","subscription_url":"https://api.github.com/repos/mxcube/HardwareRepository/subscription","commits_url":"https://api.github.com/repos/mxcube/HardwareRepository/commits{/sha}","git_commits_url":"https://api.github.com/repos/mxcube/HardwareRepository/git/commits{/sha}","comments_url":"https://api.github.com/repos/mxcube/HardwareRepository/comments{/number}","issue_comment_url":"https://api.github.com/repos/mxcube/HardwareRepository/issues/comments{/number}","contents_url":"https://api.github.com/repos/mxcube/HardwareRepository/contents/{+path}","compare_url":"https://api.github.com/repos/mxcube/HardwareRepository/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mxcube/HardwareRepository/merges","archive_url":"https://api.github.com/repos/mxcube/HardwareRepository/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mxcube/HardwareRepository/downloads","issues_url":"https://api.github.com/repos/mxcube/HardwareRepository/issues{/number}","pulls_url":"https://api.github.com/repos/mxcube/HardwareRepository/pulls{/number}","milestones_url":"https://api.github.com/repos/mxcube/HardwareRepository/milestones{/number}","notifications_url":"https://api.github.com/repos/mxcube/HardwareRepository/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mxcube/HardwareRepository/labels{/name}","releases_url":"https://api.github.com/repos/mxcube/HardwareRepository/releases{/id}","deployments_url":"https://api.github.com/repos/mxcube/HardwareRepository/deployments","created_at":"2013-05-03T11:57:41Z","updated_at":"2016-11-25T09:28:02Z","pushed_at":"2018-02-20T13:33:49Z","git_url":"git://github.com/mxcube/HardwareRepository.git","ssh_url":"git@github.com:mxcube/HardwareRepository.git","clone_url":"https://github.com/mxcube/HardwareRepository.git","svn_url":"https://github.com/mxcube/HardwareRepository","homepage":"","size":4587,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":9,"license":null,"forks":20,"open_issues":9,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mxcube/HardwareRepository/pulls/141"},"html":{"href":"https://github.com/mxcube/HardwareRepository/pull/141"},"issue":{"href":"https://api.github.com/repos/mxcube/HardwareRepository/issues/141"},"comments":{"href":"https://api.github.com/repos/mxcube/HardwareRepository/issues/141/comments"},"review_comments":{"href":"https://api.github.com/repos/mxcube/HardwareRepository/pulls/141/comments"},"review_comment":{"href":"https://api.github.com/repos/mxcube/HardwareRepository/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mxcube/HardwareRepository/pulls/141/commits"},"statuses":{"href":"https://api.github.com/repos/mxcube/HardwareRepository/statuses/08f2cdddb054a6ded46603d45c20a69803ef488c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"marcus-oscarsson"}}