Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
cfry committed Dec 28, 2020
1 parent dd23d21 commit cb1f25c
Show file tree
Hide file tree
Showing 16 changed files with 340 additions and 156 deletions.
45 changes: 6 additions & 39 deletions core/dextersim.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,34 +137,8 @@ DexterSim = class DexterSim{
break;
case "g":
let inst_status_mode = instruction_array[Instruction.INSTRUCTION_ARG0]
if(inst_status_mode === 0) {
if(sim_inst.status_mode === 0) {}
else if (sim_inst.status_mode === 1) {
//let new_rs_array = Dexter.make_default_status_array()
//RobotStatus.fill_robot_status_array_with_another(new_rs_array, sim_inst.robot_status_in_arcseconds)
//sim_inst.robot_status_in_arcseconds = new_rs_array
sim_inst.status_mode = inst_status_mode
}
else {
dde_error("DexterSim.send can't make a robot_status array for status_mode: " + status_mode)
}
}
else if (inst_status_mode === 1) {
if(sim_inst.status_mode === 1) {} //no change
else if(sim_inst.status_mode === 0){
//let new_rs_array = Dexter.make_default_status_array_g1() //for g0
//RobotStatus.fill_robot_status_array_with_another(new_rs_array, sim_inst.robot_status_in_arcseconds)
//sim_inst.robot_status_in_arcseconds = new_rs_array
sim_inst.status_mode = inst_status_mode
}
else {
dde_error("DexterSim.send can't make a robot_status array for status_mode: " + status_mode)
}
}
else if (!inst_status_mode) { } //no change //if no status_mode in the instruction, status_mode will be undefined and this clause will hit
else {
dde_error('DexterSim.send, while processing "g" instruction, got invalid status_mode of: ' + status_mode)
}
if((inst_status_mode === null) || (inst_status_mode === undefined)){} //don't change existing sim_inst.status_mode
else { sim_inst.status_mode = inst_status_mode }
sim_inst.ack_reply(instruction_array)
break;
case "G": //deprecated. get immediate. The very first instruction sent to send should be "G",
Expand Down Expand Up @@ -223,19 +197,12 @@ DexterSim = class DexterSim{
//hacked to now create and pass to on_receive a full robot status
//payload_string_maybe might be undefined, a string payload or an error number positive int.
ack_reply(instruction_array, payload_string_maybe){
let robot_status_array //= this.robot_status_in_arcseconds.slice()
if(this.status_mode === 0) {
robot_status_array = Dexter.make_default_status_array()
let angles_in_degrees = []
let rs_inst = new RobotStatus({robot_status: robot_status_array})
let robot_status_array = Dexter.make_default_status_array_g_sm(this.status_mode)
let rs_inst = new RobotStatus({robot_status: robot_status_array})
if(rs_inst.supports_measured_angles()) {
rs_inst.set_measured_angles(this.measured_angles_arcseconds, true) //we want to install arcseconds, as Societ is expected arcseconds and will convert to degrees
}
else if(this.status_mode === 1) {
robot_status_array = Dexter.make_default_status_array_g1()
let rs_inst = new RobotStatus({robot_status: robot_status_array})
rs_inst.set_measured_angles(this.measured_angles_arcseconds, true) //true means "raw" ie accept first arg without conversion
}
else {shouldnt("DexterSim.ack_reply got invalid status_mode of: " + this.status_mode) }
//else allow all other status modes.
robot_status_array[Dexter.JOB_ID] = instruction_array[Instruction.JOB_ID]
robot_status_array[Dexter.INSTRUCTION_ID] = instruction_array[Instruction.INSTRUCTION_ID]
robot_status_array[Dexter.START_TIME] = instruction_array[Instruction.START_TIME] //Date.now()
Expand Down
4 changes: 2 additions & 2 deletions core/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
global.dde_version = "3.7.0"
global.dde_release_date = "Dec 14, 2020"
global.dde_version = "3.7.1"
global.dde_release_date = "Dec 27, 2020"

console.log("dde_version: " + global.dde_version + " dde_release_date: " + global.dde_release_date +
"\nRead electron_dde/core/job_engine_doc.txt for how to use the Job Engine.\n")
Expand Down
6 changes: 4 additions & 2 deletions core/instruction.js
Original file line number Diff line number Diff line change
Expand Up @@ -2410,14 +2410,16 @@ Instruction.loop = class loop extends Instruction{
}

Instruction.out = class Out extends Instruction{
constructor (val="", color="black", temp=false) {
constructor (val="", color="black", temp=false, print_job_info=false) {
super()
this.val = val
this.color = color
this.temp = temp
this.print_job_info = print_job_info
}
do_item (job_instance){
let message = "Job: " + job_instance.name + ", instruction ID: " + job_instance.program_counter + ", Instruction type: IO.out<br/>" + this.val
let prefix = (this.print_job_info ? "Job: " + job_instance.name + ", instruction ID: " + job_instance.program_counter + ", Instruction type: IO.out<br/>" : "")
let message = prefix + this.val
out(message, this.color, this.temp)
job_instance.set_up_next_do(1)
}
Expand Down
2 changes: 1 addition & 1 deletion core/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ class Job{
close_on_click_fn_src +
"' title='Undefine this job'>X</span><br/><span style='cursor:pointer; padding-left:2px;' onclick='" +
inspect_on_click_fn_src +
"' title='Inspect this job'>I</span></div>"
"' title='Inspect this job'>&#9432;</span></div>"
jobs_button_bar_id.append(wrapper) //.firstChild)

but_elt = window[the_id]
Expand Down
Loading

0 comments on commit cb1f25c

Please sign in to comment.