Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
cfry committed Jul 7, 2017
1 parent 9326ad8 commit 5e071ac
Show file tree
Hide file tree
Showing 18 changed files with 935 additions and 622 deletions.
14 changes: 11 additions & 3 deletions dextersim.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,10 @@ DexterSim = class DexterSim{
break;
default:
if (Dexter.instruction_type_to_function_name_map[oplet]){
out("Warning: Dextersim.send doesn't know what to do with the legal oplet: " + oplet, "red")
warning("Dextersim.send doesn't know what to do with the legal oplet: " + oplet)
}
else {
out("Error: DexterSim.send received an instruction array with an illegal oplet: " + instruction_array, "red")
warning("DexterSim.send received an instruction array with an illegal oplet: " + instruction_array)
}
}
//if (oplet != "h"){ //never put -1 in instruction_id of robot status except before first instruction is run.
Expand All @@ -262,7 +262,15 @@ DexterSim = class DexterSim{
this.ending_time_of_cur_instruction = robot_status[Dexter.START_TIME] + dur
const job_id = robot_status[Dexter.JOB_ID]
const job_instance = Job.job_id_to_job_instance(job_id)
SimUtils.render_once(robot_status, "Job: " + job_instance.name) //renders after dur, ie when the dexter move is completed.
if (job_instance){
SimUtils.render_once(robot_status, "Job: " + job_instance.name) //renders after dur, ie when the dexter move is completed.
}
else {
this.instruction_queue = []
this.now_processing_instruction = null
DexterSim.close(this.name)
dde_error("in Dexter Simulation, could not find a job with job_id: " + job_id)
}
}

