From 7899eb12c4d16b35e71234e478616f524838b65a Mon Sep 17 00:00:00 2001 From: cfry Date: Sun, 19 May 2019 23:50:52 -0400 Subject: [PATCH] release --- core/index.js | 3 +- core/job.js | 2 +- core/robot.js | 14 +++++- core/socket.js | 3 +- core/storage.js | 11 ++++- core/units.js | 6 +-- doc/ref_man.html | 22 ++++----- doc/release_notes.html | 68 ++++++++++++++++++++++++++- editor.js | 22 ++++----- eslint-lint.js | 23 ++++----- index.html | 7 +-- js_info.js | 70 +++++++++++++++++++--------- low_level_dexter/calibrate_ui.js | 2 +- make_instruction/make_instruction.js | 51 ++++++++++++++++---- package.json | 5 +- ready.js | 3 +- robot_utilities.js | 4 +- series.js | 5 +- test_suite/file_system_testsuite.js | 16 +++++++ test_suite/test_suite.js | 1 + 20 files changed, 253 insertions(+), 85 deletions(-) create mode 100644 test_suite/file_system_testsuite.js diff --git a/core/index.js b/core/index.js index ab7ba684..481c36d1 100644 --- a/core/index.js +++ b/core/index.js @@ -39,7 +39,8 @@ function node_on_ready() { persistent_initialize() dde_init_dot_js_initialize() - Job.init() + Job.class_init() + Dexter.class_init() } function run_node_command(args){ diff --git a/core/job.js b/core/job.js index b709e246..8871b7f8 100644 --- a/core/job.js +++ b/core/job.js @@ -113,7 +113,7 @@ class Job{ } } //end constructor - static init(){ //inits the Job class as a whole. called by ready + static class_init(){ //inits the Job class as a whole. called by ready this.job_default_params = {name: null, robot: Robot.dexter0, do_list: [], keep_history: true, show_instructions: true, diff --git a/core/robot.js b/core/robot.js index 5ca5c7ce..2f3fdfd0 100644 --- a/core/robot.js +++ b/core/robot.js @@ -928,6 +928,18 @@ Dexter = class Dexter extends Robot { } } + static class_init(){ //inits Dexter class as a whole. called by ready + this.dexter_default_params = + {name: "dex1", + simulate: null, + ip_address: null, + port: null, + pose: Vector.identity_matrix(4), + enable_heartbeat: true, + instruction_callback: Job.prototype.set_up_next_do + } + } + toString(){ return "Dexter." + this.name } dexter_filepath(){ @@ -1247,7 +1259,7 @@ Dexter = class Dexter extends Robot { //let rfr_instance = Instruction.Dexter.read_file.find_read_file_instance_on_do_list(job_instance, ins_id) // job_instance.user_data[ins.destination] = null //usually means "file not found" //rfr_instance.is_done = true - this.perform_instruction_callback(job_instance) //calls set_up_next_do(1) but we want 0, becuase we want to give the Dexter.read_file instance code a chance to clean up before ending its loop + this.perform_instruction_callback(job_instance) //calls set_up_next_do(1) but we want 0, because we want to give the Dexter.read_file instance code a chance to clean up before ending its loop //job_instance.set_up_next_do(0) return } diff --git a/core/socket.js b/core/socket.js index cb192f8c..ab5745f7 100755 --- a/core/socket.js +++ b/core/socket.js @@ -418,7 +418,8 @@ var {Robot} = require("./robot.js") var {Instruction, make_ins} = require("./instruction.js") var DexterSim = require("./dextersim.js") var {out} = require("./out.js") -var {_nbits_cf, _arcsec, _um} = require("./units.js") +//var {_nbits_cf, _arcsec, _um} = require("./units.js") //don't do this. These units and all the rest are +//already global vars. diff --git a/core/storage.js b/core/storage.js index ea158f4e..20a57b89 100644 --- a/core/storage.js +++ b/core/storage.js @@ -93,6 +93,14 @@ function persistent_load(){ const start_of_content = content.indexOf("{") if (start_of_content != -1) { content = content.substring(start_of_content) } //get rid of comment at top of file persistent_values = JSON.parse(content) + //just in case files got saved out with backslashes, change to only slashes. + let files = persistent_values.files_menu_paths + let slashified_files = [] + for(let file of files){ + file = convert_backslashes_to_slashes(file) + slashified_files.push(file) + } + persistent_values.files_menu_paths = files } } @@ -317,7 +325,8 @@ module.exports.choose_file_and_get_content = choose_file_and_get_content function choose_save_file(show_dialog_options={}) { //todo document const dialog = app.dialog; //use {defaultPath: '~/foo.xml'} to set default file name - return dialog.showSaveDialog(app.getCurrentWindow(), show_dialog_options) + let result = dialog.showSaveDialog(app.getCurrentWindow(), show_dialog_options) + return convert_backslashes_to_slashes(result) } module.exports.choose_save_file = choose_save_file diff --git a/core/units.js b/core/units.js index e2902f03..1a47e4c3 100644 --- a/core/units.js +++ b/core/units.js @@ -159,9 +159,9 @@ function init_units(){ //don't put _nbits_cf into a series. Not for use by users. //it is used for converting S params: MaxSpeec StartSpeed, Accelleration //before sending this to Dexter hardware. - module.exports._nbits_cf = _nbits_cf - module.exports._arcsec = _arcsec - module.exports._um = _um + // module.exports._nbits_cf = _nbits_cf + // module.exports._arcsec = _arcsec + // module.exports._um = _um if(window.platform == "dde") { for(let series_name_core in units_data) { let ser = units_to_series(series_name_core, units_data[series_name_core]) diff --git a/doc/ref_man.html b/doc/ref_man.html index 2a80e4ed..56679498 100644 --- a/doc/ref_man.html +++ b/doc/ref_man.html @@ -4664,10 +4664,10 @@
new Dexter parameters The parameters used to define an instance of Dexter are: Example: @@ -5028,7 +5028,7 @@ J5_direction, then the config and workspace_pose arguments are ignored.

