{"action":"created","comment":{"url":"https://api.github.com/repos/acquaman/acquaman/pulls/comments/38253802","id":38253802,"diff_hunk":"@@ -0,0 +1,282 @@\n+#include \"AMXYThetaControlMoveButton.h\"\n+#include \"beamline/AMControl.h\"\n+#include \"actions3/AMActionSupport.h\"\n+#include \"actions3/AMListAction3.h\"\n+\n+\n+#include \"AMQEvents.h\"\n+\n+\n+#include <QBoxLayout>\n+#include <QStringBuilder>\n+#include <QString>\n+#include <QFrame>\n+\n+AMXYThetaControlMoveButton::AMXYThetaControlMoveButton(QWidget *parent,\n+\t\t\t\t\t\t\t\t\t\t\t\t\t   AMControl* controlX,\n+\t\t\t\t\t\t\t\t\t\t\t\t\t   AMControl* controlY,\n+\t\t\t\t\t\t\t\t\t\t\t\t\t   AMControl* controlTheta,\n+\t\t\t\t\t\t\t\t\t\t\t\t\t   QList<double> stepSizes,\n+\t\t\t\t\t\t\t\t\t\t\t\t\t   bool directionReversed,\n+\t\t\t\t\t\t\t\t\t\t\t\t\t   bool direction2Reversed,\n+\t\t\t\t\t\t\t\t\t\t\t\t\t   double angleOffset) : QToolButton(parent)\n+{\n+\tdirectionXReversed_ = directionReversed;\n+\tdirectionYReversed_ = direction2Reversed;\n+\n+\tangleOffset_ = angleOffset;\n+\n+\tcontrolX_ = 0;\n+\tsetControlX(controlX);\n+\n+\tcontrolY_ = 0;\n+\tsetControlY(controlY);\n+\n+\tcontrolTheta_ = 0;\n+\tsetControlTheta(controlTheta);\n+\n+\tcheckStatus();\n+\n+\tsetToolTip(\"XYTheta Move\");\n+\n+\tstepSizes_ = stepSizes;\n+\tif(stepSizes_.isEmpty())\n+\t\tstepSizes_ << 1.0;\t// just to make sure we always have at least one, so that stepSizeIndex_ is valid.\n+\tstepSizeIndex_ = 0;\n+\n+\tcontextMenu_ = 0;\n+\tsetContextMenuPolicy(Qt::CustomContextMenu);\n+\tconnect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onCustomContextMenuRequested(QPoint)));\n+\n+\tsetText(QString::number(currentStepSize()) % (controlX_ ? controlX_->units() : QString()));\n+\tconnect(this, SIGNAL(clicked()), this, SLOT(onButtonClicked()));\n+\n+}\n+\n+\n+\n+\n+void AMXYThetaControlMoveButton::setControlX(AMControl *control)\n+{\n+\tif(control == controlX_)\n+\t\treturn;\n+\n+\tif(contextMenu_) {\n+\t\tcontextMenu_->deleteLater();\n+\t\tcontextMenu_ = 0;\n+\t}\n+\n+\tif(controlX_) {\n+\t\tdisconnect(controlX_, 0, this, 0);\n+\t}\n+\n+\tcontrolX_ = control;\n+\tif(controlX_) {\n+\t\tconnect(controlX_, SIGNAL(destroyed()), this, SLOT(onControlXDestroyed()));\n+\t\tconnect(controlX_, SIGNAL(connected(bool)), this, SLOT(checkStatus()));\n+\t}\n+\n+\tsetText(QString::number(currentStepSize()) % (controlX_ ? controlX_->units() : QString()));\n+\n+\t// enabled / disabled:\n+\tcheckStatus();\n+}\n+\n+void AMXYThetaControlMoveButton::setControlY(AMControl *control2)\n+{\n+\tif(control2 == controlY_)\n+\t\treturn;\n+\n+\tif(contextMenu_) {\n+\t\tcontextMenu_->deleteLater();\n+\t\tcontextMenu_ = 0;\n+\t}\n+\n+\tif(controlY_) {\n+\t\tdisconnect(controlY_, 0, this, 0);\n+\t}\n+\n+\tcontrolY_ = control2;\n+\tif(controlX_) {\n+\t\tconnect(controlY_, SIGNAL(destroyed()), this, SLOT(onControlYDestroyed()));\n+\t\tconnect(controlY_, SIGNAL(connected(bool)), this, SLOT(checkStatus()));\n+\t}\n+\n+\tsetText(QString::number(currentStepSize()) % (controlX_ ? controlX_->units() : QString()));\n+\n+\t// enabled / disabled:\n+\tcheckStatus();\n+}\n+\n+void AMXYThetaControlMoveButton::setControlTheta(AMControl *controlR)\n+{\n+\tif(controlR == controlTheta_)\n+\t\treturn;\n+\n+\tif(contextMenu_) {\n+\t\tcontextMenu_->deleteLater();\n+\t\tcontextMenu_ = 0;\n+\t}\n+\n+\tif(controlTheta_) {\n+\t\tdisconnect(controlTheta_, 0, this, 0);\n+\t}\n+\n+\tcontrolTheta_ = controlR;\n+\tif(controlX_) {\n+\t\tconnect(controlTheta_, SIGNAL(destroyed()), this, SLOT(onControlThetaDestroyed()));\n+\t\tconnect(controlTheta_, SIGNAL(connected(bool)), this, SLOT(checkStatus()));\n+\t}\n+\n+\tsetText(QString::number(currentStepSize()) % (controlX_ ? controlX_->units() : QString()));\n+\n+\t// enabled / disabled:\n+\tcheckStatus();\n+}\n+\n+void AMXYThetaControlMoveButton::onButtonClicked()\n+{\n+\tif(controlX_ && controlY_ && controlTheta_) {\n+\t\tcontrolX_->moveRelative(currentStepSize() * (directionXReversed_ ? -1.0 : 1.0) * sin((controlTheta_->value() + angleOffset_)/57.297));\n+\t\tcontrolY_->moveRelative(currentStepSize() * (directionYReversed_ ? -1.0 : 1.0) * cos((controlTheta_->value() + angleOffset_)/57.297));\n+\t}\n+}\n+\n+\n+void AMXYThetaControlMoveButton::onControlXDestroyed()\n+{\n+\tsetControlX(0);\n+}\n+void AMXYThetaControlMoveButton::onControlYDestroyed()\n+{\n+\tsetControlY(0);\n+}\n+void AMXYThetaControlMoveButton::onControlThetaDestroyed()\n+{\n+\tsetControlTheta(0);\n+}\n+\n+void AMXYThetaControlMoveButton::checkStatus()\n+{\n+\tif(controlX_ && controlX_->isConnected() && controlY_ && controlY_->isConnected() && controlTheta_ && controlTheta_->isConnected())\n+\t\tsetEnabled(true);\n+\telse\n+\t\tsetDisabled(true);\n+\n+}\n+\n+bool AMXYThetaControlMoveButton::setStepSizeIndex(int index)\n+{\n+\tif(index<0 || index >= stepSizes_.count())\n+\t\treturn false;\n+\tif(stepSizeIndex_ != index) {\n+\t\temit stepSizeIndexChanged(stepSizeIndex_ = index);\n+\t}\n+\tsetText(QString::number(currentStepSize()) % (controlX_ ? controlX_->units() : QString()));","path":"source/ui/beamline/AMXYThetaControlMoveButton.cpp","position":175,"original_position":175,"commit_id":"9403c3ec091ab479837b2c4e3db4ecee3ab90251","original_commit_id":"9403c3ec091ab479837b2c4e3db4ecee3ab90251","user":{"login":"dretrex","id":602741,"avatar_url":"https://avatars.githubusercontent.com/u/602741?v=3","gravatar_id":"","url":"https://api.github.com/users/dretrex","html_url":"https://github.com/dretrex","followers_url":"https://api.github.com/users/dretrex/followers","following_url":"https://api.github.com/users/dretrex/following{/other_user}","gists_url":"https://api.github.com/users/dretrex/gists{/gist_id}","starred_url":"https://api.github.com/users/dretrex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dretrex/subscriptions","organizations_url":"https://api.github.com/users/dretrex/orgs","repos_url":"https://api.github.com/users/dretrex/repos","events_url":"https://api.github.com/users/dretrex/events{/privacy}","received_events_url":"https://api.github.com/users/dretrex/received_events","type":"User","site_admin":false},"body":"Are we always going to assume that the units will be X's?  If so, then that's fine.","created_at":"2015-08-28T23:23:43Z","updated_at":"2015-08-28T23:23:43Z","html_url":"https://github.com/acquaman/acquaman/pull/1549#discussion_r38253802","pull_request_url":"https://api.github.com/repos/acquaman/acquaman/pulls/1549","_links":{"self":{"href":"https://api.github.com/repos/acquaman/acquaman/pulls/comments/38253802"},"html":{"href":"https://github.com/acquaman/acquaman/pull/1549#discussion_r38253802"},"pull_request":{"href":"https://api.github.com/repos/acquaman/acquaman/pulls/1549"}}},"pull_request":{"url":"https://api.github.com/repos/acquaman/acquaman/pulls/1549","id":43230144,"html_url":"https://github.com/acquaman/acquaman/pull/1549","diff_url":"https://github.com/acquaman/acquaman/pull/1549.diff","patch_url":"https://github.com/acquaman/acquaman/pull/1549.patch","issue_url":"https://api.github.com/repos/acquaman/acquaman/issues/1549","number":1549,"state":"open","locked":false,"title":"Pull Request for Issue1525: Persistent or saved crosshairs for camera views","user":{"login":"epengr","id":677939,"avatar_url":"https://avatars.githubusercontent.com/u/677939?v=3","gravatar_id":"","url":"https://api.github.com/users/epengr","html_url":"https://github.com/epengr","followers_url":"https://api.github.com/users/epengr/followers","following_url":"https://api.github.com/users/epengr/following{/other_user}","gists_url":"https://api.github.com/users/epengr/gists{/gist_id}","starred_url":"https://api.github.com/users/epengr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epengr/subscriptions","organizations_url":"https://api.github.com/users/epengr/orgs","repos_url":"https://api.github.com/users/epengr/repos","events_url":"https://api.github.com/users/epengr/events{/privacy}","received_events_url":"https://api.github.com/users/epengr/received_events","type":"User","site_admin":false},"body":"Modified AMBeamlineCameraWidget to handle a preset crosshair location and added a control to return the crosshair to that position.\r\n\r\nCreate a REIXSSampleManagementPre2013Widget jsut in case AMSampleManagementPre2013Widget is used elsewhere and modified it to use two cameras.\r\n\r\n#1525","created_at":"2015-08-24T22:33:19Z","updated_at":"2015-08-28T23:23:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f91acb4fc20ae4f98d51392e676ced39cfb247f9","assignee":{"login":"dretrex","id":602741,"avatar_url":"https://avatars.githubusercontent.com/u/602741?v=3","gravatar_id":"","url":"https://api.github.com/users/dretrex","html_url":"https://github.com/dretrex","followers_url":"https://api.github.com/users/dretrex/followers","following_url":"https://api.github.com/users/dretrex/following{/other_user}","gists_url":"https://api.github.com/users/dretrex/gists{/gist_id}","starred_url":"https://api.github.com/users/dretrex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dretrex/subscriptions","organizations_url":"https://api.github.com/users/dretrex/orgs","repos_url":"https://api.github.com/users/dretrex/repos","events_url":"https://api.github.com/users/dretrex/events{/privacy}","received_events_url":"https://api.github.com/users/dretrex/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/acquaman/acquaman/pulls/1549/commits","review_comments_url":"https://api.github.com/repos/acquaman/acquaman/pulls/1549/comments","review_comment_url":"https://api.github.com/repos/acquaman/acquaman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/acquaman/acquaman/issues/1549/comments","statuses_url":"https://api.github.com/repos/acquaman/acquaman/statuses/9403c3ec091ab479837b2c4e3db4ecee3ab90251","head":{"label":"acquaman:Issue1525","ref":"Issue1525","sha":"9403c3ec091ab479837b2c4e3db4ecee3ab90251","user":{"login":"acquaman","id":602716,"avatar_url":"https://avatars.githubusercontent.com/u/602716?v=3","gravatar_id":"","url":"https://api.github.com/users/acquaman","html_url":"https://github.com/acquaman","followers_url":"https://api.github.com/users/acquaman/followers","following_url":"https://api.github.com/users/acquaman/following{/other_user}","gists_url":"https://api.github.com/users/acquaman/gists{/gist_id}","starred_url":"https://api.github.com/users/acquaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acquaman/subscriptions","organizations_url":"https://api.github.com/users/acquaman/orgs","repos_url":"https://api.github.com/users/acquaman/repos","events_url":"https://api.github.com/users/acquaman/events{/privacy}","received_events_url":"https://api.github.com/users/acquaman/received_events","type":"Organization","site_admin":false},"repo":{"id":1333343,"name":"acquaman","full_name":"acquaman/acquaman","owner":{"login":"acquaman","id":602716,"avatar_url":"https://avatars.githubusercontent.com/u/602716?v=3","gravatar_id":"","url":"https://api.github.com/users/acquaman","html_url":"https://github.com/acquaman","followers_url":"https://api.github.com/users/acquaman/followers","following_url":"https://api.github.com/users/acquaman/following{/other_user}","gists_url":"https://api.github.com/users/acquaman/gists{/gist_id}","starred_url":"https://api.github.com/users/acquaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acquaman/subscriptions","organizations_url":"https://api.github.com/users/acquaman/orgs","repos_url":"https://api.github.com/users/acquaman/repos","events_url":"https://api.github.com/users/acquaman/events{/privacy}","received_events_url":"https://api.github.com/users/acquaman/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/acquaman/acquaman","description":"Acquisition and Data Management for Big Science","fork":false,"url":"https://api.github.com/repos/acquaman/acquaman","forks_url":"https://api.github.com/repos/acquaman/acquaman/forks","keys_url":"https://api.github.com/repos/acquaman/acquaman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acquaman/acquaman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acquaman/acquaman/teams","hooks_url":"https://api.github.com/repos/acquaman/acquaman/hooks","issue_events_url":"https://api.github.com/repos/acquaman/acquaman/issues/events{/number}","events_url":"https://api.github.com/repos/acquaman/acquaman/events","assignees_url":"https://api.github.com/repos/acquaman/acquaman/assignees{/user}","branches_url":"https://api.github.com/repos/acquaman/acquaman/branches{/branch}","tags_url":"https://api.github.com/repos/acquaman/acquaman/tags","blobs_url":"https://api.github.com/repos/acquaman/acquaman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acquaman/acquaman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acquaman/acquaman/git/refs{/sha}","trees_url":"https://api.github.com/repos/acquaman/acquaman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acquaman/acquaman/statuses/{sha}","languages_url":"https://api.github.com/repos/acquaman/acquaman/languages","stargazers_url":"https://api.github.com/repos/acquaman/acquaman/stargazers","contributors_url":"https://api.github.com/repos/acquaman/acquaman/contributors","subscribers_url":"https://api.github.com/repos/acquaman/acquaman/subscribers","subscription_url":"https://api.github.com/repos/acquaman/acquaman/subscription","commits_url":"https://api.github.com/repos/acquaman/acquaman/commits{/sha}","git_commits_url":"https://api.github.com/repos/acquaman/acquaman/git/commits{/sha}","comments_url":"https://api.github.com/repos/acquaman/acquaman/comments{/number}","issue_comment_url":"https://api.github.com/repos/acquaman/acquaman/issues/comments{/number}","contents_url":"https://api.github.com/repos/acquaman/acquaman/contents/{+path}","compare_url":"https://api.github.com/repos/acquaman/acquaman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acquaman/acquaman/merges","archive_url":"https://api.github.com/repos/acquaman/acquaman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acquaman/acquaman/downloads","issues_url":"https://api.github.com/repos/acquaman/acquaman/issues{/number}","pulls_url":"https://api.github.com/repos/acquaman/acquaman/pulls{/number}","milestones_url":"https://api.github.com/repos/acquaman/acquaman/milestones{/number}","notifications_url":"https://api.github.com/repos/acquaman/acquaman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acquaman/acquaman/labels{/name}","releases_url":"https://api.github.com/repos/acquaman/acquaman/releases{/id}","created_at":"2011-02-06T02:19:01Z","updated_at":"2015-05-08T18:04:51Z","pushed_at":"2015-08-28T22:15:16Z","git_url":"git://github.com/acquaman/acquaman.git","ssh_url":"git@github.com:acquaman/acquaman.git","clone_url":"https://github.com/acquaman/acquaman.git","svn_url":"https://github.com/acquaman/acquaman","homepage":"","size":146062,"stargazers_count":8,"watchers_count":8,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":135,"forks":2,"open_issues":135,"watchers":8,"default_branch":"master"}},"base":{"label":"acquaman:master","ref":"master","sha":"83b3345d0a404f42d5e60df137ece7ea48fa7d83","user":{"login":"acquaman","id":602716,"avatar_url":"https://avatars.githubusercontent.com/u/602716?v=3","gravatar_id":"","url":"https://api.github.com/users/acquaman","html_url":"https://github.com/acquaman","followers_url":"https://api.github.com/users/acquaman/followers","following_url":"https://api.github.com/users/acquaman/following{/other_user}","gists_url":"https://api.github.com/users/acquaman/gists{/gist_id}","starred_url":"https://api.github.com/users/acquaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acquaman/subscriptions","organizations_url":"https://api.github.com/users/acquaman/orgs","repos_url":"https://api.github.com/users/acquaman/repos","events_url":"https://api.github.com/users/acquaman/events{/privacy}","received_events_url":"https://api.github.com/users/acquaman/received_events","type":"Organization","site_admin":false},"repo":{"id":1333343,"name":"acquaman","full_name":"acquaman/acquaman","owner":{"login":"acquaman","id":602716,"avatar_url":"https://avatars.githubusercontent.com/u/602716?v=3","gravatar_id":"","url":"https://api.github.com/users/acquaman","html_url":"https://github.com/acquaman","followers_url":"https://api.github.com/users/acquaman/followers","following_url":"https://api.github.com/users/acquaman/following{/other_user}","gists_url":"https://api.github.com/users/acquaman/gists{/gist_id}","starred_url":"https://api.github.com/users/acquaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acquaman/subscriptions","organizations_url":"https://api.github.com/users/acquaman/orgs","repos_url":"https://api.github.com/users/acquaman/repos","events_url":"https://api.github.com/users/acquaman/events{/privacy}","received_events_url":"https://api.github.com/users/acquaman/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/acquaman/acquaman","description":"Acquisition and Data Management for Big Science","fork":false,"url":"https://api.github.com/repos/acquaman/acquaman","forks_url":"https://api.github.com/repos/acquaman/acquaman/forks","keys_url":"https://api.github.com/repos/acquaman/acquaman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acquaman/acquaman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acquaman/acquaman/teams","hooks_url":"https://api.github.com/repos/acquaman/acquaman/hooks","issue_events_url":"https://api.github.com/repos/acquaman/acquaman/issues/events{/number}","events_url":"https://api.github.com/repos/acquaman/acquaman/events","assignees_url":"https://api.github.com/repos/acquaman/acquaman/assignees{/user}","branches_url":"https://api.github.com/repos/acquaman/acquaman/branches{/branch}","tags_url":"https://api.github.com/repos/acquaman/acquaman/tags","blobs_url":"https://api.github.com/repos/acquaman/acquaman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acquaman/acquaman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acquaman/acquaman/git/refs{/sha}","trees_url":"https://api.github.com/repos/acquaman/acquaman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acquaman/acquaman/statuses/{sha}","languages_url":"https://api.github.com/repos/acquaman/acquaman/languages","stargazers_url":"https://api.github.com/repos/acquaman/acquaman/stargazers","contributors_url":"https://api.github.com/repos/acquaman/acquaman/contributors","subscribers_url":"https://api.github.com/repos/acquaman/acquaman/subscribers","subscription_url":"https://api.github.com/repos/acquaman/acquaman/subscription","commits_url":"https://api.github.com/repos/acquaman/acquaman/commits{/sha}","git_commits_url":"https://api.github.com/repos/acquaman/acquaman/git/commits{/sha}","comments_url":"https://api.github.com/repos/acquaman/acquaman/comments{/number}","issue_comment_url":"https://api.github.com/repos/acquaman/acquaman/issues/comments{/number}","contents_url":"https://api.github.com/repos/acquaman/acquaman/contents/{+path}","compare_url":"https://api.github.com/repos/acquaman/acquaman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acquaman/acquaman/merges","archive_url":"https://api.github.com/repos/acquaman/acquaman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acquaman/acquaman/downloads","issues_url":"https://api.github.com/repos/acquaman/acquaman/issues{/number}","pulls_url":"https://api.github.com/repos/acquaman/acquaman/pulls{/number}","milestones_url":"https://api.github.com/repos/acquaman/acquaman/milestones{/number}","notifications_url":"https://api.github.com/repos/acquaman/acquaman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acquaman/acquaman/labels{/name}","releases_url":"https://api.github.com/repos/acquaman/acquaman/releases{/id}","created_at":"2011-02-06T02:19:01Z","updated_at":"2015-05-08T18:04:51Z","pushed_at":"2015-08-28T22:15:16Z","git_url":"git://github.com/acquaman/acquaman.git","ssh_url":"git@github.com:acquaman/acquaman.git","clone_url":"https://github.com/acquaman/acquaman.git","svn_url":"https://github.com/acquaman/acquaman","homepage":"","size":146062,"stargazers_count":8,"watchers_count":8,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":135,"forks":2,"open_issues":135,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/acquaman/acquaman/pulls/1549"},"html":{"href":"https://github.com/acquaman/acquaman/pull/1549"},"issue":{"href":"https://api.github.com/repos/acquaman/acquaman/issues/1549"},"comments":{"href":"https://api.github.com/repos/acquaman/acquaman/issues/1549/comments"},"review_comments":{"href":"https://api.github.com/repos/acquaman/acquaman/pulls/1549/comments"},"review_comment":{"href":"https://api.github.com/repos/acquaman/acquaman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/acquaman/acquaman/pulls/1549/commits"},"statuses":{"href":"https://api.github.com/repos/acquaman/acquaman/statuses/9403c3ec091ab479837b2c4e3db4ecee3ab90251"}}}}