{"action":"created","issue":{"url":"https://api.github.com/repos/openpnp/openpnp/issues/189","labels_url":"https://api.github.com/repos/openpnp/openpnp/issues/189/labels{/name}","comments_url":"https://api.github.com/repos/openpnp/openpnp/issues/189/comments","events_url":"https://api.github.com/repos/openpnp/openpnp/issues/189/events","html_url":"https://github.com/openpnp/openpnp/issues/189","id":126003733,"number":189,"title":"Discussion for Driver refactoring, moveTo blocking, GCode, etc.","user":{"login":"vonnieda","id":1182323,"avatar_url":"https://avatars.githubusercontent.com/u/1182323?v=3","gravatar_id":"","url":"https://api.github.com/users/vonnieda","html_url":"https://github.com/vonnieda","followers_url":"https://api.github.com/users/vonnieda/followers","following_url":"https://api.github.com/users/vonnieda/following{/other_user}","gists_url":"https://api.github.com/users/vonnieda/gists{/gist_id}","starred_url":"https://api.github.com/users/vonnieda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vonnieda/subscriptions","organizations_url":"https://api.github.com/users/vonnieda/orgs","repos_url":"https://api.github.com/users/vonnieda/repos","events_url":"https://api.github.com/users/vonnieda/events{/privacy}","received_events_url":"https://api.github.com/users/vonnieda/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-11T18:13:06Z","updated_at":"2016-01-13T11:51:14Z","closed_at":"2016-01-13T06:14:52Z","body":"Comments originally made on #183, moved to this issue for further discussion.\r\n\r\n cri-s commented 2 hours ago\r\nJason, i have extended the driver api a bit,\r\nvoid dwell()  , wait until finished\r\nvoid dwell(double)  wait time in seconds.\r\nboolean GCode(string)\r\nboolean GCode(string,time)\r\n\r\nActually the only not right is on firepick driver, where i probably\r\nneed community help if this\r\nget accepted by you. Then i suggest to use GCode for driving it. I\r\nsuggest then to use GCode\r\nfor driving changer and i think, manual should be highest priority.\r\nCurrently i have tested only dwell(double) in order to go away with\r\nthread sleeping and that\r\nworks.\r\n\r\n\r\n\r\n\r\n\r\n2016-01-11 17:12 GMT+01:00, Jason von Nieda <notifications@github.com>:\r\n…\r\n @vonnieda\r\n  Owner\r\nvonnieda commented an hour ago\r\nvoid dwell() , wait until finished\r\nvoid dwell(double) wait time in seconds.\r\n\r\nWhat is the purpose of the dwell commands and how will they be used? I don't see this as being included because all of the driver methods are supposed to block until they are finished. If something is returning before it's complete then that is a bug.\r\n\r\nboolean GCode(string)\r\nboolean GCode(string,time)\r\n\r\nThese we will not include. The Driver interface is designed to be controller agnostic and this would make it specific to GCode. If you want GCode specific methods just extend the ReferenceDriver interface and implement them in your branch.\r\n @cri-s\r\n  \r\n cri-s commented 44 minutes ago\r\ndwell wait until all gcode are processed. No only some gcode are\r\nblocking, the other return without being completed.\r\ndwell(double seconds) wait seconds until and return after all previous\r\nmotion code are finished.\r\nI have used it to replace    Thread.sleep(pickDwellMilliseconds);  as\r\notherwise it don't worked\r\nbecause gcode and pc are never in sync.\r\nGCode() would be nice for nozzle changer code and others, that are\r\nalways machine specific\r\nand mostly have only moves inside it. You'r decision.\r\n\r\n2016-01-11 18:04 GMT+01:00, Jason von Nieda <notifications@github.com>:\r\n…\r\n @vonnieda\r\n  Owner\r\nvonnieda commented 32 minutes ago\r\n@cri-s All driver calls should block until they are finished. This contract must be enforced or lots of other things will break. For instance, if moveTo() or place() does not block then the machine may try to move before it's finished placing. If you have driver calls that don't block, that is a bug and should be fixed. Just call dwell() internally in the driver, as many of the drivers already do.\r\n\r\nWe can't add GCode specific things to the driver interface because there are machines that don't use GCode. For instance, the TinyG and FirePick drivers use JSON for communication. Having a GCode command on it would be meaningless.\r\n\r\nIf it's very important for you to be able to send generic commands to the driver I would be okay with adding something like public Object sendCustomCommand(Object);. With this you could do something like sendCustomCommand(\"M100\") and then process that as Gcode within your driver.\r\n\r\nThat being said, I suggest you extend ReferenceDriver and add these functions to your own driver. The program is designed to be extended like this.\r\n @cri-s\r\n  \r\n cri-s commented 11 minutes ago\r\nmoveTo don't need to block, and it's contra productive. It's enought\r\nthat after pick and place\r\nthe call is blocking, and as example actors are not blocking too. .\r\nGCode works for TinyG , FirePick , don't know i have left it as dummy\r\nfunction for now.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/openpnp/openpnp/issues/comments/171264747","html_url":"https://github.com/openpnp/openpnp/issues/189#issuecomment-171264747","issue_url":"https://api.github.com/repos/openpnp/openpnp/issues/189","id":171264747,"user":{"login":"cri-s","id":9506454,"avatar_url":"https://avatars.githubusercontent.com/u/9506454?v=3","gravatar_id":"","url":"https://api.github.com/users/cri-s","html_url":"https://github.com/cri-s","followers_url":"https://api.github.com/users/cri-s/followers","following_url":"https://api.github.com/users/cri-s/following{/other_user}","gists_url":"https://api.github.com/users/cri-s/gists{/gist_id}","starred_url":"https://api.github.com/users/cri-s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cri-s/subscriptions","organizations_url":"https://api.github.com/users/cri-s/orgs","repos_url":"https://api.github.com/users/cri-s/repos","events_url":"https://api.github.com/users/cri-s/events{/privacy}","received_events_url":"https://api.github.com/users/cri-s/received_events","type":"User","site_admin":false},"created_at":"2016-01-13T11:51:14Z","updated_at":"2016-01-13T11:51:14Z","body":"It is possible to use dwell(time) for all delays and on some utility class\nthe devell time\nIs then converted to delay call.\nThis would allow coexistence with real gcode and wait until done as you\nhave actually made it. This development  was not noticed by me as the\ndefault driver not works and the improvemnted was rejected on submission.\n\nIl mercoledì 13 gennaio 2016, Jason von Nieda <notifications@github.com> ha\nscritto:\n\n> Closed #189 <https://github.com/openpnp/openpnp/issues/189>.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/openpnp/openpnp/issues/189#event-513327379>.\n>\n"}}