- config For most points within the reachability of Dexter, there are multiple + config Default: Dexter.RIGHT_UP_OUT For most points within the reachability of Dexter, there are multiple ways in which Dexter can get there. config helps you specify your preference as to how Dexter configures its joints to get to the indicated x, y, z. There are 3 independent boolean values to determining this configuration. @@ -5093,7 +5093,7 @@ defaults to the containing Job's default_workspace_pose which itself defaults to Coor.Table . - Determines the "offset" of the xyz arg. + Determines the "offset" of the xyz arg.
j6_angle Default: [0] The angle to move Joint 6 to. Wrapping it in an array makes the movement relative. The default of [0] causes Joint 6 not to move.
@@ -5150,16 +5150,16 @@ move to. Same as move_to.
J5_direction The ending direction that LINK5 will be pointing when the move is complete. Same as move_to.
-config The configuration of the joints at the end of the move. +config Default: Dexter.RIGHT_UP_OUT The configuration of the joints at the end of the move. Same as move_to.
tool_speed The maximum speed that Dexter's end effector will move. Default: 5 millimeters per second. Not in move_to.
resolution How short to make the straight lines that connect the starting xyz to the ending xyz. Default: 0.5 millimeters.
j6_angle Default [0] The degrees move move Joint 6 to. -If it is wrapped in an array, move relative by that amount. +If it is wrapped in an array, move relative by that amount.
j7_angle Default [0] The degrees move move Joint 7 to. - If it is wrapped in an array, move relative by that amount. + If it is wrapped in an array, move relative by that amount.
single_instruction Default: false False means generate many instructions within DDE to send to Dexter to cause it to move in a straight line. diff --git a/doc/release_notes.html b/doc/release_notes.html index 83f6b7d7..9a29c212 100644 --- a/doc/release_notes.html +++ b/doc/release_notes.html @@ -6,6 +6,72 @@ .doc_details summary { font-weight: 600; } +
v 3.3.6, May 19, 2019 +Highlights: Fixed bugs in: Linter/Editor, saving files, and + Dexter.set_parameter sending "NaN"s to Dexter.
+ Help for Dexter.set_parameter and Dexter.move_to improved. +
    +
  • Fixed numerous problems with the linter, including + cases where it was: +
    • causing an error in the Editor
    • +
    • warning about removed older options
    • +
    • some non-helpful warnings
    • +
    +
  • +
  • Fixed bug in Dexter.set_parameter that sent "NaN" instead of a number, + for the params of:
    + "MaxSpeed", + "StartSpeed", + "Acceleration"
    + This also fixed the setting of ultra-low speeds inadvertently. +
  • + +
  • Renamed Job.init to Job.class_init to make it less ambiguous. + Also consistent with the new Dexter.class_init
  • + +
  • new Dexter params click help improved with links for each param, + just like was recently done for new Job.
  • + + +
  • MakeInstruction insert for new Dexter, and new Job always prints out the name property.
  • + +
  • MakeInstruction insert for new Job, always prints out the do_list property, even if its the default.
  • + +
  • MakeInstruction for Dexter.set_parameter dialog, + has a menu of all the parameter names.
  • + +
  • Ping dialog box now selects by default, Dexter0 in the select widget + at the bottom of the dialog automatically.
  • + +
  • Ref Man/Robot/Dexter/Dexter Instruction for + Dexter.move_to and + Dexter.move_to_straight : + formatting improved.
  • + +
  • persistent_load improved to convert backslashed file paths to slashed file paths. + Related: choose_save_file now converts any backslashes to slashes. + These fix a bug with the Edit menu/Save as ... menu item.
  • + +
  • Dexter.move_to instruction, + config param values of Dexter.RIGHT_UP_OUT and friends: + when you click on them in the editor, the doc pane scrolls to + Ref Man/Robot/Dexter/Dexter Instructions/move_to
  • + +
  • Dexter.move_to, Dexter.move_to_straight Dexter.pid_move_to + instructions, config param now has a combo box for the 18 possible + named values ( Dexter.RIGHT_UP_OUT and friends) as well as a type-in for + explicit values like [1, 1, 1]
  • + +
  • Dexter.move_to instruction now has the default for its config param + documented as: Dexter.RIGHT_UP_OUT
  • + + +
  • New testsuite file named "file_system_testsuite.js" + minimally tests Dexter.write_file and Dexter.read_file +
  • +
