{"action":"created","comment":{"url":"https://api.github.com/repos/martinisgroup/servers/pulls/comments/41904830","id":41904830,"diff_hunk":"@@ -0,0 +1,81 @@\n+package org.labrad.qubits\n+\n+import org.labrad.data.Data\n+import scala.collection.JavaConverters._\n+\n+object Constants {\n+  /*\n+   * Minimum delay (in microseconds) after sending a command to the DC Rack\n+   */\n+  val DEFAULT_BIAS_DELAY = 4.3\n+\n+  /*\n+   * Length of AutoTrigger pulse in nanoseconds\n+   */\n+  val AUTOTRIGGER_PULSE_LENGTH = 16\n+\n+  /*\n+   * Maximum number of reps that can be run in one go.\n+   *\n+   * This number is determined by two factors, first the number\n+   * of reps must fit into a two byte field in the packet that\n+   * is sent to the DACs, and second it must be a multiple of 30,\n+   * since timing results are sent back in groups of 30.\n+   */\n+  val MAX_REPS = 65535 // No longer has to be a multiple of 30 ERJ\n+  //public static final long MAX_REPS = 300;\n+\n+  /*\n+   * Servers we need to talk to\n+   */\n+  val REGISTRY_SERVER = \"Registry\"\n+  val HITTITE_SERVER = \"Hittite T2100 Server\"\n+  val ANRITSU_SERVER = \"Anritsu Server\"\n+  val DC_RACK_SERVER = \"DC Rack Server\"\n+  val GHZ_DAC_SERVER = \"GHz FPGAs\"\n+\n+  /*\n+   * Registry information\n+   */\n+  val WIRING_PATH = Array(\"\", \"Servers\", \"Qubit Server\", \"Wiring\")\n+  val WIRING_KEY = \"wiring\"\n+  // ([(Type, Name)...],[((GHz board id,chan),(DC board id,chan)),...],[(uwave board id, microwave source id)])\n+  val WIRING_TYPE = \"*(ss), *((ss)(ss)), *(ss)\"\n+  //public static final String WIRING_TYPE = \"*(ss?), *((ss)(ss)), *(ss)\";\n+\n+  val BUILD_INFO_PATH = Array(\"\", \"Servers\", \"GHz FPGAs\")\n+\n+  val DEFAULT_ADC_PROPERTIES = Map(\n+    \"DEMOD_CHANNELS\" -> 4,\n+    \"DEMOD_CHANNELS_PER_PACKET\" -> 11,\n+    \"DEMOD_PACKET_LEN\" -> 46,\n+    \"DEMOD_TIME_STEP\" -> 2,\n+    \"AVERAGE_PACKETS\" -> 32,\n+    \"AVERAGE_PACKET_LEN\" -> 1024,\n+    \"TRIG_AMP\" -> 255,\n+    \"LOOKUP_TABLE_LEN\" -> 256,\n+    \"FILTER_LEN\" -> 4096,\n+    \"SRAM_WRITE_DERPS\" -> 9,\n+    \"SRAM_WRITE_PKT_LEN\" -> 1024,\n+    \"LOOKUP_ACCUMULATOR_BITS\" -> 16\n+  )\n+\n+  val DEFAULT_DAC_PROPERTIES = Map(\n+    \"SRAM_LEN\" -> 10240,\n+    \"SRAM_PAGE_LEN\" -> 5120,\n+    \"SRAM_DELAY_LEN\" -> 1024,\n+    \"SRAM_BLOCK0_LEN\" -> 8192,\n+    \"SRAM_BLOCK1_LEN\" -> 2048,\n+    \"SRAM_WRITE_PKT_LEN\" -> 256\n+  )\n+\n+  private def processProperties(props: Map[String, Int]): Data = {\n+    val elems = props.map { case (k, v) =>\n+      Data.clusterOf(Data.valueOf(k), Data.valueOf(v.toLong))\n+    }\n+    Data.listOf(elems.toSeq.asJava)","path":"QubitServer/src/main/java/org/labrad/qubits/Constants.scala","position":73,"original_position":76,"commit_id":"6b0416a79928328924b9abb1c45fecf8df7772a8","original_commit_id":"0b3306f876b8361a749803081435412fea5020bf","user":{"login":"maffoo","id":129268,"avatar_url":"https://avatars.githubusercontent.com/u/129268?v=3","gravatar_id":"","url":"https://api.github.com/users/maffoo","html_url":"https://github.com/maffoo","followers_url":"https://api.github.com/users/maffoo/followers","following_url":"https://api.github.com/users/maffoo/following{/other_user}","gists_url":"https://api.github.com/users/maffoo/gists{/gist_id}","starred_url":"https://api.github.com/users/maffoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maffoo/subscriptions","organizations_url":"https://api.github.com/users/maffoo/orgs","repos_url":"https://api.github.com/users/maffoo/repos","events_url":"https://api.github.com/users/maffoo/events{/privacy}","received_events_url":"https://api.github.com/users/maffoo/received_events","type":"User","site_admin":false},"body":"It converts a scala collection type (in this case `scala.collection.Seq`) to a java collection type (`java.util.List`). We have this impedance mismatch because it's much simpler to work with scala collections, but the JLabrad api methods want java collections; the .asJava and .asScala methods do the needed conversions. Once we switch everything over to scalabrad, which can deal with scala collections, these will go away.","created_at":"2015-10-13T18:25:06Z","updated_at":"2015-10-13T18:25:06Z","html_url":"https://github.com/martinisgroup/servers/pull/212#discussion_r41904830","pull_request_url":"https://api.github.com/repos/martinisgroup/servers/pulls/212","_links":{"self":{"href":"https://api.github.com/repos/martinisgroup/servers/pulls/comments/41904830"},"html":{"href":"https://github.com/martinisgroup/servers/pull/212#discussion_r41904830"},"pull_request":{"href":"https://api.github.com/repos/martinisgroup/servers/pulls/212"}}},"pull_request":{"url":"https://api.github.com/repos/martinisgroup/servers/pulls/212","id":42974423,"html_url":"https://github.com/martinisgroup/servers/pull/212","diff_url":"https://github.com/martinisgroup/servers/pull/212.diff","patch_url":"https://github.com/martinisgroup/servers/pull/212.patch","issue_url":"https://api.github.com/repos/martinisgroup/servers/issues/212","number":212,"state":"open","locked":false,"title":"Convert top-level qubit server code to scala","user":{"login":"maffoo","id":129268,"avatar_url":"https://avatars.githubusercontent.com/u/129268?v=3","gravatar_id":"","url":"https://api.github.com/users/maffoo","html_url":"https://github.com/maffoo","followers_url":"https://api.github.com/users/maffoo/followers","following_url":"https://api.github.com/users/maffoo/following{/other_user}","gists_url":"https://api.github.com/users/maffoo/gists{/gist_id}","starred_url":"https://api.github.com/users/maffoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maffoo/subscriptions","organizations_url":"https://api.github.com/users/maffoo/orgs","repos_url":"https://api.github.com/users/maffoo/repos","events_url":"https://api.github.com/users/maffoo/events{/privacy}","received_events_url":"https://api.github.com/users/maffoo/received_events","type":"User","site_admin":false},"body":"See #164\r\n\r\nThis is the last part of the transliteration phase, with all the code now converted to scala (except for a few enumerations). After this, we'll be able to move on to removing the java-isms to take advantage of the many nice features scala has to offer.","created_at":"2015-08-20T20:28:51Z","updated_at":"2015-10-13T18:25:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4e329dd848364400a5486d822889817f11485870","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/martinisgroup/servers/pulls/212/commits","review_comments_url":"https://api.github.com/repos/martinisgroup/servers/pulls/212/comments","review_comment_url":"https://api.github.com/repos/martinisgroup/servers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/martinisgroup/servers/issues/212/comments","statuses_url":"https://api.github.com/repos/martinisgroup/servers/statuses/6b0416a79928328924b9abb1c45fecf8df7772a8","head":{"label":"martinisgroup:u/maffoo/scala-qubit-server","ref":"u/maffoo/scala-qubit-server","sha":"6b0416a79928328924b9abb1c45fecf8df7772a8","user":{"login":"martinisgroup","id":5026004,"avatar_url":"https://avatars.githubusercontent.com/u/5026004?v=3","gravatar_id":"","url":"https://api.github.com/users/martinisgroup","html_url":"https://github.com/martinisgroup","followers_url":"https://api.github.com/users/martinisgroup/followers","following_url":"https://api.github.com/users/martinisgroup/following{/other_user}","gists_url":"https://api.github.com/users/martinisgroup/gists{/gist_id}","starred_url":"https://api.github.com/users/martinisgroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinisgroup/subscriptions","organizations_url":"https://api.github.com/users/martinisgroup/orgs","repos_url":"https://api.github.com/users/martinisgroup/repos","events_url":"https://api.github.com/users/martinisgroup/events{/privacy}","received_events_url":"https://api.github.com/users/martinisgroup/received_events","type":"Organization","site_admin":false},"repo":{"id":21184808,"name":"servers","full_name":"martinisgroup/servers","owner":{"login":"martinisgroup","id":5026004,"avatar_url":"https://avatars.githubusercontent.com/u/5026004?v=3","gravatar_id":"","url":"https://api.github.com/users/martinisgroup","html_url":"https://github.com/martinisgroup","followers_url":"https://api.github.com/users/martinisgroup/followers","following_url":"https://api.github.com/users/martinisgroup/following{/other_user}","gists_url":"https://api.github.com/users/martinisgroup/gists{/gist_id}","starred_url":"https://api.github.com/users/martinisgroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinisgroup/subscriptions","organizations_url":"https://api.github.com/users/martinisgroup/orgs","repos_url":"https://api.github.com/users/martinisgroup/repos","events_url":"https://api.github.com/users/martinisgroup/events{/privacy}","received_events_url":"https://api.github.com/users/martinisgroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/martinisgroup/servers","description":"LabRAD servers","fork":false,"url":"https://api.github.com/repos/martinisgroup/servers","forks_url":"https://api.github.com/repos/martinisgroup/servers/forks","keys_url":"https://api.github.com/repos/martinisgroup/servers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martinisgroup/servers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martinisgroup/servers/teams","hooks_url":"https://api.github.com/repos/martinisgroup/servers/hooks","issue_events_url":"https://api.github.com/repos/martinisgroup/servers/issues/events{/number}","events_url":"https://api.github.com/repos/martinisgroup/servers/events","assignees_url":"https://api.github.com/repos/martinisgroup/servers/assignees{/user}","branches_url":"https://api.github.com/repos/martinisgroup/servers/branches{/branch}","tags_url":"https://api.github.com/repos/martinisgroup/servers/tags","blobs_url":"https://api.github.com/repos/martinisgroup/servers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martinisgroup/servers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martinisgroup/servers/git/refs{/sha}","trees_url":"https://api.github.com/repos/martinisgroup/servers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martinisgroup/servers/statuses/{sha}","languages_url":"https://api.github.com/repos/martinisgroup/servers/languages","stargazers_url":"https://api.github.com/repos/martinisgroup/servers/stargazers","contributors_url":"https://api.github.com/repos/martinisgroup/servers/contributors","subscribers_url":"https://api.github.com/repos/martinisgroup/servers/subscribers","subscription_url":"https://api.github.com/repos/martinisgroup/servers/subscription","commits_url":"https://api.github.com/repos/martinisgroup/servers/commits{/sha}","git_commits_url":"https://api.github.com/repos/martinisgroup/servers/git/commits{/sha}","comments_url":"https://api.github.com/repos/martinisgroup/servers/comments{/number}","issue_comment_url":"https://api.github.com/repos/martinisgroup/servers/issues/comments{/number}","contents_url":"https://api.github.com/repos/martinisgroup/servers/contents/{+path}","compare_url":"https://api.github.com/repos/martinisgroup/servers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martinisgroup/servers/merges","archive_url":"https://api.github.com/repos/martinisgroup/servers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martinisgroup/servers/downloads","issues_url":"https://api.github.com/repos/martinisgroup/servers/issues{/number}","pulls_url":"https://api.github.com/repos/martinisgroup/servers/pulls{/number}","milestones_url":"https://api.github.com/repos/martinisgroup/servers/milestones{/number}","notifications_url":"https://api.github.com/repos/martinisgroup/servers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martinisgroup/servers/labels{/name}","releases_url":"https://api.github.com/repos/martinisgroup/servers/releases{/id}","created_at":"2014-06-25T00:07:25Z","updated_at":"2015-09-22T00:04:50Z","pushed_at":"2015-10-13T18:22:24Z","git_url":"git://github.com/martinisgroup/servers.git","ssh_url":"git@github.com:martinisgroup/servers.git","clone_url":"https://github.com/martinisgroup/servers.git","svn_url":"https://github.com/martinisgroup/servers","homepage":"","size":54619,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":70,"forks":4,"open_issues":70,"watchers":2,"default_branch":"master"}},"base":{"label":"martinisgroup:master","ref":"master","sha":"371688b200bf106e366b6a112869316f39bdd134","user":{"login":"martinisgroup","id":5026004,"avatar_url":"https://avatars.githubusercontent.com/u/5026004?v=3","gravatar_id":"","url":"https://api.github.com/users/martinisgroup","html_url":"https://github.com/martinisgroup","followers_url":"https://api.github.com/users/martinisgroup/followers","following_url":"https://api.github.com/users/martinisgroup/following{/other_user}","gists_url":"https://api.github.com/users/martinisgroup/gists{/gist_id}","starred_url":"https://api.github.com/users/martinisgroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinisgroup/subscriptions","organizations_url":"https://api.github.com/users/martinisgroup/orgs","repos_url":"https://api.github.com/users/martinisgroup/repos","events_url":"https://api.github.com/users/martinisgroup/events{/privacy}","received_events_url":"https://api.github.com/users/martinisgroup/received_events","type":"Organization","site_admin":false},"repo":{"id":21184808,"name":"servers","full_name":"martinisgroup/servers","owner":{"login":"martinisgroup","id":5026004,"avatar_url":"https://avatars.githubusercontent.com/u/5026004?v=3","gravatar_id":"","url":"https://api.github.com/users/martinisgroup","html_url":"https://github.com/martinisgroup","followers_url":"https://api.github.com/users/martinisgroup/followers","following_url":"https://api.github.com/users/martinisgroup/following{/other_user}","gists_url":"https://api.github.com/users/martinisgroup/gists{/gist_id}","starred_url":"https://api.github.com/users/martinisgroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinisgroup/subscriptions","organizations_url":"https://api.github.com/users/martinisgroup/orgs","repos_url":"https://api.github.com/users/martinisgroup/repos","events_url":"https://api.github.com/users/martinisgroup/events{/privacy}","received_events_url":"https://api.github.com/users/martinisgroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/martinisgroup/servers","description":"LabRAD servers","fork":false,"url":"https://api.github.com/repos/martinisgroup/servers","forks_url":"https://api.github.com/repos/martinisgroup/servers/forks","keys_url":"https://api.github.com/repos/martinisgroup/servers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martinisgroup/servers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martinisgroup/servers/teams","hooks_url":"https://api.github.com/repos/martinisgroup/servers/hooks","issue_events_url":"https://api.github.com/repos/martinisgroup/servers/issues/events{/number}","events_url":"https://api.github.com/repos/martinisgroup/servers/events","assignees_url":"https://api.github.com/repos/martinisgroup/servers/assignees{/user}","branches_url":"https://api.github.com/repos/martinisgroup/servers/branches{/branch}","tags_url":"https://api.github.com/repos/martinisgroup/servers/tags","blobs_url":"https://api.github.com/repos/martinisgroup/servers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martinisgroup/servers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martinisgroup/servers/git/refs{/sha}","trees_url":"https://api.github.com/repos/martinisgroup/servers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martinisgroup/servers/statuses/{sha}","languages_url":"https://api.github.com/repos/martinisgroup/servers/languages","stargazers_url":"https://api.github.com/repos/martinisgroup/servers/stargazers","contributors_url":"https://api.github.com/repos/martinisgroup/servers/contributors","subscribers_url":"https://api.github.com/repos/martinisgroup/servers/subscribers","subscription_url":"https://api.github.com/repos/martinisgroup/servers/subscription","commits_url":"https://api.github.com/repos/martinisgroup/servers/commits{/sha}","git_commits_url":"https://api.github.com/repos/martinisgroup/servers/git/commits{/sha}","comments_url":"https://api.github.com/repos/martinisgroup/servers/comments{/number}","issue_comment_url":"https://api.github.com/repos/martinisgroup/servers/issues/comments{/number}","contents_url":"https://api.github.com/repos/martinisgroup/servers/contents/{+path}","compare_url":"https://api.github.com/repos/martinisgroup/servers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martinisgroup/servers/merges","archive_url":"https://api.github.com/repos/martinisgroup/servers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martinisgroup/servers/downloads","issues_url":"https://api.github.com/repos/martinisgroup/servers/issues{/number}","pulls_url":"https://api.github.com/repos/martinisgroup/servers/pulls{/number}","milestones_url":"https://api.github.com/repos/martinisgroup/servers/milestones{/number}","notifications_url":"https://api.github.com/repos/martinisgroup/servers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martinisgroup/servers/labels{/name}","releases_url":"https://api.github.com/repos/martinisgroup/servers/releases{/id}","created_at":"2014-06-25T00:07:25Z","updated_at":"2015-09-22T00:04:50Z","pushed_at":"2015-10-13T18:22:24Z","git_url":"git://github.com/martinisgroup/servers.git","ssh_url":"git@github.com:martinisgroup/servers.git","clone_url":"https://github.com/martinisgroup/servers.git","svn_url":"https://github.com/martinisgroup/servers","homepage":"","size":54619,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":70,"forks":4,"open_issues":70,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/martinisgroup/servers/pulls/212"},"html":{"href":"https://github.com/martinisgroup/servers/pull/212"},"issue":{"href":"https://api.github.com/repos/martinisgroup/servers/issues/212"},"comments":{"href":"https://api.github.com/repos/martinisgroup/servers/issues/212/comments"},"review_comments":{"href":"https://api.github.com/repos/martinisgroup/servers/pulls/212/comments"},"review_comment":{"href":"https://api.github.com/repos/martinisgroup/servers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/martinisgroup/servers/pulls/212/commits"},"statuses":{"href":"https://api.github.com/repos/martinisgroup/servers/statuses/6b0416a79928328924b9abb1c45fecf8df7772a8"}}}}