Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
cfry committed Dec 23, 2019
1 parent 19fd317 commit 02ce569
Show file tree
Hide file tree
Showing 48 changed files with 2,383 additions and 1,188 deletions.
7 changes: 3 additions & 4 deletions app_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ function handle_ab(vals){ //not dex.handle_train because then I can't use the na
}
else if (vals.format_kind == "combo box"){
var lines = vals.format_text.split("\n")
text = '<div class="combo_box" name="' + vals.input_name +
text = '<div class="combo_box" id="' + vals.input_name +
'" style="display:inline-block;vertical-align:middle;width:' + vals.format_text_width + ";" +
'">\n'
for (var line of lines){
Expand Down Expand Up @@ -645,7 +645,7 @@ dex.code_to_finish_window = function(vals){

//var index_for_window_default_name = 0 //must be here for ui env, can't use length of tasks becaue that's in snadvox

ab.launch = function(){ //happens in ui env, called from Insert menu item when user chooses "build applicaiton" item
ab.launch = function(){ //happens in ui env, called from Insert menu item when user chooses "build window" item
ab.init()
//index_for_window_default_name += 1
var window_name = "window_" //+ index_for_window_default_name //this is inited by ab.post_creation_window_init
Expand All @@ -660,7 +660,7 @@ ab.launch = function(){ //happens in ui env, called from Insert menu item when u
<input title="Insert horizontal space\nso that the next insertion\nwill be to the right\nby the given pixels." type="button" value="Horizontal space"/>
<input name="horizontal_space_pixels" type="number" min-value="0" value="20" style="width:32px;"/> pixels<br/>
<input type="button" value="Button" style="margin-right:20px;margin-bottom:10px;" title="Create a button.\nThe selected action will be run\nwhen the button is clicked."/>
Action: <div name="actions" class="combo_box" style="display:inline-block;vertical-align:middle;"> </div>
Action: <div id="actions" class="combo_box" style="display:inline-block;vertical-align:middle;"> </div>
<select name="button_kind">
<option title="When the button is clicked,\nthe window closes and\nthe action is run.">close window</option>
<option title="When the button is clicked,\nthe action is run.\nThe window does not close.">don't close</option>' +
Expand Down Expand Up @@ -708,7 +708,6 @@ ab.launch = function(){ //happens in ui env, called from Insert menu item when u
<option>bold</option>
<option>italic</option>
</select></td>
<!--<td> <div name="format_action" class="combo_box" style="display:inline-block;vertical-align:middle;"> </div></td>-->
</tr>
</table>
<input title="Insert a control for entering a number\nthat is not less than 'Min',\nnot more than 'Max',\nwith a resolution of 'Step'."
Expand Down
3 changes: 2 additions & 1 deletion blocksde/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"js2b.js"
)
*/

//called from dde_init.js IFF we're in dde platform.
function blocks_init(){
javascript_pane_header_wrapper_id.appendChild(
Expand Down Expand Up @@ -162,7 +163,7 @@ function defeng_to_blocks(){
defeng_to_js()
js_to_blocks()
}
var {dde_error, warning} = require("./core/utils.js")




2 changes: 1 addition & 1 deletion blocksde/js2b.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,4 +475,4 @@ var JS2B = class JS2B{
return lit_obj_block
}
}
var {dde_error, shouldnt, warning, function_param_names_and_defaults_array, value_of_path} = require("./core/utils.js")
var {shouldnt, function_param_names_and_defaults_array, value_of_path} = require("./core/utils.js")
2 changes: 1 addition & 1 deletion blocksde/jsdb_newObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -2932,7 +2932,7 @@ newObject({prototype: Root.jsdb.method_call,
params: {array_of_5_angles: Root.jsdb.literal.array.array5}
})
}
var {dde_error, shouldnt, warning, compute_string_size, function_param_names_and_defaults,
var {shouldnt, compute_string_size, function_param_names_and_defaults,
is_literal_object, is_string_an_identifier, is_string_a_number,
replace_substrings, value_of_path} = require("./core/utils.js")

Expand Down
2 changes: 1 addition & 1 deletion blocksde/workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,5 +349,5 @@ Workspace.suck_left_margin = 20 //if a block is dropped with its x of <= this, t
Workspace.floating_typein_x = 0
Workspace.floating_typein_y = 0

var {shouldnt, warning, is_string_an_identifier, is_string_a_path, value_of_path} = require("./core/utils.js")
var {shouldnt, is_string_an_identifier, is_string_a_path, value_of_path} = require("./core/utils.js")

1 change: 0 additions & 1 deletion core/dextersim.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,6 @@ DexterSim.set_interval_id = null
module.exports = DexterSim

var {Robot, Dexter} = require("./robot.js")
var {out} = require("./out.js")
var Socket = require("./socket.js")
var {Instruction} = require("./instruction.js")
var {shouldnt} = require("./utils.js")
Expand Down
54 changes: 43 additions & 11 deletions core/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
console.log("Read electron_dde/core/job_engine_doc.txt for how to use the Job Engine.")
console.log("Read electron_dde/core/job_engine_doc.txt for how to use the Job Engine.\n")

console.log("in file: " + module.filename)
function node_on_ready() {
console.log("top of node_on_ready")
console.log("top of node_on_ready\n")
const os = require('os');
global.operating_system = os.platform().toLowerCase() //for Ubuntu, ths returns "linux"

if (operating_system == "darwin") { operating_system = "mac" }
else if (operating_system.startsWith("win")) { operating_system = "win" }
try{dde_apps_folder}
catch(err){
global.dde_apps_folder = process.env.HOME //ie /Users/Fry
+ "/Documents/dde_apps"
global.dde_apps_folder = "/srv/samba/share/dde_apps" //process.env.HOME //ie /Users/Fry
//+ "/Documents/dde_apps"
}
//not needed for node version
//var pckg = require('../package.json');
Expand Down Expand Up @@ -84,7 +84,13 @@ function start_job(job_name){
}
*/
function define_and_start_job(job_file_path){
Job.define_and_start_job(job_file_path)
if(job_file_path.endsWith("/keep_alive")) {
global.keep_alive_value = true //set to false by stdio readline evaling "set_keep_alive_value(false)" made in httpd.js
//and sent to job engine process stdin.
}
else {
Job.define_and_start_job(job_file_path)
}
}

//____________
Expand All @@ -102,6 +108,7 @@ function run_shell_cmd_default_cb (error, stdout, stderr){
function run_shell_cmd(cmd_string, options={}, cb=run_shell_cmd_default_cb){
exec(cmd_string, options, cb)
}

var {load_files, persistent_initialize, read_file, file_content, write_file, dde_init_dot_js_initialize} = require('./storage.js')
//file_content is deprecated
var {Root} = require("./object_system.js")
Expand All @@ -112,20 +119,43 @@ var {sind, cosd, tand, asind, acosd, atand, atan2d} = require("../math/Trig_in_D
var Job = require("./job.js")

var {Robot, Brain, Dexter, Human, Serial} = require("./robot.js")
var {Instruction, make_ins, human_task_handler, human_enter_choice_handler,
human_enter_filepath_handler, human_enter_number_handler, human_enter_position_handler,
human_enter_instruction_handler,
human_enter_text_handler, human_show_window_handler} = require("./instruction.js")
var {Control} = require("./instruction_control.js")
var {IO} = require("./instruction_io.js")

var {out, speak} = require("./out.js")
require("./je_and_browser_code.js") // must be before loading out.js as it defines SW used by out.js
var {speak, show_window, beeps, beep} = require("./out.js")
var calibrate_build_tables = require("../low_level_dexter/calibrate_build_tables.js")
var DXF = require("../math/DXF.js")
var {init_units} = require("./units.js")
var {FPGA} = require("./fpga.js")

var {close_readline, set_keep_alive_value, write_to_stdout} = require("./stdio.js")

global.keep_alive_value = false
global.Brain = Brain
global.Dexter = Dexter
global.Human = Human
global.Robot = Robot

global.make_ins = Dexter.make_ins
global.out = out
global.speak = speak
global.Robot = Robot
global.show_window = show_window
global.beeps = beeps
global.beep = beep

global.Instruction = Instruction
global.human_task_handler = human_task_handler
global.human_enter_choice_handler = human_enter_choice_handler
global.human_enter_filepath_handler = human_enter_filepath_handler
global.human_enter_number_handler = human_enter_number_handler
global.human_enter_position_handler = human_enter_position_handler
global.human_enter_instruction_handler = human_enter_instruction_handler
global.human_enter_text_handler = human_enter_text_handler
global.human_show_window_handler = human_show_window_handler

global.Control = Control
global.IO = IO
global.Job = Job
Expand All @@ -146,12 +176,14 @@ global.file_content = file_content
global.write_file = write_file


global.close_readline = close_readline
global.set_keep_alive_value = set_keep_alive_value
global.write_to_stdout = write_to_stdout



run_node_command(process.argv)
/*
node core start_job myjob
node core define_and_start_job /Users/Fry/Documents/dde_apps/node_test_job.js
*/
Loading

0 comments on commit 02ce569

Please sign in to comment.