{"action":"created","comment":{"url":"https://api.github.com/repos/bluerobotics/ping-viewer/pulls/comments/199555172","pull_request_review_id":133697513,"id":199555172,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTU1NTE3Mg==","diff_hunk":"@@ -0,0 +1,128 @@\n+import QtQuick 2.7\n+import QtQuick.Controls 2.2\n+import QtQuick.Layouts 1.3\n+\n+import Logger 1.0\n+\n+Item {\n+    id: root\n+\n+    // these are actually all in meters right now\n+    property var start_mm: 0\n+    property var end_mm: 0\n+    property var length_mm: end_mm - start_mm\n+    property var depth_mm: 0\n+\n+    property var validIncrements: [0.1, 0.25, 0.5, 1, 2, 5, 10]\n+\n+    property int numTicks: 10\n+    property int maxTicks: 10\n+    property var increment: 1\n+\n+    property var color: \"white\"\n+\n+    function getIncrement() {\n+        var inc;\n+        for (var i = 0; i < validIncrements.length; i++) {\n+            inc = validIncrements[i];\n+            if (length_mm / inc <= maxTicks) {\n+                break;\n+            }\n+        }\n+        return inc;\n+    }\n+\n+    function recalc() {\n+        increment = getIncrement()\n+        numTicks = length_mm / increment + 1\n+    }\n+\n+    onStart_mmChanged: {\n+        recalc()\n+    }\n+\n+    onEnd_mmChanged: {\n+        recalc()\n+    }\n+\n+    function nominalHeight() {\n+        return increment * parent.height / length_mm\n+    }\n+\n+    function remainingHeight() {\n+        return parent.height - ((numTicks-1) * nominalHeight())\n+    }\n+\n+    Component {\n+        id: tickMark\n+        RowLayout {\n+            anchors.right: parent.right\n+            height: lastIndex ? remainingHeight() : nominalHeight()\n+            Layout.fillHeight: true\n+            Layout.alignment: Qt.AlignRight | Qt.AlignBottom\n+\n+            property var lastIndex: (index + 1) == numTicks\n+\n+            Rectangle {\n+                id: tick\n+                width: 15\n+                height: 2\n+                Layout.alignment: Qt.AlignRight | Qt.AlignBottom\n+                color: root.color\n+                border.color: root.color\n+                border.width: 1\n+                visible: parent.height > 0\n+            }\n+        }\n+    }\n+\n+    Component {\n+        id: tickLabel\n+        RowLayout {\n+            anchors.right: parent.right\n+            height: lastIndex ? remainingHeight() : nominalHeight()\n+            Layout.fillHeight: true\n+            Layout.alignment: Qt.AlignRight | Qt.AlignBottom\n+\n+            property var lastIndex: (index + 1) == numTicks\n+\n+            Text {\n+                id: label\n+                //anchors.fill:parent // this text object is not anchored\n+                //Layout.fillHeight: true","path":"qml/DepthAxis.qml","position":null,"original_position":92,"commit_id":"48a0caca059be0245d65fc3b1adcd30f8dbcd94d","original_commit_id":"8841bfbd0195448767ca9fbab30d790f03d0b477","user":{"login":"jaxxzer","id":8315108,"node_id":"MDQ6VXNlcjgzMTUxMDg=","avatar_url":"https://avatars3.githubusercontent.com/u/8315108?v=4","gravatar_id":"","url":"https://api.github.com/users/jaxxzer","html_url":"https://github.com/jaxxzer","followers_url":"https://api.github.com/users/jaxxzer/followers","following_url":"https://api.github.com/users/jaxxzer/following{/other_user}","gists_url":"https://api.github.com/users/jaxxzer/gists{/gist_id}","starred_url":"https://api.github.com/users/jaxxzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaxxzer/subscriptions","organizations_url":"https://api.github.com/users/jaxxzer/orgs","repos_url":"https://api.github.com/users/jaxxzer/repos","events_url":"https://api.github.com/users/jaxxzer/events{/privacy}","received_events_url":"https://api.github.com/users/jaxxzer/received_events","type":"User","site_admin":false},"body":"There are some bugs with what I expect to be the reasonable thing to do (bind text anchors to parent, use horizontal and verticalAlignment). It hangs the program when trying to use these. I left the comments just to explain the situation.","created_at":"2018-07-02T16:37:03Z","updated_at":"2018-07-02T16:37:04Z","html_url":"https://github.com/bluerobotics/ping-viewer/pull/202#discussion_r199555172","pull_request_url":"https://api.github.com/repos/bluerobotics/ping-viewer/pulls/202","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/bluerobotics/ping-viewer/pulls/comments/199555172"},"html":{"href":"https://github.com/bluerobotics/ping-viewer/pull/202#discussion_r199555172"},"pull_request":{"href":"https://api.github.com/repos/bluerobotics/ping-viewer/pulls/202"}},"in_reply_to_id":199243163},"pull_request":{"url":"https://api.github.com/repos/bluerobotics/ping-viewer/pulls/202","id":198133975,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4MTMzOTc1","html_url":"https://github.com/bluerobotics/ping-viewer/pull/202","diff_url":"https://github.com/bluerobotics/ping-viewer/pull/202.diff","patch_url":"https://github.com/bluerobotics/ping-viewer/pull/202.patch","issue_url":"https://api.github.com/repos/bluerobotics/ping-viewer/issues/202","number":202,"state":"open","locked":false,"title":"Depth axis","user":{"login":"jaxxzer","id":8315108,"node_id":"MDQ6VXNlcjgzMTUxMDg=","avatar_url":"https://avatars3.githubusercontent.com/u/8315108?v=4","gravatar_id":"","url":"https://api.github.com/users/jaxxzer","html_url":"https://github.com/jaxxzer","followers_url":"https://api.github.com/users/jaxxzer/followers","following_url":"https://api.github.com/users/jaxxzer/following{/other_user}","gists_url":"https://api.github.com/users/jaxxzer/gists{/gist_id}","starred_url":"https://api.github.com/users/jaxxzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaxxzer/subscriptions","organizations_url":"https://api.github.com/users/jaxxzer/orgs","repos_url":"https://api.github.com/users/jaxxzer/repos","events_url":"https://api.github.com/users/jaxxzer/events{/privacy}","received_events_url":"https://api.github.com/users/jaxxzer/received_events","type":"User","site_admin":false},"body":"fix #40 ","created_at":"2018-06-28T19:47:01Z","updated_at":"2018-07-02T16:37:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ea79fcc043588acd6d1e5d1a4f0d2fa8b969d1f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/bluerobotics/ping-viewer/pulls/202/commits","review_comments_url":"https://api.github.com/repos/bluerobotics/ping-viewer/pulls/202/comments","review_comment_url":"https://api.github.com/repos/bluerobotics/ping-viewer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bluerobotics/ping-viewer/issues/202/comments","statuses_url":"https://api.github.com/repos/bluerobotics/ping-viewer/statuses/48a0caca059be0245d65fc3b1adcd30f8dbcd94d","head":{"label":"bluerobotics:depth-axis","ref":"depth-axis","sha":"48a0caca059be0245d65fc3b1adcd30f8dbcd94d","user":{"login":"bluerobotics","id":7120633,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcxMjA2MzM=","avatar_url":"https://avatars0.githubusercontent.com/u/7120633?v=4","gravatar_id":"","url":"https://api.github.com/users/bluerobotics","html_url":"https://github.com/bluerobotics","followers_url":"https://api.github.com/users/bluerobotics/followers","following_url":"https://api.github.com/users/bluerobotics/following{/other_user}","gists_url":"https://api.github.com/users/bluerobotics/gists{/gist_id}","starred_url":"https://api.github.com/users/bluerobotics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluerobotics/subscriptions","organizations_url":"https://api.github.com/users/bluerobotics/orgs","repos_url":"https://api.github.com/users/bluerobotics/repos","events_url":"https://api.github.com/users/bluerobotics/events{/privacy}","received_events_url":"https://api.github.com/users/bluerobotics/received_events","type":"Organization","site_admin":false},"repo":{"id":115736025,"node_id":"MDEwOlJlcG9zaXRvcnkxMTU3MzYwMjU=","name":"ping-viewer","full_name":"bluerobotics/ping-viewer","owner":{"login":"bluerobotics","id":7120633,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcxMjA2MzM=","avatar_url":"https://avatars0.githubusercontent.com/u/7120633?v=4","gravatar_id":"","url":"https://api.github.com/users/bluerobotics","html_url":"https://github.com/bluerobotics","followers_url":"https://api.github.com/users/bluerobotics/followers","following_url":"https://api.github.com/users/bluerobotics/following{/other_user}","gists_url":"https://api.github.com/users/bluerobotics/gists{/gist_id}","starred_url":"https://api.github.com/users/bluerobotics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluerobotics/subscriptions","organizations_url":"https://api.github.com/users/bluerobotics/orgs","repos_url":"https://api.github.com/users/bluerobotics/repos","events_url":"https://api.github.com/users/bluerobotics/events{/privacy}","received_events_url":"https://api.github.com/users/bluerobotics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bluerobotics/ping-viewer","description":null,"fork":false,"url":"https://api.github.com/repos/bluerobotics/ping-viewer","forks_url":"https://api.github.com/repos/bluerobotics/ping-viewer/forks","keys_url":"https://api.github.com/repos/bluerobotics/ping-viewer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bluerobotics/ping-viewer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bluerobotics/ping-viewer/teams","hooks_url":"https://api.github.com/repos/bluerobotics/ping-viewer/hooks","issue_events_url":"https://api.github.com/repos/bluerobotics/ping-viewer/issues/events{/number}","events_url":"https://api.github.com/repos/bluerobotics/ping-viewer/events","assignees_url":"https://api.github.com/repos/bluerobotics/ping-viewer/assignees{/user}","branches_url":"https://api.github.com/repos/bluerobotics/ping-viewer/branches{/branch}","tags_url":"https://api.github.com/repos/bluerobotics/ping-viewer/tags","blobs_url":"https://api.github.com/repos/bluerobotics/ping-viewer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bluerobotics/ping-viewer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bluerobotics/ping-viewer/git/refs{/sha}","trees_url":"https://api.github.com/repos/bluerobotics/ping-viewer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bluerobotics/ping-viewer/statuses/{sha}","languages_url":"https://api.github.com/repos/bluerobotics/ping-viewer/languages","stargazers_url":"https://api.github.com/repos/bluerobotics/ping-viewer/stargazers","contributors_url":"https://api.github.com/repos/bluerobotics/ping-viewer/contributors","subscribers_url":"https://api.github.com/repos/bluerobotics/ping-viewer/subscribers","subscription_url":"https://api.github.com/repos/bluerobotics/ping-viewer/subscription","commits_url":"https://api.github.com/repos/bluerobotics/ping-viewer/commits{/sha}","git_commits_url":"https://api.github.com/repos/bluerobotics/ping-viewer/git/commits{/sha}","comments_url":"https://api.github.com/repos/bluerobotics/ping-viewer/comments{/number}","issue_comment_url":"https://api.github.com/repos/bluerobotics/ping-viewer/issues/comments{/number}","contents_url":"https://api.github.com/repos/bluerobotics/ping-viewer/contents/{+path}","compare_url":"https://api.github.com/repos/bluerobotics/ping-viewer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bluerobotics/ping-viewer/merges","archive_url":"https://api.github.com/repos/bluerobotics/ping-viewer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bluerobotics/ping-viewer/downloads","issues_url":"https://api.github.com/repos/bluerobotics/ping-viewer/issues{/number}","pulls_url":"https://api.github.com/repos/bluerobotics/ping-viewer/pulls{/number}","milestones_url":"https://api.github.com/repos/bluerobotics/ping-viewer/milestones{/number}","notifications_url":"https://api.github.com/repos/bluerobotics/ping-viewer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bluerobotics/ping-viewer/labels{/name}","releases_url":"https://api.github.com/repos/bluerobotics/ping-viewer/releases{/id}","deployments_url":"https://api.github.com/repos/bluerobotics/ping-viewer/deployments","created_at":"2017-12-29T16:07:14Z","updated_at":"2018-06-29T17:37:30Z","pushed_at":"2018-07-02T16:33:29Z","git_url":"git://github.com/bluerobotics/ping-viewer.git","ssh_url":"git@github.com:bluerobotics/ping-viewer.git","clone_url":"https://github.com/bluerobotics/ping-viewer.git","svn_url":"https://github.com/bluerobotics/ping-viewer","homepage":null,"size":539,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":40,"license":null,"forks":1,"open_issues":40,"watchers":0,"default_branch":"master"}},"base":{"label":"bluerobotics:master","ref":"master","sha":"854cf0647527306b72882b12a673352d062af2e6","user":{"login":"bluerobotics","id":7120633,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcxMjA2MzM=","avatar_url":"https://avatars0.githubusercontent.com/u/7120633?v=4","gravatar_id":"","url":"https://api.github.com/users/bluerobotics","html_url":"https://github.com/bluerobotics","followers_url":"https://api.github.com/users/bluerobotics/followers","following_url":"https://api.github.com/users/bluerobotics/following{/other_user}","gists_url":"https://api.github.com/users/bluerobotics/gists{/gist_id}","starred_url":"https://api.github.com/users/bluerobotics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluerobotics/subscriptions","organizations_url":"https://api.github.com/users/bluerobotics/orgs","repos_url":"https://api.github.com/users/bluerobotics/repos","events_url":"https://api.github.com/users/bluerobotics/events{/privacy}","received_events_url":"https://api.github.com/users/bluerobotics/received_events","type":"Organization","site_admin":false},"repo":{"id":115736025,"node_id":"MDEwOlJlcG9zaXRvcnkxMTU3MzYwMjU=","name":"ping-viewer","full_name":"bluerobotics/ping-viewer","owner":{"login":"bluerobotics","id":7120633,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcxMjA2MzM=","avatar_url":"https://avatars0.githubusercontent.com/u/7120633?v=4","gravatar_id":"","url":"https://api.github.com/users/bluerobotics","html_url":"https://github.com/bluerobotics","followers_url":"https://api.github.com/users/bluerobotics/followers","following_url":"https://api.github.com/users/bluerobotics/following{/other_user}","gists_url":"https://api.github.com/users/bluerobotics/gists{/gist_id}","starred_url":"https://api.github.com/users/bluerobotics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluerobotics/subscriptions","organizations_url":"https://api.github.com/users/bluerobotics/orgs","repos_url":"https://api.github.com/users/bluerobotics/repos","events_url":"https://api.github.com/users/bluerobotics/events{/privacy}","received_events_url":"https://api.github.com/users/bluerobotics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bluerobotics/ping-viewer","description":null,"fork":false,"url":"https://api.github.com/repos/bluerobotics/ping-viewer","forks_url":"https://api.github.com/repos/bluerobotics/ping-viewer/forks","keys_url":"https://api.github.com/repos/bluerobotics/ping-viewer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bluerobotics/ping-viewer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bluerobotics/ping-viewer/teams","hooks_url":"https://api.github.com/repos/bluerobotics/ping-viewer/hooks","issue_events_url":"https://api.github.com/repos/bluerobotics/ping-viewer/issues/events{/number}","events_url":"https://api.github.com/repos/bluerobotics/ping-viewer/events","assignees_url":"https://api.github.com/repos/bluerobotics/ping-viewer/assignees{/user}","branches_url":"https://api.github.com/repos/bluerobotics/ping-viewer/branches{/branch}","tags_url":"https://api.github.com/repos/bluerobotics/ping-viewer/tags","blobs_url":"https://api.github.com/repos/bluerobotics/ping-viewer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bluerobotics/ping-viewer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bluerobotics/ping-viewer/git/refs{/sha}","trees_url":"https://api.github.com/repos/bluerobotics/ping-viewer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bluerobotics/ping-viewer/statuses/{sha}","languages_url":"https://api.github.com/repos/bluerobotics/ping-viewer/languages","stargazers_url":"https://api.github.com/repos/bluerobotics/ping-viewer/stargazers","contributors_url":"https://api.github.com/repos/bluerobotics/ping-viewer/contributors","subscribers_url":"https://api.github.com/repos/bluerobotics/ping-viewer/subscribers","subscription_url":"https://api.github.com/repos/bluerobotics/ping-viewer/subscription","commits_url":"https://api.github.com/repos/bluerobotics/ping-viewer/commits{/sha}","git_commits_url":"https://api.github.com/repos/bluerobotics/ping-viewer/git/commits{/sha}","comments_url":"https://api.github.com/repos/bluerobotics/ping-viewer/comments{/number}","issue_comment_url":"https://api.github.com/repos/bluerobotics/ping-viewer/issues/comments{/number}","contents_url":"https://api.github.com/repos/bluerobotics/ping-viewer/contents/{+path}","compare_url":"https://api.github.com/repos/bluerobotics/ping-viewer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bluerobotics/ping-viewer/merges","archive_url":"https://api.github.com/repos/bluerobotics/ping-viewer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bluerobotics/ping-viewer/downloads","issues_url":"https://api.github.com/repos/bluerobotics/ping-viewer/issues{/number}","pulls_url":"https://api.github.com/repos/bluerobotics/ping-viewer/pulls{/number}","milestones_url":"https://api.github.com/repos/bluerobotics/ping-viewer/milestones{/number}","notifications_url":"https://api.github.com/repos/bluerobotics/ping-viewer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bluerobotics/ping-viewer/labels{/name}","releases_url":"https://api.github.com/repos/bluerobotics/ping-viewer/releases{/id}","deployments_url":"https://api.github.com/repos/bluerobotics/ping-viewer/deployments","created_at":"2017-12-29T16:07:14Z","updated_at":"2018-06-29T17:37:30Z","pushed_at":"2018-07-02T16:33:29Z","git_url":"git://github.com/bluerobotics/ping-viewer.git","ssh_url":"git@github.com:bluerobotics/ping-viewer.git","clone_url":"https://github.com/bluerobotics/ping-viewer.git","svn_url":"https://github.com/bluerobotics/ping-viewer","homepage":null,"size":539,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":40,"license":null,"forks":1,"open_issues":40,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bluerobotics/ping-viewer/pulls/202"},"html":{"href":"https://github.com/bluerobotics/ping-viewer/pull/202"},"issue":{"href":"https://api.github.com/repos/bluerobotics/ping-viewer/issues/202"},"comments":{"href":"https://api.github.com/repos/bluerobotics/ping-viewer/issues/202/comments"},"review_comments":{"href":"https://api.github.com/repos/bluerobotics/ping-viewer/pulls/202/comments"},"review_comment":{"href":"https://api.github.com/repos/bluerobotics/ping-viewer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bluerobotics/ping-viewer/pulls/202/commits"},"statuses":{"href":"https://api.github.com/repos/bluerobotics/ping-viewer/statuses/48a0caca059be0245d65fc3b1adcd30f8dbcd94d"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jaxxzer"}}