Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
cfry committed Sep 5, 2020
1 parent 69256a1 commit 32d0bc4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
8 changes: 8 additions & 0 deletions core/to_source_code.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ function to_source_code({value, indent="", function_names=false, newObject_paths
return value.to_source_code(new_args)
}
else if (value === window) { return "window" } //too many weird values in there and too slow so punt.
else if (window.Picture && Picture.is_mat(value)){ //we can't and probably shouldn't attempt to print out a readable mat here,
//so just print a string to let a user know what it is in the inspector
//without this, bad bug happens when inspecting Jobs that have taken a picture and
//put it in a user_data variable
let result = "Mat (picture) of: width: " + Picture.mat_width(value) +
" height: " + Picture.mat_height(value)
return result
}
else if (typeof(value) == "object"){//beware if we didn't catch arrays above this would hit
//assumes at this point we just have a lit obj.
return to_source_code_lit_obj(arguments[0])
Expand Down
8 changes: 5 additions & 3 deletions picture1.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,10 @@ var Picture = class Picture{
else if(typeof(video_id) == "string") {
video_elt = value_of_path(video_id)
if(video_elt == undefined){
let vid_callback = function() {
let show_video_callback = function() {
Picture.take_picture({video_id: video_id, width: width, height: height, callback: callback})
}
Picture.show_video({video_id: video_id, camera_id: camera_id, width: width, height: height, visible: false, callback: vid_callback})
Picture.show_video({video_id: video_id, camera_id: camera_id, width: width, height: height, visible: false, callback: show_video_callback})
return
//a video show window will pop up but the below code won't be able to return its mat.
/*let the_html = '<video id="' + video_id +
Expand Down Expand Up @@ -492,7 +492,9 @@ var Picture = class Picture{
//type can be null (any mat type), "rgba", "gray", or a cv type number.
//returns a boolean
static is_mat(mat, type=null) {
if(mat instanceof cv.Mat) {
if((typeof(mat) === "object") &&
(typeof(window.cv) === "object") && //just in case cv is not initialized yet, don't have in screw up to_source_code and inspect
(mat instanceof cv.Mat)) {
let mat_type = mat.type()
switch (type) {
case null: return true //mat can be of any mat_type
Expand Down
4 changes: 2 additions & 2 deletions splash_screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var SplashScreen = class SplashScreen {
let the_tut_name = SplashScreen.splash_screen_tutorial_label_to_name(the_tut_label)
let the_option_elt
for(let an_option_elt of splash_screen_which_tutorial_id.children){
if(an_option_elt.innerText === the_tut_label){
if(an_option_elt.innerText.includes(the_tut_name)){ //beware, race condition on WinOS can cause a problem here
the_option_elt = an_option_elt
break;
}
Expand Down Expand Up @@ -53,7 +53,7 @@ var SplashScreen = class SplashScreen {
x: 320, //same as dexter ui on purpose so that dui will "cover up" the splash screen.
y: 100,
width: 380, //380 is splash screen width 480,
height: 315,
height: 330,
background_color: "#bae5fe", // pastel green: "#e7ffef",
callback: "SplashScreen.show_splash_screen_cb",
content:
Expand Down
9 changes: 4 additions & 5 deletions tutorials/dexter_ui_tutorial.dde
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ dui_tour.addSteps([
is one easy way to accomplish these goals.`,
},
{attachTo: {element: '#simulate_radio_true_wrapper_id', on: 'top'},
text: `To accomplish these goals,<br/>
please select <b>simulate</b> (if it isn't already).
text: `Please select <b>simulate</b> (if it isn't already).
You can select <b>real</b> after this tutorial, to move a real robot.`,
popperOptions: {modifiers: [{ name: 'offset', options: { offset: [0, 20] } }]},
},
Expand Down Expand Up @@ -158,8 +157,8 @@ dui_tour.addSteps([
popperOptions: {modifiers: [{ name: 'offset', options: { offset: [0, 0] } }]}
},
{attachTo: {element: '#eval_id', on: 'right'},
text: `The <b>Eval</b> button runs the selected JavaScript code<br/>
in the editor.
text: `The <b>Eval</b> button runs the selected JavaScript code
in the editor.<br/>
Click it now to evaluate the selection.<br/>
In the <b>Output</b> pane you'll see the internal data structure
that represents the instruction, but this does not cause
Expand Down Expand Up @@ -190,7 +189,7 @@ dui_tour.addSteps([
buttons: [{text: 'Back', action: dui_tour.back},
{text: 'Next', action: dui_tour.next}]
},
{attachTo: { element: '#js_menubar_id', on: 'left'},
{attachTo: { element: '#doc_pane_id', on: 'left'},
text: `Clicking the <b>Jobs</b> menu, <b>Dexter UI</b> item, automatically scrolls
the <i>Doc Pane</i> to the section of the <i>User Guide</i>
that describes the Dexter UI dialog.`
Expand Down

0 comments on commit 32d0bc4

Please sign in to comment.