+
+
v 3.3.5, May 8, 2019 Highlights: Bug fixes for Job Engine, etc.
    @@ -25,7 +91,7 @@
  • Globals bound: Dexter, Job, Robot, Vector, Kin

- +
  • If you have dde new buffer in the editor and it is empty, then when you choose open (to get an exiting file) you now don't DON'T get a up dialog asking to delete the new buffer, diff --git a/editor.js b/editor.js index 154780a5..e7c7b853 100644 --- a/editor.js +++ b/editor.js @@ -79,12 +79,14 @@ Editor.init_editor = function(){ myCodeMirror.on("mousedown", function(cm, mouse_event){ - if(mouse_event.altKey) { + if(mouse_event.altKey){ var line_char = myCodeMirror.coordsChar({left: mouse_event.x, top: mouse_event.y}) myCodeMirror.getDoc().setCursor(line_char) if (Editor.select_expr()){ - let sel = Editor.get_any_selection() - if(sel != "") { MakeInstruction.show(sel) } + setTimeout(function(){ //without setTimeout, the sel isn't really selected by the tme we call MakeInstruction.show + let sel = Editor.get_any_selection() + if(sel != "") { MakeInstruction.show(sel) } + }, 200) mouse_event.preventDefault() } } @@ -108,10 +110,10 @@ Editor.undo = function(){ myCodeMirror.getDoc().undo() } //returns null if path is not in menu. path expected to be a full path, //even the menu has partial paths. Editor.index_of_path_in_file_menu = function(path){ - let inner_path = Editor.path_to_files_menu_path(path) - for(let i in file_name_id.children){ + let files_menu_path = Editor.path_to_files_menu_path(path) + for(let i = 0; i < file_name_id.children.length; i++){ let a_path = file_name_id.children[i].innerHTML - if (a_path == inner_path) { return parseInt(i) } + if (a_path == files_menu_path) { return i } } return null } @@ -162,7 +164,7 @@ Editor.make_files_menu_path = function(folder, name) { // The returned folder always ends with slash or colon. Editor.path_to_folder_and_name = function(path){ let file_name_start_index = path.lastIndexOf("/") - if(file_name_start_index == -1) { file_name_start_index = path.lastIndexOf(":") } //happens with dexter0:foo.js + if(file_name_start_index == -1) { file_name_start_index = path.lastIndexOf(":") } //happens with dexter0:foo.js and C:foo.js if(file_name_start_index == -1) { //happens with "foo.js" return[dde_apps_folder + "/", path] } @@ -203,7 +205,6 @@ Editor.files_menu_path_to_path = function(menu_path){ Editor.add_path_to_files_menu = function(path){ let existing_index = Editor.index_of_path_in_file_menu(path) - let new_index = 0 if (existing_index === null) { var opt = document.createElement("OPTION") let inner_path = Editor.path_to_files_menu_path(path) @@ -215,7 +216,7 @@ Editor.add_path_to_files_menu = function(path){ else{ file_name_id.add(opt) } - file_name_id.selectedIndex = new_index + file_name_id.selectedIndex = 0 if(path != "new buffer"){ let paths = persistent_get("files_menu_paths") paths.unshift(path) @@ -224,8 +225,7 @@ Editor.add_path_to_files_menu = function(path){ } } else { - new_index = existing_index - file_name_id.selectedIndex = new_index + file_name_id.selectedIndex = existing_index } } diff --git a/eslint-lint.js b/eslint-lint.js index 383cd8e9..7ddbac07 100755 --- a/eslint-lint.js +++ b/eslint-lint.js @@ -105,7 +105,7 @@ "no-bitwise": 0, "no-caller": 2, "no-catch-shadow": 2, - "no-comma-dangle": 2, + //"no-comma-dangle": 2, //cfry replaced by undocumented "comma-dangle" "no-cond-assign": 2, "no-console": 0, //cfry default is 2, but that causes warnings when using it. "no-constant-condition": 2, @@ -115,21 +115,22 @@ "no-div-regex": 0, "no-dupe-keys": 2, "no-else-return": 0, - "no-empty": 2, - "no-empty-class": 2, - "no-empty-label": 2, + "no-empty": 0, //cfry default is 2, but that disallows empty for, if ,etc statements. + //"no-empty-class": 2, //replaced by no-empty-character-class + //"no-empty-label": 2, //cfry replaced by undocumnted "no-labels" "no-eq-null": 0, - "no-eval": 2, + "no-eval": 0, //cfry default is 2, but we want to allow eval calls. "no-ex-assign": 2, "no-extend-native": 2, "no-extra-bind": 2, "no-extra-boolean-cast": 2, "no-extra-parens": 0, - "no-extra-semi": 2, - "no-extra-strict": 2, + "no-extra-semi": 0, //cfry default is 2, but causes bad linter bug when you have a fn def that ends with its normal close curley brace followed by a semicolon. + //"no-extra-strict": 2, //replaced by "strict" "no-fallthrough": 2, "no-floating-decimal": 0, "no-func-assign": 2, + "no-global-assign": 0, //cfry default is 2 but that causes lots of wrong errors. "no-implied-eval": 2, "no-inline-comments": 0, "no-inner-declarations": [2, "functions"], @@ -174,7 +175,7 @@ "no-sequences": 2, "no-shadow": 2, "no-shadow-restricted-names": 2, - "no-space-before-semi": 2, + //"no-space-before-semi": 2, //replaced by undocumented semi-spacing "no-spaced-func": 2, "no-sparse-arrays": 2, "no-sync": 0, @@ -192,7 +193,7 @@ "no-var": 0, "no-warning-comments": [0, { "terms": ["todo", "fixme", "xxx"], "location": "start" }], "no-with": 2, - "no-wrap-func": 2, + //"no-wrap-func": 2, //replaced by no-extra-parens "block-scoped-var": 0, "brace-style": [0, "1tbs"], "camelcase": 0, //cfry default of 2 requires fn names to be camel cased. yuck @@ -209,7 +210,7 @@ "func-names": 0, "func-style": [0, "declaration"], "generator-star": 0, - "global-strict": [2, "never"], + // "global-strict": [2, "never"], old rule, replaced by "strict", see below "guard-for-in": 0, "handle-callback-err": 0, "key-spacing": [2, { "beforeColon": false, "afterColon": true }], @@ -234,7 +235,7 @@ "space-in-brackets": [0, "never"], "space-in-parens": [0, "never"], "space-infix-ops": 2, - "space-return-throw-case": 2, + // "space-return-throw-case": 2, no longer a rule. It was replaced by "keyword-spacing" which is fundanemtally undocumented "space-unary-ops": [2, { "words": true, "nonwords": false }], "spaced-line-comment": [0, "always"], "strict": 0, //default 2, cfry changed to 0 because if I have "forOf": true as above to not warn on forOf, then if strict: 2, every line in programis underlined in red. diff --git a/index.html b/index.html index 5cf35dcf..ced639be 100644 --- a/index.html +++ b/index.html @@ -22,11 +22,8 @@ - + - - - @@ -35,7 +32,7 @@ - + diff --git a/js_info.js b/js_info.js index 7510b1aa..e70f0cb1 100644 --- a/js_info.js +++ b/js_info.js @@ -48,7 +48,48 @@ Js_info = class Js_info { if (series) { return Js_info.add_series_wrapper_to_info(series, new_info) } else { return new_info } } - if(series){ + if (fn_name == "Job"){ + let val = value_of_path(fn_name) + //return "new " + Js_info.wrap_fn_name(fn_name) + + // function_params_for_keyword_call(val) + let result = "new " + Js_info.wrap_fn_name(fn_name) + "({" + let arg_index = 0 + for(let key in Job.job_default_params) { + let val = Job.job_default_params[key] + let src + if(key == "default_workspace_pose") { src = "null" } + else { src = to_source_code({value: val, function_names: true, newObject_paths: true}) } + let key_html = '' + key + '' + result += key_html + ": " + src + ((key == "callback_param") ? "" : ",  ") + if(((arg_index % 3) == 0) && (arg_index !== 0)) { + result += "
    " + } + arg_index += 1 + } + result += "})" + return result + } + else if (fn_name == "Dexter"){ + let val = value_of_path(fn_name) + let result = "new " + Js_info.wrap_fn_name(fn_name) + "({" + let arg_index = 0 + for(let key in Dexter.dexter_default_params) { + if(key != "instruction_callback") { //don't document this + let val = Dexter.dexter_default_params[key] + let src + src = ((key == "instruction_callback") ? "Job.prototype.set_up_next_do" : to_source_code({value: val, function_names: true, newObject_paths: true})) + let key_html = '' + key + '' + result += key_html + ": " + src + ",  " + if(((arg_index % 3) == 0) && (arg_index !== 0)) { + result += "
    " + } + arg_index += 1 + } + } + result += "})" + return result + } + else if(series){ let obj_to_inspect = this.object_to_inspect_maybe(fn_name, series) if(typeof(obj_to_inspect) == "string"){ if(file_exists(obj_to_inspect)) { @@ -80,7 +121,7 @@ Js_info = class Js_info { } } //put after series because some series items ie Object.foo have dots in them. - if (fn_name.startsWith("[")) { + else if (fn_name.startsWith("[")) { if (fn_name.includes(",")){ return "" + fn_name + " is an " + Js_info.make_atag("array_literal", "array_literal") } @@ -158,27 +199,7 @@ Js_info = class Js_info { else if (is_whitespace(fn_name)){ return "whitespace (contiguous spaces, tabs, newlines) separates code fragments." } - else if (fn_name == "Job"){ - let val = value_of_path(fn_name) - //return "new " + Js_info.wrap_fn_name(fn_name) + - // function_params_for_keyword_call(val) - let result = "new " + Js_info.wrap_fn_name(fn_name) + "({" - let arg_index = 0 - for(let key in Job.job_default_params) { - let val = Job.job_default_params[key] - let src - if(key == "default_workspace_pose") { src = "null" } - else { src = to_source_code({value: val, function_names: true, newObject_paths: true}) } - let key_html = '' + key + '' - result += key_html + ": " + src + ((key == "callback_param") ? "" : ",  ") - if(((arg_index % 3) == 0) && (arg_index !== 0)) { - result += "
    " - } - arg_index += 1 - } - result += "})" - return result - } + else if (fn_name == "start"){ let val = Job.prototype.start return "new " + Js_info.wrap_fn_name(fn_name) + //"" + @@ -511,6 +532,9 @@ Js_info = class Js_info { case "series_css_property_id": return "" + fn_name + "" + case "series_robot_config_id": + open_doc("Dexter.move_to.config_doc_id") + return false //actual click help handled later on } if (["series_hours_minutes_seconds_id", "series_time_id", "series_3_letter_month_id", "series_full_month_id", "series_date_id"].indexOf(series.id) != -1){ diff --git a/low_level_dexter/calibrate_ui.js b/low_level_dexter/calibrate_ui.js index a6293b66..cc6d61f6 100644 --- a/low_level_dexter/calibrate_ui.js +++ b/low_level_dexter/calibrate_ui.js @@ -487,7 +487,7 @@ function init_calibrate(){ let sim_actual = Robot.get_simulate_actual(robot_sim) if(sim_actual === true){ //show_window({content: "Don't Sim"}) - open_doc(simulate_doc_id) + open_doc(dexter_param_simulate_doc_id) confirm("Warning: Simulate is set to true so calibration window will not work. \nTo set to false, choose Jobs menu/Simulate/false.") } else if (Dexter.all_names.length == 1) { cal_init_robot() } //Fry added Oct 19, 2018 diff --git a/make_instruction/make_instruction.js b/make_instruction/make_instruction.js index 79f5dbf9..af958f8a 100644 --- a/make_instruction/make_instruction.js +++ b/make_instruction/make_instruction.js @@ -446,7 +446,7 @@ var MakeInstruction = class MakeInstruction{ let arg_name = "joint" + j let arg_val_src = call_obj.args_obj[arg_name] if(arg_val_src === undefined) { arg_val_src = "0" } - args_html += this.make_arg_html(arg_name, arg_val_src) + args_html += this.make_arg_html(instruction_name, arg_name, arg_val_src) } } else { //handles the 1 arg case of move_all_joints and most other instructions @@ -457,21 +457,21 @@ var MakeInstruction = class MakeInstruction{ for(let arg_name of ["x", "y", "z"]){ let arg_val_src = call_obj.args_obj[arg_name] if(arg_val_src === undefined) { arg_val_src = "0" } - args_html += this.make_arg_html(arg_name, arg_val_src) + args_html += this.make_arg_html(instruction_name, arg_name, arg_val_src) } } //handles most args else { let arg_val_src = call_obj.args_obj[arg_name] if(arg_val_src === undefined) { arg_val_src = "" } - args_html += this.make_arg_html(arg_name, arg_val_src) + args_html += this.make_arg_html(instruction_name, arg_name, arg_val_src) } } } mi_args_id.innerHTML = args_html } - static make_arg_html(arg_name, arg_val_src){ + static make_arg_html(instruction_name, arg_name, arg_val_src){ let id = this.arg_name_to_dom_elt_id(arg_name) if(arg_name.startsWith("...") || ["do_list", "body"].includes(arg_name) || @@ -485,6 +485,39 @@ var MakeInstruction = class MakeInstruction{ "" return result } + else if((instruction_name == "Dexter.set_parameter") && + arg_name == "name"){ + let result = "
    " + arg_name + ":
    " + return result + } + else if(["Dexter.move_to", "Dexter.move_to_straight", "Dexter.pid_move_to"].includes(instruction_name) && + (arg_name == "config")){ //got a combobox + let array_of_possible_values = Series.id_to_series("series_robot_config_id").array + let sel_index = array_of_possible_values.indexOf(arg_val_src) ////might return -1 but that's ok, will just be blank type in + let the_arg_val_src = arg_val_src + out("arg_val_src: " + arg_val_src + " sel_index: " + sel_index) + setTimeout(function() { + $(window[id]).jqxComboBox({ source: array_of_possible_values, + width: '210px', + height: '16px', + selectedIndex: sel_index}) //default Dexter.RIGHT_UP_OUT + if(sel_index == -1){ + $(window[id]).jqxComboBox("val", the_arg_val_src) + } + }, + 200) + return "
    " + arg_name + ":
    " + } else { return "
    " + arg_name + ":
    " } @@ -694,7 +727,7 @@ var MakeInstruction = class MakeInstruction{ let call_obj = MiIns.make_from_instruction_name_no_args(instruction_name) /*let param_names = this.param_names_from_ui(instruction_name) for(let param_name of param_names){ //fails when we call this method from after instructio_name\ - //is channged in the UI, but before the args are set as we need to when grabbing prev values + //is changed in the UI, but before the args are set as we need to when grabbing prev values let id = this.arg_name_to_dom_elt_id(param_name) let elt = window[id] let arg_val_src = elt.value //.trim() //bad, esp for textareas and preserivng initial whitespace on rest args @@ -704,6 +737,9 @@ var MakeInstruction = class MakeInstruction{ for(let elt of mi_args_id.getElementsByClassName('mi_arg_val_src')){ let arg_name = this.dom_elt_id_to_arg_name(elt.id) let arg_val_src = elt.value //.trim() //bad, esp for textareas and preserivng initial whitespace on rest args + if((arg_val_src === undefined) && (arg_name == "config")){ //might be a jqxcombobox + arg_val_src = $(elt).val() + } call_obj.args_obj[arg_name] = arg_val_src } return call_obj @@ -796,7 +832,7 @@ var MakeInstruction = class MakeInstruction{ } else if(arg_val_src == arg_default_val_src) { arg_val_is_default = true } else if(arg_val_src == "undefined") { arg_val_is_default = true } - + if(["name", "do_list"].includes(param_name)) { arg_val_is_default = false } //we always want to print out these let did_insert_arg = true let mt_separate_xyzs = this.dialog_contains_move_to_with_separate_xyzs() if (mt_separate_xyzs && (param_name == "x")) { @@ -1454,8 +1490,7 @@ MakeInstruction.menu_hierarchy = [ ["Serial", "string_instruction"], ["Misc" , "function", "function*", //"null", don't have null on menu. its a valid instruction but does nothing, hard to support, and you wouldn't explicitly put one in a job's do_list - "new Array", "new Job", "new Note", "new Phrase", "new TestSuite", - "new Dexter", "new Serial" + "new Array", "new Dexter", "new Job", "new Note", "new Phrase", "new Serial", "new TestSuite" ] ] diff --git a/package.json b/package.json index c63ad5f0..dc85f198 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "dexter_dev_env", "productName": "dexter_dev_env", - "version": "3.3.5", - "release_date": "May 8, 2019", + "version": "3.3.6", + "release_date": "May 19, 2019", "description": "Dexter Development Environment", "author": "Fry", "license": "GPL-3.0", @@ -31,6 +31,7 @@ "jpeg-js": "^0.3.3", "jquery": "^3.4.0", "mathjs": "^5.3.1", + "nodejs-physijs": "^0.1.5", "nouislider": "^13.1.1", "npm": "^6.9.0", "opencv.js": "^1.2.1", diff --git a/ready.js b/ready.js index f20db70b..5e8ffbcf 100644 --- a/ready.js +++ b/ready.js @@ -84,7 +84,8 @@ return result } - Job.init() + Job.class_init() + Dexter.class_init() setTimeout(function(){ window.document.title = "Dexter Development Environment " + dde_version dde_version_id.innerHTML = dde_version diff --git a/robot_utilities.js b/robot_utilities.js index 3d01d5bc..1ed5b0b0 100644 --- a/robot_utilities.js +++ b/robot_utilities.js @@ -32,6 +32,7 @@ function make_ping_a_dexter_select(){ let net_addresses = new Set([]) //each item will look like "123.456.78." WE don't want dplicates on the list, //each one will become an item on the combo box menu to select. let wildcard_base_addresses = [] + let select_html = ' selected="selected" ' //select the first one of the names with an ip address for(let a_dex_name of Dexter.all_names){ let a_dex = Dexter[a_dex_name] let ip_address = a_dex.ip_address @@ -48,7 +49,8 @@ function make_ping_a_dexter_select(){ wildcard_base_addresses.push(new_wildcard_maybe) } let label = a_dex_name + ": " + ip_address - result += " " + result += " " + select_html = "" } } result += "
    " diff --git a/series.js b/series.js index d88aee05..90d05687 100644 --- a/series.js +++ b/series.js @@ -846,10 +846,11 @@ Series.instances = [ menu_insertion_string:"Dexter.LINK1", menu_sel_start:true, menu_sel_end:null, sample:"Dexter.LINK1"}), new Series({id:"series_set_parameter_name_id", - array: ["J1Force","J2Force","J3Force", "J4Force","J5Force", + array: ["Acceleration", "EERoll","EESpan", "GripperMotor", + "J1Force","J2Force","J3Force", "J4Force","J5Force", "J1Friction","J2Friction","J3Friction","J4Friction","J5Friction", "J1BoundryHigh","J1BoundryLow","J2BoundryHigh","J2BoundryLow","J3BoundryHigh","J3BoundryLow","J4BoundryHigh","J4BoundryLow","J5BoundryHigh","J5BoundryLow", - "Acceleration", "EERoll","EESpan", "GripperMotor", "MaxSpeed","StartSpeed"], + "MaxSpeed","StartSpeed"], menu_insertion_string:"J1Force", menu_sel_start:true, menu_sel_end:null, sample:"J1Force" }), new Series({id:"series_robot_status_label_id", array: function(){ return Dexter.robot_status_index_labels}, diff --git a/test_suite/file_system_testsuite.js b/test_suite/file_system_testsuite.js new file mode 100644 index 00000000..4c24eb74 --- /dev/null +++ b/test_suite/file_system_testsuite.js @@ -0,0 +1,16 @@ + +new TestSuite("file_system", + [`new Job({name: "file_sys_test", + do_list: [Dexter.write_file("file_sys_test.txt", "file_sys_test content1"), + Dexter.read_file("file_sys_test.txt", "ud_var_file_test") + ] + } + )`], + ['Job.file_sys_test.user_data.ud_var_file_test', '"file_sys_test content1"'], + [`new Job({name: "file_sys_test", + do_list: [Dexter.write_file("file_sys_test.txt", "file_sys_test obsolete content") + ] + } + )`] + ) + \ No newline at end of file diff --git a/test_suite/test_suite.js b/test_suite/test_suite.js index 847ec7c4..101c9bb8 100644 --- a/test_suite/test_suite.js +++ b/test_suite/test_suite.js @@ -251,6 +251,7 @@ var TestSuite = class TestSuite{ load_files(__dirname + "/music/phrase_testsuite.js") load_files(__dirname + "/test_suite/picture_testsuite.js") load_files(__dirname + "/test_suite/make_html_testsuite.js") + load_files(__dirname + "/test_suite/file_system_testsuite.js") if (!TestSuite["user_guide_id"]) { TestSuite.make_test_suites_from_doc(user_guide_id) } if (!TestSuite["reference_manual_id"]) { TestSuite.make_test_suites_from_doc(reference_manual_id) } let report_prefix = 'All Test Suites Report
    ' +