Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
cfry committed May 20, 2019
1 parent 5ef633d commit 7899eb1
Show file tree
Hide file tree
Showing 20 changed files with 253 additions and 85 deletions.
3 changes: 2 additions & 1 deletion core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
2 changes: 1 addition & 1 deletion core/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 13 additions & 1 deletion core/robot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down Expand Up @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion core/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.



Expand Down
11 changes: 10 additions & 1 deletion core/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions core/units.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
22 changes: 11 additions & 11 deletions doc/ref_man.html
Original file line number Diff line number Diff line change
Expand Up @@ -4664,10 +4664,10 @@
<details id="new_dexter_parameters_doc_id" class="doc_details"><summary>new Dexter parameters</summary>
The parameters used to define an instance of Dexter are:
<ul>
<li><b>name</b> Any string, but must be unique across all robots.
<li id="dexter_param_name_doc_id"><b>name</b> Any string, but must be unique across all robots.
The instance of the robot is stored in
<code title="unEVALable code fragment"> Robot.the_name</code></li>
<li id="simulate_doc_id"><b>simulate</b> Possible values:
<li id="dexter_param_simulate_doc_id"><b>simulate</b> Possible values:
<ul>
<li><b>true</b> Instructions will not be sent to the Dexter robot but rather
to DDE's Dexter simulator, showing an image of Dexter in DDE's "Sim" pane.</li>
Expand All @@ -4681,14 +4681,14 @@
will be persistent accross DDE launches.</li>
</ul>
</li>
<li><b>ip_address</b> A string of an ip_address such as: <code>"192.168.1.1"</code>
<li id="dexter_param_ip_address_doc_id"><b>ip_address</b> A string of an ip_address such as: <code>"192.168.1.1"</code>
Default null. You can use a Dexter without an ip_address, but only with
<code title="unEVALable code fragment"> simulate: true</code></li>
<li><b>port</b> An integer. Default 50000. </li>
<li><b>pose</b> Indicates the position and orientation of a Dexter as a
<li id="dexter_param_port_doc_id"><b>port</b> An integer. Default 50000. </li>
<li id="dexter_param_pose_doc_id"><b>pose</b> Indicates the position and orientation of a Dexter as a
4 x 4 matrix of numbers.
</li>
<li><b>enable_heartbeat</b> A Dexter instance sends a "heartbeat" to a Dexter robot to
<li id="dexter_param_enable_heartbeat_doc_id"><b>enable_heartbeat</b> A Dexter instance sends a "heartbeat" to a Dexter robot to
keep the connection alive. If true, the default, that heartbeat will be sent.</li>
</ul>
<i>Example:</i>
Expand Down Expand Up @@ -5028,7 +5028,7 @@
J5_direction, then the config and workspace_pose arguments
are ignored.
<p></p>
<b>config</b> For most points within the reachability of Dexter, there are multiple
<b id="Dexter.move_to.config_doc_id">config</b> Default: <code>Dexter.RIGHT_UP_OUT</code> 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 <i>how</i> Dexter configures its joints to get to the indicated x, y, z.
There are 3 independent boolean values to determining this configuration.
Expand Down Expand Up @@ -5093,7 +5093,7 @@
defaults to the containing Job's
<a href="#" onclick="open_doc('job_param_default_workspace_pose_doc_id', event)">default_workspace_pose</a>
which itself defaults to <code>Coor.Table</code> .
Determines the "offset" of the xyz arg.
Determines the "offset" of the xyz arg.<br/>
<b>j6_angle</b> Default: <code>[0]</code> The angle to move Joint 6 to.
Wrapping it in an array makes the movement relative.
The default of <code>[0]</code> causes Joint 6 not to move.<br/>
Expand Down Expand Up @@ -5150,16 +5150,16 @@
move to. Same as move_to.<br/>
<b>J5_direction</b> The ending direction that LINK5 will be pointing when
the move is complete. Same as move_to.<br/>
<b>config</b> The configuration of the joints at the end of the move.
<b>config</b> Default: <code>Dexter.RIGHT_UP_OUT</code> The configuration of the joints at the end of the move.
Same as move_to.<br/>
<b>tool_speed</b> The maximum speed that Dexter's end effector will move.
Default: 5 millimeters per second. Not in move_to.<br/>
<b>resolution</b> How short to make the straight lines that connect the
starting xyz to the ending xyz. Default: 0.5 millimeters.<br/>
<b>j6_angle</b> Default <code>[0]</code> 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.<br/>
<b>j7_angle</b> Default <code>[0]</code> 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.<br/>
<b>single_instruction</b> Default: <code>false</code> False means generate
many instructions within DDE to send to Dexter to cause it to
move in a straight line.
Expand Down
68 changes: 67 additions & 1 deletion doc/release_notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,72 @@
.doc_details summary { font-weight: 600; }
</style>

