From d2f0f063c5d4d70294fbd8e618bd4a38eb99f05f Mon Sep 17 00:00:00 2001 From: cfry Date: Tue, 20 Nov 2018 18:23:34 -0500 Subject: [PATCH] release --- blocksde/init.js | 102 +++++++++++++++++++++++++++++++++++++++-- de/de.js | 40 +++++++++------- de/de_testsuite.js | 8 +++- doc/ref_man.html | 7 +-- doc/release_notes.html | 23 ++++++++++ editor.js | 18 +++++--- eval.js | 16 ++++++- index.html | 2 + job.js | 2 +- package.json | 4 +- ready.js | 12 +---- robot.js | 4 +- robot_status_dialog.js | 36 +++++++++------ series.js | 2 +- socket.js | 12 ++--- 15 files changed, 220 insertions(+), 68 deletions(-) diff --git a/blocksde/init.js b/blocksde/init.js index f923e347..12e74b7d 100644 --- a/blocksde/init.js +++ b/blocksde/init.js @@ -11,7 +11,7 @@ function blocks_init(){ javascript_pane_header_wrapper_id.appendChild( - make_dom_elt("span", + /*make_dom_elt("span", {id:"text_blocks_toggle_id", title: "Toggle editor view between text and blocks.", "font-size":"20px", @@ -20,7 +20,16 @@ function blocks_init(){ margin:"0px", "vertical-align":"20%", onclick:"toggle_text_blocks_display()"}, - " ⧉ ")) + " ⧉ "))*/ + make_dom_elt("select", + {id:"code_view_kind_id", + title:"Translate the Editor pane to a different syntax for viewing your code.", + "background-color": "#4cc9fd", + "vertical-align":"50%", + onclick:"change_code_view_kind()"}, + "" + ) + ) } function make_blocksde_dom_elt(){ @@ -53,7 +62,7 @@ var blocksde_dom_elt = null -function toggle_text_blocks_display(){ +/*function toggle_text_blocks_display(){ if (Editor.view == "text"){ out("installing blocks") let src = Editor.get_javascript("auto") //must do before the switch @@ -97,6 +106,93 @@ function toggle_text_blocks_display(){ Editor.view = "text" myCodeMirror.focus() } +}*/ + +function change_code_view_kind(){ + let new_view_kind = code_view_kind_id.value + if (Editor.view == "JS"){ //old_view_kind + if (new_view_kind == "Blocks"){ js_to_blocks() } + else if (new_view_kind == "DefEng"){ js_to_defeng() } + } + else if(Editor.view == "Blocks"){ //old_view_kind + if (new_view_kind == "JS"){ blocks_to_js() } + else if (new_view_kind == "DefEng"){ blocks_to_defeng() } + } + else if(Editor.view == "DefEng") { //old_view_kind + if (new_view_kind == "JS") { defeng_to_js() } + else if (new_view_kind == "Blocks"){ defeng_to_blocks() } + } +} + +function js_to_blocks(){ + out("installing blocks") + let src = Editor.get_javascript() //must do before the switch + let block_to_install + try{ + if (src.trim() != ""){block_to_install = JS2B.js_to_blocks(src.trim())} //do before switching views in case this errors, we want to stay in text view + } + catch(err){ + warning("Could not convert JavaScript source to blocks due to error:
" + + err.message + + "
Make sure your JS text evals without errors before switching to blocks.") + return + } + if (!the_codemirror_elt) { //haven't used blocksde yet so initialize it + the_codemirror_elt = document.getElementsByClassName("CodeMirror")[0] + blocksde_dom_elt = make_blocksde_dom_elt() + let blocks_style_content = file_content(__dirname + "/blocksde/style2.css") + let style_elt = make_dom_elt("style", {}, blocks_style_content) //"* { background-color:blue;}") + blocksde_dom_elt.appendChild(style_elt) + replace_dom_elt(the_codemirror_elt, blocksde_dom_elt) //must occur before calling make_workspace_instance + //because that needs workspace_container_id to be installed in order to + //install workspace_id inside it + Workspace.make_workspace_instance( + //the_codemirror_elt.offsetWidth, the_codemirror_elt.offsetHeight //this vals are always zero + ) + } + else { replace_dom_elt(the_codemirror_elt, blocksde_dom_elt) } + Workspace.inst.clear_blocks() + if (block_to_install){ //we've got non empty src code so turn it into blocks. + install_top_left_block(block_to_install) + } + text_blocks_toggle_id.style["background-color"] = "#AAFFAA" + Editor.view = "Blocks" +} + +function blocks_to_js(){ + out("installing text") + let js = Workspace.inst.to_js() + replace_dom_elt(blocksde_dom_elt, the_codemirror_elt) + text_blocks_toggle_id.style["background-color"] = "#CCCCCC" + Editor.set_javascript(js) + Editor.view = "JS" + myCodeMirror.focus() +} + +var old_source_defeng = "" //kludge to fake JS to defeng +function js_to_defeng(){ + let defeng = old_source_defeng //usualy wrong but ok for limited demos if you first do a defeng_to_js() + Editor.set_javascript(defeng) + Editor.view = "DefEng" +} + +function defeng_to_js(){ + let defeng = Editor.get_javascript() + old_source_defeng = defeng //kludge for js_to_defeng + let js = DE.de_to_js(defeng) + Editor.set_javascript(js) + Editor.view = "JS" +} + +function blocks_to_defeng(){ + blocks_to_js() + js_to_defeng() +} + +function defeng_to_blocks(){ + old_source_defeng = Editor.get_javascript("auto") //kludge + defeng_to_js() + js_to_blocks() } \ No newline at end of file diff --git a/de/de.js b/de/de.js index c56c82ea..844bda46 100644 --- a/de/de.js +++ b/de/de.js @@ -74,13 +74,21 @@ DE.ops = {"less than": "<", "also": "&&", "or": "||" } -DE.peg = require("pegjs") +DE.peg = require("pegjs") DE.PegTracer = require('pegjs-backtrace'); DE.parser = DE.peg.generate( -`start = result:expr { return result } -expr = before_com:comment* ws_or_not result:(fn_def / assignment / maker / sentence / string1 / path / variable / undefined / number) ws_or_not after_com:comment* - { return before_com + result + after_com } +`start = result:exprs { return result } +exprs = ws_or_not first_exper:expr rest_expers:(ws expr)* { + let result = first_exper + for(let ex of rest_expers) { + result += "\\n" + ex[1] + } + return result + } +expr = result:(fn_def / assignment / maker / sentence / string1 / path / variable / undefined / number) { + return result + } maker = "make" ws (("an" / "a") ws)? subj:subject ws "with" ws args:arguments? sent_end { if (subj == "Array") { args = args.substring(1, args.length - 1) @@ -100,17 +108,17 @@ assignment = scope:(("variable" / "local") ws)? loc:(path / variable) return the_scope + loc + " = " + val } -fn_def = "to" ws sentence ws_or_not eb:exprs_block - { let result = "function " + name + args + eb +fn_def = "to" ws name_and_args:sentence ws_or_not eb:exprs_block{ + debugger + let result = "function " + name_and_args + eb console.log("got fn_def: " + result) return result } -exprs_block = "do" ws the_expers:(expr ws)* "!" { - console.log("got expers_block with: " + the_expers) - let result = "{" - for(expr of the_expers){ - } - result += "}" +exprs_block = "do" ws the_exprs:exprs ws_or_not "!" { + debugger; + console.log("got exprs_block with: " + the_exprs) + let result = "{" + the_exprs + "}" + return result } sentence = result:(sent_subj_verb_args / sent_verb_args / sent_subj_verb / sent_verb) { @@ -147,7 +155,6 @@ verb = ` + DE.make_verb_rule_expers() + ` { } arguments = var_num1:argument var_nums:(arg_sep argument)* { let args = var_num1 - debugger out("hi") //get rid of trailing undefined args as would happen with DE "nothing" for(let i = (var_nums.length - 1); i >= 0; i--){ @@ -171,9 +178,11 @@ argument = arg_name:(variable ws "of" ws)? the_expr:expr { if(arg_name) { prefix = arg_name[0] + ": " } let result = prefix + the_expr console.log("got arg: " + result) - return + return result } -arg_sep "arg_sep" = (ws "and" ws) / (ws_or_not "," ws_or_not) { return ", " } +arg_sep "arg_sep" = (ws "and" ws) / (ws_or_not "," ws_or_not) { + console.log("got arg_sep: " + text()) + return ", " } @@ -256,7 +265,6 @@ string1 = ('"' [^"]* '"') / ("'" [^\\']* "'") { // HEXDIG = [0-9a-f]i "to" ws name:variable ws "with" ws args:arguments sent_end ws eb:exprs_block - */ diff --git a/de/de_testsuite.js b/de/de_testsuite.js index b196155a..563da2ac 100644 --- a/de/de_testsuite.js +++ b/de/de_testsuite.js @@ -1,3 +1,4 @@ + new TestSuite("DE comparison", ['DE.de_to_js("4 less than with 67.")', '"(4 < 67)"'], ['DE.de_to_js("4 more than with 67.")', '"(4 > 67)"'], @@ -89,9 +90,12 @@ new TestSuite("DE assignment", ['DE.de_to_js("variable bar means 6.")', '"var bar = 6"'], ['DE.de_to_js("local bar means 6.")', '"let bar = 6"'] ) +new TestSuite("multiple expressions", + ['DE.de_to_js("foo means 2. bar with 123.")', '"foo = 2\\nbar(123)"'] +) -DE.de_to_js("to double with num. do num1 plus with num2.!") -DE.de_to_js("double with num.") +DE.de_to_js("to double with num. do num plus with num.!") +DE.de_to_js("double with 3.") diff --git a/doc/ref_man.html b/doc/ref_man.html index 32d92d39..e2a47e1c 100644 --- a/doc/ref_man.html +++ b/doc/ref_man.html @@ -1926,14 +1926,15 @@ Other options are: "sine", "square", "sawtooth".
callback A function of no arguments that is called when the beep finishes playing. Default: null, meaning do nothing.
-Example:

+Examples:
+ beep() +

 beep({dur: 0.125,
       frequency: 440,
       volume: 1,
       waveform: "triangle",
       callback: function(){beep({dur: 0.125, frequency: 493.88})}
-     })
-
+ })
beeps diff --git a/doc/release_notes.html b/doc/release_notes.html index d2a64cbb..d2cbad70 100644 --- a/doc/release_notes.html +++ b/doc/release_notes.html @@ -6,6 +6,29 @@ .doc_details summary { font-weight: 600; } +
v 2.5.13, Nov 20, 2018 + Highlights: bug fixes. +
    +
  • J6_MEASURED_TORQUE swapped with J7_MEASURED_TORQUE + in robot_status table.
  • + +
  • While reading robot status into DDE from Dexter, adjusted conversion for J6.
  • + +
  • robot status window widened to accommodate long numbers.
  • + + +
  • Fixed bug in robot status dialog that when switching between + robots the table wasn't updated. + Also fixed bug that when switching to a defined robot that + never had a job run on it, it errored.
  • + +
  • robot status dialog "Run Update Job" button now works.
  • + +
  • Fixed bug when a file in DDE's menu of files has only a name and no folder. + It now defaults the folder to "dde_apps".
  • +
+
+
v 2.5.12, Nov 18, 2018 Highlights: new Job() with no args now works. Many bug fixes.
    diff --git a/editor.js b/editor.js index 6df6c1e1..dcd65f4b 100644 --- a/editor.js +++ b/editor.js @@ -22,7 +22,7 @@ var myCodeMirror function Editor(){} //just a namespace of *some* internal fns Editor.current_file_path = null //could be "new file" or "/Users/.../foo.fs" -Editor.view = "text" +Editor.view = "JS" Editor.init_editor = function(){ myCodeMirror = CodeMirror.fromTextArea(js_textarea_id, @@ -145,7 +145,8 @@ Editor.files_menu_path_to_path = function(menu_path){ let name_and_fold = menu_path.split(" ") let name = name_and_fold[0] let fold = name_and_fold[1] - if (fold.startsWith("dde_apps/")){ + if (!fold) { fold = dde_apps_dir + "/" } + else if (fold.startsWith("dde_apps/")){ fold = dde_apps_dir + fold.substring(8) } let path = fold + name @@ -219,10 +220,13 @@ Editor.get_any_selection = function(){ } sel_text = Editor.get_cmd_selection() if(sel_text.length > 0 ) { return sel_text } - if (Editor.view == "text") { + if (Editor.view == "JS") { sel_text = myCodeMirror.doc.getValue().substring(Editor.selection_start(), Editor.selection_end()) } - else { //blocks view + else if (Editor.view == "DefEng") { + sel_text = myCodeMirror.doc.getValue().substring(Editor.selection_start(), Editor.selection_end()) + } + else { //Blocks view sel_text = Workspace.inst.get_javascript(use_selection=true) } if(sel_text.length > 0) { return sel_text } @@ -251,7 +255,7 @@ Editor.get_javascript = function(use_selection=false){ //if use_selection is true, return it. // if false, return whole buffer. // if "auto", then if sel, return it, else return whole buffer. - if(Editor.view == "text") { + if((Editor.view == "JS") || (Editor.view == "DefEng")) { let full_src = myCodeMirror.doc.getValue() //$("#js_textarea_id").val() //careful: js_textarea_id.value returns a string with an extra space on the end! A crhome bug that jquery fixes if (use_selection){ let sel_text = full_src.substring(Editor.selection_start(), Editor.selection_end()) @@ -263,7 +267,7 @@ Editor.get_javascript = function(use_selection=false){ } else { return full_src } } - else if (Editor.view == "blocks"){ + else if (Editor.view == "Blocks"){ return Workspace.inst.get_javascript(use_selection) } else { shouldnt("Editor.get_javascript found invalid Editor.view of: " + Editor.view) } @@ -1308,7 +1312,7 @@ Editor.skip_forward_over_whitespace = function(full_src, cursor_pos){ return full_src.length } -//______literal stirngs ________ +//______literal strings ________ Editor.is_quote = function(char){ return (`"'` + "`").includes(char) } // pos of the quote or null diff --git a/eval.js b/eval.js index e8524446..ea5f8c9b 100644 --- a/eval.js +++ b/eval.js @@ -50,10 +50,17 @@ function fix_code_to_be_evaled(src){ } //part 1 of 3. +//Onlu called by eval_button_action //when this is called, there is no selection, so either we're evaling the whole editor buffer //or the whole cmd line. function eval_js_part1(step=false){ - let src = Editor.get_javascript("auto") //if no selection get whole buffer, else get just the selection + //tricky: when button is clicked, Editor.get_any_selection() doesn't work, + //I guess because the button itself is now in focus, + //so we grab the selection on mousedown of the the Eval button. + //then use that here if its not "", otherwise, Editor.get_javascript("auto"), getting the whol editor buffer + let src = ((selected_text_when_eval_button_clicked.length > 0) ? + selected_text_when_eval_button_clicked : + Editor.get_javascript("auto")) //we do NOT want to pass to eval part 2 a trimmed string as getting its char //offsets into the editor buffer correct is important. if (src.trim() == ""){ @@ -62,6 +69,11 @@ function eval_js_part1(step=false){ "in the Documentation pane for help.") } else{ + if (Editor.view == "DefEng") { + src = DE.de_to_js(src) + //out("" + src + "") //don't need this as JS is printed in Output pane after "Eval result of" + } + //must add "debugger" after converting DefEng to JS. eval_js_part2((step? "debugger; ": "") + src) } } @@ -202,7 +214,7 @@ function error_message_start_and_end_pos(err){ //that I can't parse, so just bail. } } - +//action for the Eval&Start button function eval_and_start(){ let sel_text = Editor.get_any_selection() if (sel_text.length == 0) { diff --git a/index.html b/index.html index 96307cdb..8c6568ff 100644 --- a/index.html +++ b/index.html @@ -169,6 +169,8 @@ + + diff --git a/job.js b/job.js index a6d4cac6..31eb29cb 100644 --- a/job.js +++ b/job.js @@ -263,7 +263,7 @@ var Job = class Job{ return this } } - //show_instruction in editor + //action for the Start Job button static start_job_menu_item_action () { var full_src = Editor.get_javascript() var start_cursor_pos = Editor.selection_start() diff --git a/package.json b/package.json index e3318eca..776d1fc0 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "dexter_dev_env", "productName": "dexter_dev_env", - "version": "2.5.12", - "release_date": "Nov 18, 2018", + "version": "2.5.13", + "release_date": "Nov 20, 2018", "description": "Dexter Development Environment", "author": "Fry", "license": "GPL-3.0", diff --git a/ready.js b/ready.js index 6aecfd19..5f62b223 100644 --- a/ready.js +++ b/ready.js @@ -18,17 +18,9 @@ } //called by both the eval button and the step button function eval_button_action(step=false){ //used by both clicking on the eval button and Cmd-e - //debugger - let sel_text = selected_text_when_eval_button_clicked //Editor.get_any_selection() //must do before Edotor>save because now mysteriously that clears the selection if((Editor.current_file_path != "new file") && (save_on_eval_id.checked)) { Editor.save_current_file() } - if (sel_text.length > 0) { eval_js_part2((step? "debugger; " : "") + sel_text) } - /*else if (eval_previousActiveElement == cmd_input_id) { //document.activeElement == cmd_input_id //fails because clicking on the Eval button changes the activeElement - sel_text = cmd_input_id.value - if (sel_text.length > 0) { eval_js_part2((step? "debugger; " : "") + sel_text) } - else { warning("Cursor is in command line but it is empty so no JS to eval.", true) } - }*/ - else { eval_js_part1(step) }//gets whole editor buffer and if empty, prints warning. - if (Editor.view == "blocks") { eval_id.blur() } //to get rid of the Eval button being "selected" when we're evaling in blocks view + eval_js_part1(step) + if (Editor.view == "Blocks") { eval_id.blur() } //to get rid of the Eval button being "selected" when we're evaling in blocks view } function on_ready() { diff --git a/robot.js b/robot.js index c9b8bfa1..99964260 100644 --- a/robot.js +++ b/robot.js @@ -2122,7 +2122,7 @@ null, // END_POSITION_FORCE_DELTA 23 "J2_A2D_COS", // END_COS 25 "J2_MEASURED_ANGLE", // PLAYBACK_END_POSITION 26 //depricated J2_PLAYBACK "J2_SENT", // SENT_END_POSITION 27 //unused -"J6_MEASURED_TORQUE", // SLOPE_END_POSITION 28 //depricated J2_SLOPE +"J7_MEASURED_TORQUE", // SLOPE_END_POSITION 28 //depricated J2_SLOPE null, // new field 29 //was J2_MEASURED_ANGLE, not used, get rid of, //J2 block of 10 "J3_ANGLE", // PIVOT_POSITION_AT 30 @@ -2144,7 +2144,7 @@ null, // ANGLE_POSITION_FORCE_DELTA 43 was "J4_FORCE_CALC_ANGL "J4_A2D_COS", // ANGLE_SIN 45 "J4_MEASURED_ANGLE", // PLAYBACK_ANGLE_POSITION 46 //depricated J4_PLAYBACK "J4_SENT", // SENT_ANGLE_POSITION 47 //unused -"J7_MEASURED_TORQUE", // SLOPE_ANGLE_POSITION 48 //depricated J4_SLOPE +"J6_MEASURED_TORQUE", // SLOPE_ANGLE_POSITION 48 //depricated J4_SLOPE null, // new field 49 //not used get rid of //J4 block of 10 "J5_ANGLE", // ROTATE_POSITION_AT 50 diff --git a/robot_status_dialog.js b/robot_status_dialog.js index 31a07657..365351d4 100644 --- a/robot_status_dialog.js +++ b/robot_status_dialog.js @@ -19,7 +19,7 @@ var RobotStatusDialog = class RobotStatusDialog{ " Updated: " + RobotStatusDialog.update_time_string() + "" + " ", - width: 860, + width: 890, height: 380 }) setTimeout(function(){ @@ -76,7 +76,7 @@ var RobotStatusDialog = class RobotStatusDialog{ let robot_status = robot.robot_status if (this.window_up()) { //don't attempt to show if the window isn't up. this does repopulate window if its merely shrunken robot_status_window_time_id.innerHTML = this.update_time_string() - for (let i = 0; i < robot_status.length; i++){ + for (let i = 0; i < 60; i++){ //don't use robot_status.length as there might not BE a robot_status if it hasn't been run yet let label = Dexter.robot_status_labels[i] if ((label != null) && !label.startsWith("UNUSED")){ let val = (robot_status ? robot_status[i] : "no status") //its possible that a robot will have been defined, but never actually run when this fn is called. @@ -87,15 +87,25 @@ var RobotStatusDialog = class RobotStatusDialog{ window[elt_name].innerHTML = val } } - START_TIME_id.title = date_integer_to_long_string(robot_status[Dexter.START_TIME]) - STOP_TIME_id.title = date_integer_to_long_string(robot_status[Dexter.STOP_TIME]) - INSTRUCTION_TYPE_id.title = Robot.instruction_type_to_function_name(robot_status[Dexter.INSTRUCTION_TYPE]) - let xyz - try { xyz = robot.joint_xyz() } //gets xyz array for joint 5 - catch(e) { xyz = ["no status", "no status", "no status"] } - MEASURED_X_id.innerHTML = this.format_measured_angle(xyz[0]) - MEASURED_Y_id.innerHTML = this.format_measured_angle(xyz[1]) - MEASURED_Z_id.innerHTML = this.format_measured_angle(xyz[2]) + if(robot_status){ + START_TIME_id.title = date_integer_to_long_string(robot_status[Dexter.START_TIME]) + STOP_TIME_id.title = date_integer_to_long_string(robot_status[Dexter.STOP_TIME]) + INSTRUCTION_TYPE_id.title = Robot.instruction_type_to_function_name(robot_status[Dexter.INSTRUCTION_TYPE]) + let xyz + try { xyz = robot.joint_xyz() } //gets xyz array for joint 5 + catch(e) { xyz = ["no status", "no status", "no status"] } + MEASURED_X_id.innerHTML = this.format_measured_angle(xyz[0]) + MEASURED_Y_id.innerHTML = this.format_measured_angle(xyz[1]) + MEASURED_Z_id.innerHTML = this.format_measured_angle(xyz[2]) + } + else { + START_TIME_id.title = "No jobs run on this robot yet." + STOP_TIME_id.title = "No jobs run on this robot yet." + INSTRUCTION_TYPE_id.title = "No jobs run on this robot yet." + MEASURED_X_id.innerHTML = "no status" + MEASURED_Y_id.innerHTML = "no status" + MEASURED_Z_id.innerHTML = "no status" + } } } @@ -104,7 +114,7 @@ var RobotStatusDialog = class RobotStatusDialog{ //when called from the UI, the "name" arg is bound to the event. if(typeof(name) != "string") {name = name.target.value} let robot = Robot[name] - this.update_robot_status_table(robot) + RobotStatusDialog.update_robot_status_table(robot) //can't use "this" for subject because "this" is the select widget } static make_html_table(robot){ @@ -206,7 +216,7 @@ var RobotStatusDialog = class RobotStatusDialog{ existing_job.stop_for_reason("interrupted", "user stopped job") } else { - let rob = selected_robot() + let rob = this.selected_robot() new Job({name: "rs_update", robot: rob, do_list: [ Robot.loop(true, Dexter.get_robot_status)]}).start() diff --git a/series.js b/series.js index 5a0e8423..9c1f0679 100644 --- a/series.js +++ b/series.js @@ -43,7 +43,7 @@ var Series = class Series { for (var ser of Series.instances){ let the_ser = ser; //must do this let so that each fn generated will use the ser of the for loop. var fn = function(){ - if(Editor.view == "text"){ + if(Editor.view == "JS"){ Editor.replace_selection(the_ser.get_menu_insertion_string(), the_ser.menu_sel_start, the_ser.menu_sel_end) diff --git a/socket.js b/socket.js index eb708dc7..16cf9cf1 100755 --- a/socket.js +++ b/socket.js @@ -84,10 +84,10 @@ var Socket = class Socket{ let index = Instruction.INSTRUCTION_ARG0 + i let arg_val = instruction_array_copy[index] let converted_val - if (i == 5) { //J6 and J7 + if (i == 5) { //J6 converted_val = 512 + Math.round(arg_val / Socket.DEGREES_PER_DYNAMIXEL_UNIT) //convert degrees to dynamixel units to get dynamixel integer from 0 through 1023 going from 0 to 296 degrees } - else if (i == 6) { + else if (i == 6) { //J7 converted_val = Math.round(arg_val / Socket.DEGREES_PER_DYNAMIXEL_UNIT) //convert degrees to dynamixel units to get dynamixel integer from 0 through 1023 going from 0 to 296 degrees } else { converted_val = Math.round(arg_val * 3600) } //still might be a NaN @@ -239,9 +239,9 @@ var Socket = class Socket{ let timeout_dur = Math.pow(10, Socket.resend_count) setTimeout(function(){ Socket.init(robot_name, //passed to send - simulate, //passed to send - rob.ip_address, //get from ws_inst ??? - rob.port //50000 //port + simulate, //passed to send + rob.ip_address, //get from ws_inst ??? + rob.port //50000 //port ) }, timeout_dur) return @@ -337,7 +337,7 @@ var Socket = class Socket{ robot_status[Dexter.J3_MEASURED_ANGLE] *= 0.0002777777777777778 robot_status[Dexter.J4_MEASURED_ANGLE] *= 0.0002777777777777778 robot_status[Dexter.J5_MEASURED_ANGLE] *= 0.0002777777777777778 - robot_status[Dexter.J6_MEASURED_ANGLE] *= Socket.DEGREES_PER_DYNAMIXEL_UNIT - 512 //0.0002777777777777778 + robot_status[Dexter.J6_MEASURED_ANGLE] = (robot_status[Dexter.J6_MEASURED_ANGLE] - 512) * Socket.DEGREES_PER_DYNAMIXEL_UNIT //0.0002777777777777778 robot_status[Dexter.J7_MEASURED_ANGLE] *= Socket.DEGREES_PER_DYNAMIXEL_UNIT //0.0002777777777777778 /* deprecated