Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
cfry committed Aug 12, 2017
1 parent 789d5f0 commit 7950d85
Show file tree
Hide file tree
Showing 16 changed files with 563 additions and 58 deletions.
6 changes: 3 additions & 3 deletions doc/guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<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.9</span><br/>
released: <span id="dde_release_date_id">Aug 3, 2017</span>
version: <span id="dde_version_id">2.0.10</span><br/>
released: <span id="dde_release_date_id">Aug 11, 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 Expand Up @@ -376,7 +376,7 @@ <h5>Step 3</h5>
of ways to get "just in time & place" help within DDE. We've tried to
make them easy to discover, but in such a sophisticated environment,
you might miss a few. So here's the list:
<ul><li><b><a href="http://hdrobotic.com/videos/" target="_blank">DDE video</a></b>
<ul><li><b><a href="http://hdrobotic.com/videos/" target="_blank">DDE videos</a></b>
This web page has videos on the overall mission, DDE, and the hardware.
The DDE video is 10 minutes long and covers the basics.<p/></li>
<li><b><a href="http://hdrobotic.com/software" target="_blank">http://hdrobotic.com/software</a></b>
Expand Down
29 changes: 20 additions & 9 deletions doc/ref_man.html
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,8 @@
new Job({name: "gamepad_job2",
inter_do_item_dur: 0.05,
do_list: [Dexter.move_all_joints(Dexter.NEUTRAL_ANGLES),
gamepad_moves]})</code></pre>
gamepad_moves]})
</code></pre>
</details>
</details> <!-- end Gamepad -->

Expand Down Expand Up @@ -1012,8 +1013,9 @@
are stored in <code title="unEVALable code fragment"> Job.the_job_name.rs_history</code>.
This is useful for debugging, but uses memory, which can be
saved by setting keep_history to <code>false</code>.</li>
<li><b>show_instructions</b> true or false, default false. As the instructions for
a job are being run, they are shown in DDE.</li>
<li><b>show_instructions</b> true or false, default true. As the instructions for
a job are being run, they are shown in DDE along with a "progress bar".
You might want to turn this off for time-sensitive jobs.</li>
<li><b>inter_do_item_dur</b> A number indicating the number of milliseconds between
when an instruction is completed by its robot, and when the next instruction is
computed and sent to the robot of the job. This "taking a breath" gives other
Expand Down Expand Up @@ -2561,11 +2563,17 @@
But when a "submit" button is clicked or something else in the
callback function that also closes the window, such as a call to
<code title="unEVALable code fragment.">close_window(vals.window_index)</code>,
the argument to the callback function, which contains the values of all the
input elements, is saved into the Job's <samp>user_data</samp> for use by subsequent instructions
in the job.
<p/>
if you just want to get one value at a time from a user, its easier to
here's what happens:
<ol><li>The dialog box is closed.</li>
<li>The argument to the callback function that contains all the values
of all the input widgets is bound to the Job's <samp>user_data</samp> variable
named in user_data_variable_name argument to the instruction.
These values can be used by subsequent instructions.</li>
<li>The instruction is finished, and the next instruction in the Job's
do-list (if any) is run.</li>
</ol>
<p/>
If you just want to get one value at a time from a user, its easier to
use the other Human instructions for number, text, etc. But
if you want to get multiple values in one dialog, using this
instruction is the way to go.
Expand All @@ -2577,7 +2585,10 @@
when it is called, <code title="unEVALable JS fragment">this</code> is bound
to the job that the instruction is in. You can use this to, for instance, stop the job,
by calling (within the callback)
<code title="unEVALable JS fragment">this.stop_for_reason("interrupted", "your explanation.")</code><br/>
<code title="unEVALable JS fragment">this.stop_for_reason("interrupted", "your explanation.")</code>
<br/>It is common in using this instruction to not have a callback function, since the
real action(s) taken due to the values that the user has input occurs by subsequent
instructions in the job that read those values from the Job's user_data.<br/>
<b>user_data_variable_name</b> Default: <code>"show_window_vals"</code>.
Similar to other Human instructions, this is the place that values from
input elements are stored when the dialog is closed.
Expand Down
30 changes: 29 additions & 1 deletion doc/release_notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,34 @@
}
.doc_details summary { font-weight: 600; }
</style>