<details class="doc_details"><summary>v 3.3.6, May 19, 2019</summary>
Highlights: Fixed bugs in: Linter/Editor, saving files, and
Dexter.set_parameter sending "NaN"s to Dexter.<br/>
Help for Dexter.set_parameter and Dexter.move_to improved.
<ul>
<li>Fixed numerous problems with the linter, including
cases where it was:
<ul><li>causing an error in the Editor</li>
<li>warning about removed older options</li>
<li>some non-helpful warnings</li>
</ul>
</li>
<li> Fixed bug in <code>Dexter.set_parameter</code> that sent "NaN" instead of a number,
for the params of:<br/>
<code>"MaxSpeed"</code>,
<code>"StartSpeed"</code>,
<code>"Acceleration"</code><br/>
This also fixed the setting of ultra-low speeds inadvertently.
</li>

<li> Renamed Job.init to Job.class_init to make it less ambiguous.
Also consistent with the new Dexter.class_init</li>

<li> <code>new Dexter</code> params click help improved with links for each param,
just like was recently done for new Job.</li>


<li> MakeInstruction insert for new Dexter, and new Job always prints out the name property.</li>

<li> MakeInstruction insert for new Job, always prints out the do_list property, even if its the default.</li>

<li> MakeInstruction for <code>Dexter.set_parameter</code> dialog,
has a menu of all the parameter names.</li>

<li> Ping dialog box now selects by default, Dexter0 in the select widget
at the bottom of the dialog automatically.</li>

<li> Ref Man/Robot/Dexter/Dexter Instruction for
<code>Dexter.move_to</code> and
<code>Dexter.move_to_straight</code> :
formatting improved.</li>

<li> <code>persistent_load</code> improved to convert backslashed file paths to slashed file paths.
Related: <code>choose_save_file</code> now converts any backslashes to slashes.
These fix a bug with the Edit menu/Save as ... menu item.</li>

<li> <code>Dexter.move_to</code> instruction,
config param values of <code>Dexter.RIGHT_UP_OUT</code> and friends:
when you click on them in the editor, the doc pane scrolls to
Ref Man/Robot/Dexter/Dexter Instructions/move_to</li>

<li> <code>Dexter.move_to</code>, <code>Dexter.move_to_straight</code> <code>Dexter.pid_move_to</code>
instructions, <i>config</i> param now has a combo box for the 18 possible
named values ( <code>Dexter.RIGHT_UP_OUT</code> and friends) as well as a type-in for
explicit values like <code>[1, 1, 1]</code></li>

<li> Dexter.move_to instruction now has the default for its config param
documented as: <code>Dexter.RIGHT_UP_OUT</code></li>


<li> New testsuite file named "file_system_testsuite.js"
minimally tests <code>Dexter.write_file</code> and <code>Dexter.read_file</code>
</li>
</ul>
</details>

<details class="doc_details"><summary>v 3.3.5, May 8, 2019</summary>
Highlights: Bug fixes for Job Engine, etc.
<ul>
Expand All @@ -25,7 +91,7 @@
<li>Globals bound: Dexter, Job, Robot, Vector, Kin
 </li>
</ul>
</li>

<li> 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,
Expand Down
22 changes: 11 additions & 11 deletions editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand All @@ -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
}
Expand Down Expand Up @@ -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]
}
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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
}
}

Expand Down
23 changes: 12 additions & 11 deletions eslint-lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"],
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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 }],
Expand All @@ -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.
Expand Down
Loading

0 comments on commit 7899eb1

Please sign in to comment.