static close(robot_name){
Expand Down
2 changes: 1 addition & 1 deletion doc/doc_for_website.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
src="https://rawgit.com/cfry/dde/master/doc/guide.html">
</iframe>
<br/><div class="doc_top_level_summary">Reference Manual</div>
<iframe width=600 height=200 class="doc_iframe"
<iframe width=600 height=200 class="doc_iframe"
src="https://rawgit.com/cfry/dde/master/doc/ref_man.html">
</iframe>
<br/><div class="doc_top_level_summary">Release Notes</div>
Expand Down
4 changes: 2 additions & 2 deletions doc/guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</style>
<details class="doc_details"><summary>About</summary>
This is <a href="http://hdrobotic.com/" target="_blank">Dexter</a> Development Environment<br/>
version: <span id="dde_version_id">2.0.2</span><br/>
released: <span id="dde_release_date_id">Jul 2, 2017</span>
version: <span id="dde_version_id">2.0.3</span><br/>
released: <span id="dde_release_date_id">Jul 7, 2017</span>
<p/>
DDE helps you create, debug, and send software to a Dexter robot.
You can use any JavaScript augmented with DDE-specific functions to help find out about,
Expand Down
994 changes: 523 additions & 471 deletions doc/ref_man.html

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions doc/release_notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,52 @@
.doc_details summary { font-weight: 600; }
</style>

<details class="doc_details"><summary>v 2.0.3, Jul 7, 2017</summary>
Highlights: run_instruction dialog extensions, Ref Man Examples are now tests.
bug fixes.
<ul><li>run_instruction dialog now has menu for selecting any Robot instruction.
Shows param list of selected instruction.</li>

<li> run_instruction dialog clicking an instruction button or selecting
a new instruction from the instruction menu displays the params
of the instruction and scrolls doc pane to the appropriate section
if doc exists on that instruction.</li>

<li> Now documented in Ref Man and with click help: All 7 temperature conversion
functions. See Ref Man/Units System/</li>

<li> fixed bug in make_url with lack of ampersands between args in the result.</li>

<li> move_to_relative modified to fully use new Kin.J_angles_to_xyz</li>

<li> fixed bug in run_instruction dialog with move_to.</li>

<li> fixed bug in Dexter.move_to with wrong defaulting of args.</li>

<li> kinematics range bug fixed.</li>

<li> jobs now stop when they error.</li>


<li> the FIND algorithm changed. Now searching for "dexter kin"
will find only terms that contain "dexter" followed by a space,
followed by "kin", NOT all instances of "dexter" and all instances of "kin.
This permits more accurate searches.
All are case insensitive.</li>

<li> DDE can now turn the code examples of Ref Man into TestSuite.
This test suite is automatically created and run when you choose:
DDE menu bar/Tests/Run All TestSuites.
It now contains 487 tests, all passing, and helps immensely in keeping
the examples in the Ref Man will be kept up to date with the code.
As part of this project, the expected results of examples now have a pale
green background. About 60 examples and a bunch of underlying code
was fixed in this process.</li>

<li>New help item to top of units series menu that scrolls to Unit System doc.</li>
</ul>
</details>

<details class="doc_details"><summary>v 2.0.2, Jul 2, 2017</summary>
<ul>
<li> fixed run_instruction move_to button action.</li>
Expand Down
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@
<ul>
<li>Units System
<ul>
<li id="units_system_help_id">Help</li>
<li id="series_length_units_id" title="Insert a length units converter.">length</li>
<li id="series_angle_units_id" title="Insert an angle units converter.">angle</li>
<li id="series_duration_units_id" title="Insert a duration_units converter.">duration_units</li>
Expand Down Expand Up @@ -613,7 +614,8 @@
<div id="doc_pane_id" style="background-color:#e1e1e1; padding-left:5px;">
<div class="pane_header_wrapper" style="height:30px;white-space:nowrap;">
<span id="documentation_pane_help_id" class="pane_header"><u>Doc</u></span>
<input id="find_doc_input_id" placeholder="search string" title="If this field is empty,&#013;the selection in the&#013;Editor, Cmd line, Doc, or Output&#013;pane is used." style="width:100px;"/>
<input id="find_doc_input_id" placeholder="search string" title="If this field is empty,&#013;the selection in the&#013;Editor, Cmd line, Doc, or Output&#013;pane is used."
style="width:150px; font-size:14px;"/>
<button id="find_doc_button_id" title="Find documentation on text to the left&#013;or, if none, selected text anywhere.">Find</button>
<!-- <button id="eval_doc_button_id" title="Evaluated the selected code&#013;in the Doc pane.&#013;Result goes in the Output pane.ƒ">Eval Doc</button> obsolete now that Out pane Eval button can do this-->
</div>
Expand Down
56 changes: 32 additions & 24 deletions instruction.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ for (let i = 0; i < Instruction.labels.length; i++){
Instruction[Instruction.labels[i]] = i
}

Instruction.job_of_instruction_array = function(ins_array){
var job_id = ins_array[Instruction.JOB_ID]
return Job.job_id_to_job_instance(job_id)
}

//return an array of the instruction args
Instruction.args = function(ins_array){
return ins_array.slice(Instruction.INSTRUCTION_ARG0)
Expand Down Expand Up @@ -153,7 +158,7 @@ Instruction.Control.error = class error extends Instruction.Control{
do_item (job_instance){
job_instance.stop_for_reason("errored", "Job: " + job_instance.name + " errored with: " + this.reason)
//job_instance.set_up_next_do(0) //no, get out faster, we errored.
job_instance.do_next_item()
job_instance.set_up_next_do(0)
}
toString(){
return "error: " + this.reason
Expand All @@ -171,11 +176,12 @@ Instruction.Control.go_to = class go_to extends Instruction.Control{
do_item (job_instance){
let id = job_instance.instruction_location_to_id(this.instruction_location)
if (id == job_instance.program_counter){
dde_error("In job." + job_instance.name +
job_instance.stop_for_reason("errored", "In job." + job_instance.name +
"<br/>with a go_to instruction whose instruction_location: " + this.instruction_location +
"<br/>points to id: " + id +
"<br/>that is the same as this go_to instruction," +
"<br/>which would cause an infinite loop.")
job_instance.set_up_next_do(0)

}
else {
Expand Down Expand Up @@ -212,8 +218,10 @@ Instruction.Control.grab_robot_status = class grab_robot_status extends Instruct
else if (this.end_index) {
if (this.end_index === "end") { this.end_index = rs.length - 1 }
else if (this.start_index > this.end_index ) {
dde_error("instruction: grab_robot_status passed end_index: " + this.end_index +
job_instance.stop_for_reason("errored", "instruction: grab_robot_status passed end_index: " + this.end_index +
" that is less than start_index: " + this.start_index)
job_instance.set_up_next_do(0)
return
}
else { val = rs.slice(this.start_index, this.end_index + 1) }
}
Expand Down Expand Up @@ -276,7 +284,7 @@ var human_task_handler = function(vals){
var j_inst = Job[j_name]
if (!j_inst.stop_reason){ //if j_inst is still going, stop it.
j_inst.stop_for_reason("interrupted", "In human_task, user stopped this job which is dependent on job: " + job_instance.name)
j_inst.set_up_next_do(1)
j_inst.set_up_next_do(0)
}
}
}
Expand Down Expand Up @@ -355,7 +363,8 @@ var human_enter_choice_handler = function(vals){
var j_inst = Job[j_name]
if (!j_inst.stop_reason){ //if j_inst is still going, stop it.
j_inst.stop_for_reason("interrupted", "In human_task, user stopped this job which is dependent on job: " + job_instance.name)
j_inst.set_up_next_do(1)
j_inst.set_up_next_do(0)
return
}
}
}
Expand Down Expand Up @@ -486,7 +495,8 @@ var human_enter_instruction_handler = function(vals){
let j_inst = Job[j_name]
if (!j_inst.stop_reason){ //if j_inst is still going, stop it.
j_inst.stop_for_reason("interrupted", "In human_enter_instruction, user stopped this job which is dependent on job: " + job_instance.name)
j_inst.set_up_next_do(1)
j_inst.set_up_next_do(0)
return
}
}
}
Expand Down Expand Up @@ -670,7 +680,8 @@ var human_enter_number_handler = function(vals){
var j_inst = Job[j_name]
if (!j_inst.stop_reason){ //if j_inst is still going, stop it.
j_inst.stop_for_reason("interrupted", "In human_enter_number, user stopped this job which is dependent on job: " + job_instance.name)
j_inst.set_up_next_do(1)
j_inst.set_up_next_do(0)
return
}
}
}
Expand Down Expand Up @@ -752,7 +763,7 @@ var human_enter_text_handler = function(vals){
var j_inst = Job[j_name]
if (!j_inst.stop_reason){ //if j_inst is still going, stop it.
j_inst.stop_for_reason("interrupted", "In human_enter_text, user stopped this job which is dependent on job: " + job_instance.name)
j_inst.set_up_next_do(1)
j_inst.set_up_next_do(0)
}
}
}
Expand Down Expand Up @@ -859,10 +870,12 @@ Instruction.Control.if_any_errors = class if_any_errors extends Instruction.Cont
break;
}
}
else { dde_error("In job: " + job_instance.name +
else {
job_instance.stop_for_reason("errored", "In job: " + job_instance.name +
", an instruction of type: Robot.if_any_errors<br/> " +
"was passed a job name of: " + job_name + "<br/> that doesn't exist.")
return
job_instance.set_up_next_do(0)
return
}
}
job_instance.set_up_next_do(1)
Expand Down Expand Up @@ -1029,9 +1042,10 @@ Instruction.Control.destination_send_to_job_is_done = class destination_send_to_
from_job_instance.user_data[user_var] = val //this.params is really the to_job_instance.
}
else {
shouldnt("In job: " + job_instance.name +
job_instance.stop_for_reason("errored", "In job: " + job_instance.name +
" Instruction.Control.destination_send_to_job_is_done.do_item got user var: " + user_var +
" whose value: " + fn + " is not a function.")
return
}
}
}
Expand Down Expand Up @@ -1097,7 +1111,8 @@ Instruction.Control.start_job = class start_job extends Instruction.Control{
job_instance.stop_for_reason("errored",
"Robot_start_job tried to start job: " + this.job_name +
" but it was already started.")
job_instance.set_up_next_do(1)
job_instance.set_up_next_do(0)
return
}
else if (this.if_started == "restart"){
new_job.stop_for_reason("interrupted",
Expand All @@ -1106,8 +1121,8 @@ Instruction.Control.start_job = class start_job extends Instruction.Control{
new_job.inter_do_item_dur * 2)
job_instance.set_up_next_do(1)
}
else {
dde_error("Job." + job_instance.name +
else { //if_started is tested for validity in the constructor, but just in case...
shouldnt("Job." + job_instance.name +
" has a Robot.start_job instruction with an invalid " +
"<br/> if_started value of: " + this.if_started)
}
Expand All @@ -1121,7 +1136,7 @@ Instruction.Control.start_job = class start_job extends Instruction.Control{
new_job.name + " that it doesn't understand.")
}
}
else { dde_error("Robot.start_job attempted to start non-existent Job." + this.job_name) }
else { job_instance.stop_for_reason("errored", "Robot.start_job attempted to start non-existent Job." + this.job_name) }
}
toString(){
return "start_job: " + this.job_name
Expand Down Expand Up @@ -1284,13 +1299,6 @@ Instruction.Control.sync_point = class sync_point extends Instruction.Control{
" which is not defined.")
return;
}
// j_inst might have stopped, and perhaps completed fine so don't halt syn_point
// just because a job is stopped.
// else if (j_inst.stop_reason){
// job_instance.stop_for_reason("errored", "sync_point has a job-to-sync-with named: Job." + job_name +
// " that has already stopped.")
// return;
//}
else if (j_inst.program_counter < 0) {//j_inst hasn't started yet. That's ok, it just hasn't reached the sync point.
job_instance.wait_reason = "for Job." + j_inst.name + " to get to sync_point named: " + this.name + " but that Job hasn't started yet.."
//job_instance.status_code = "waiting" //don't change this from "not_started"
Expand Down Expand Up @@ -1442,8 +1450,8 @@ Instruction.Control.wait_until = class wait_until extends Instruction.Control{
job_instance.set_up_next_do(1)
}
}
else {
dde_error("In job: " + job_instance.name +
else { //this is checked in the constructor, but just in case ...
shouldnt("In job: " + job_instance.name +
' in wait_until("new_instruction")<br/>' +
" got fn_date_dur of: " + this.fn_date_dur +
" which is invalid.<br/>" +
Expand Down
Loading

0 comments on commit 5e071ac

Please sign in to comment.