mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-26 11:43:25 +00:00
blocks: add confirm_run parameter for disabling running confirmation
This commit is contained in:
@@ -31,6 +31,7 @@ Parameters read by frontend:
|
||||
|
||||
* `~navigate_tolerance` (*float*) – distance tolerance in meters, used for navigate-like blocks (default: 0.2).
|
||||
* `~sleep_time` (*float*) – duration of sleep in loop cycles, used for navigate-like blocks (default: 0.2).
|
||||
* `~confirm_run` (*bool*) – enable confirmation to run the program (default: true).
|
||||
|
||||
These parameters also can be set as URL GET-parameters, for example:
|
||||
|
||||
|
||||
@@ -39,7 +39,8 @@ var workspace = Blockly.inject('blockly', {
|
||||
function readParams() {
|
||||
return Promise.all([
|
||||
ros.readParam('navigate_tolerance', true, 0.2),
|
||||
ros.readParam('sleep_time', true, 0.2)
|
||||
ros.readParam('sleep_time', true, 0.2),
|
||||
ros.readParam('confirm_run', true, true),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -123,7 +124,7 @@ ros.ros.on('close', update);
|
||||
ready.then(() => runButton.disabled = false);
|
||||
|
||||
window.runProgram = function() {
|
||||
if (!confirm('Run program?')) return;
|
||||
if (ros.params.confirm_run && !confirm('Run program?')) return;
|
||||
|
||||
runRequest = true;
|
||||
update();
|
||||
|
||||
Reference in New Issue
Block a user