<details class="doc_details"><summary>v 2.0.10, Aug 11, 2017</summary>
Highlights: Behind the scenes bug fixes.
<ul><li> Fixed rounding bug in <code>Robot.move_to</code> and <code>Robot.move_to_relative</code></li>

<li> Extended Browser VS DDE to contain the full name "Dexter Development Environment"</li>

<li> <code>Robot.start</code> now always inits its Socket and sets processing_flush to false.</li>

<li> Now the Job init param of <code>show_instructions</code> turns on or off
the display of the progress bar while the Job is running.
Default is true.</li>

<li> Now the DDE window position is preserved across launching DDE (along with
its size).</li>

<li> Now when a job runs a <code>Robot.stop_job</code> instruction, that's considered to be
a normal completion, not an error or interruption.</li>

<li> Improvements to Kinematics math.</li>

<li> The robot_status returned from Dexter now has its arcseconds converted to degrees,
and related changes for our new Units system.</li>

<li> Improved the error message on "no dde_apps" folder upon DDE startup.</li>
</ul>
</details>

<details class="doc_details"><summary>v 2.0.9, Aug 3, 2017</summary>
Highlights: Improvements to Calibrate Dexter (on the Jobs menu).
New instruction: Human.show_window
Expand Down Expand Up @@ -344,7 +372,7 @@
</ul>
</details>

<details class="doc_details"><summary>v 2.0.1, Jul 2, 2017</summary>
<details class="doc_details"><summary>v 2.0.1, Jul 2, 2017 private</summary>
Highlight: Run Instruction dialog extended. Units System documented.
More details of new units system converted.
<ul><li> Eval button now can eval selected text in Output pane, Doc pane and Command input as
Expand Down
10 changes: 8 additions & 2 deletions eval.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,15 @@ function eval_js_part3(result){
string_to_print = result.error_type + ": " + result.error_message
if (result.starting_index != undefined) { //beware, starting_index might == 0 which is false to IF
var cm_pos = myCodeMirror.doc.posFromIndex(start_of_selection + result.starting_index)
string_to_print += "<br/>At line: " + (cm_pos.line + 1) + ", char: " + (cm_pos.ch + 1)
string_to_print += "<br/>&nbsp;&nbsp;&nbsp;At line: " + (cm_pos.line + 1) + ", char: " + (cm_pos.ch + 1)
}
out_eval_result(string_to_print, "red")
var stack_trace = result.full_error_message
var first_newline = stack_trace.indexOf("\n")
if (first_newline != -1) { stack_trace = stack_trace.substring(first_newline + 1) }
stack_trace = replace_substrings(stack_trace, "\n", "<br/>")
string_to_print = "<details><summary><span style='color:red;'>" + string_to_print +
"</span></summary>" + stack_trace + "</details>"
out_eval_result(string_to_print)
}
else if (result.value_string == '"dont_print"') {}
else {
Expand Down
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@
<script type="text/javascript" src="low_level_dexter/calibrate_optical.js"></script>
<script type="text/javascript" src="low_level_dexter/calibrate_ui.js"></script>

<script type="text/javascript" src="music/note.js"></script>
<script type="text/javascript" src="music/phrase.js"></script>

<script type="text/javascript" src="ready.js"></script>
<link rel="stylesheet" href="styles.css" type="text/css"/>
Expand Down
36 changes: 31 additions & 5 deletions instruction.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Instruction.Control.go_to = class go_to extends Instruction.Control{
job_instance.set_up_next_do(0)
}
}
toString(){ return this.instruction_location }
toString(){ return "Robot.go_to instruction_location: " + this.instruction_location }
}

Instruction.Control.grab_robot_status = class grab_robot_status extends Instruction.Control{
Expand Down Expand Up @@ -604,7 +604,7 @@ var human_enter_instruction_handler = function(vals){
let new_human_instruction = Human.enter_instruction({task: hei_instance.task, instruction_type: ins_type, instruction_args: args, dependent_job_names: hei_instance.dependent_job_names})
let new_ins_array = [args_array, new_human_instruction]
job_instance.insert_instructions(new_ins_array)
job_instance.added_items_count[job_instance.program_counter] = 1
job_instance.added_items_count[job_instance.program_counter] = 2
}
job_instance.set_up_next_do(1) //even for the case where we're stopping the job,
//this lets the do_next_item handle finishing the job properly
Expand Down Expand Up @@ -929,6 +929,7 @@ Instruction.Control.if_any_errors = class if_any_errors extends Instruction.Cont
the_error_ins = Robot.error(message)
}
job_instance.insert_single_instruction(the_error_ins)
job_instance.added_items_count[this.program_counter] = 1
break;
}
}
Expand Down Expand Up @@ -1136,11 +1137,11 @@ Instruction.Control.sent_from_job = class sent_from_job extends Instruction.Cont
if (Instruction.is_instruction_array(this.do_list_item) ||
!Array.isArray(this.do_list_item)){
job_instance.insert_single_instruction(this.do_list_item)
job_instance.added_items_count[job_instance.program_counter] = 1
job_instance.added_items_count[job_instance.program_counter] += 1
}
else { //we've got more than 1 instr to insert.
job_instance.insert_instructions(this.do_list_item)
job_instance.added_items_count[job_instance.program_counter] = this.do_list_item.length
job_instance.added_items_count[job_instance.program_counter] += this.do_list_item.length
}
job_instance.set_up_next_do(1)
}
Expand Down Expand Up @@ -1220,7 +1221,8 @@ Instruction.Control.stop_job = class stop_job extends Instruction.Control{
if (!this.stop_reason){
this.stop_reason = "Stopped by Job." + job_instance.name + " instruction: Robot.stop_job."
}
job_to_stop.stop_for_reason("interrupted", this.stop_reason, this.perform_when_stopped)
job_to_stop.stop_for_reason("completed", this.stop_reason, this.perform_when_stopped)
//this is not an error or interrupted, its a normal stoppage of the job.
job_instance.set_up_next_do()
}
toString(){
Expand Down Expand Up @@ -1455,6 +1457,7 @@ Instruction.Control.wait_until = class wait_until extends Instruction.Control{
let new_instructions = [make_ins("g"), //just a do nothing to get a round trip to Dexter.
Robot.wait_until(this.fn_date_dur - 1)] //create new wait_until to wait for the remaining time
job_instance.insert_instructions(new_instructions)
job_instance.added_items_count[job_instance.program_counter] += 2
this.start_time = null //essential for the 2nd thru nth call to start() for this job.
job_instance.wait_reason = null
job_instance.set_status_code("running")
Expand Down Expand Up @@ -1566,3 +1569,26 @@ Instruction.Control.Get_page = class Get_page extends Instruction.Control{
else { job_instance.set_up_next_do(1)} //got the response, move to next instruction
}
}

Instruction.Control.play_notes = class play_notes extends Instruction.Control{
constructor (note_or_phrase) {
super()
if (typeof(note_or_phrase) == "string"){
note_or_phrase = note_or_phrase.trim()
if(note_or_phrase.includes(" ")){ //phrase
note_or_phrase = new Phrase({notes: note_or_phrase})
}
else { note_or_phrase = Note.n(note_or_phrase) }
}
this.note_or_phrase = note_or_phrase
}
do_item(job_instance){ //send all the notes on first call, then do a set_timeout of the overall dur to setup_next
//works when note_or_phrase is either a note or a phrase
this.note_or_phrase.play()
//setTimeout(function(){
job_instance.set_up_next_do(1, false, this.note_or_phrase.dur_in_seconds())
// },
// this.note_or_phrase.dur_in_ms())
}
}

Loading

0 comments on commit 7950d85

Please sign in to comment.