update_lhs.ts
parent
3042b20572
commit
aa31ff76ca
|
@ -30,7 +30,7 @@ module CeleryScriptSettingsBag
|
|||
ALLOWED_DATA_TYPES = %w(tool coordinate point)
|
||||
ALLOWED_OPS = %w(< > is not is_undefined)
|
||||
ALLOWED_AXIS = %w(x y z all)
|
||||
ALLOWED_LHS_TYPES = [String, :peripheral, :sensor, :named_pin, :pin]
|
||||
ALLOWED_LHS_TYPES = [String, :named_pin]
|
||||
ALLOWED_LHS_STRINGS = [*(0..69)].map{|x| "pin#{x}"}.concat(%w(x y z))
|
||||
STEPS = %w(_if execute execute_script find_home move_absolute
|
||||
move_relative read_pin send_message take_photo wait
|
||||
|
|
|
@ -111,4 +111,9 @@ unless Rails.env == "production"
|
|||
x: 10,
|
||||
y: 10,
|
||||
z: 10)
|
||||
end
|
||||
d = u.device
|
||||
PinBindings::Create
|
||||
.run!(device: d, sequence_id: d.sequences.sample.id, pin_num: 15,)
|
||||
Sensors::Create
|
||||
.run!(device: d, pin: 14, label: "Stub sensor", mode: 0)
|
||||
end
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
interface LhsUpdateProps {
|
||||
currentSequence: TaggedSequence;
|
||||
currentStep: If;
|
||||
dispatch: Function;
|
||||
index: number;
|
||||
resources: ResourceIndex;
|
||||
}
|
||||
export const updateLhs =
|
||||
(props: IfParams) =>
|
||||
(ddi: DropDownItem) => {
|
||||
fancyDebug(e);
|
||||
const stepCopy = defensiveClone(step);
|
||||
const seqCopy = defensiveClone(sequence).body;
|
||||
const val = e.value;
|
||||
seqCopy.body = seqCopy.body || [];
|
||||
if (_.isString(val)) { stepCopy.args[field] = val; }
|
||||
seqCopy.body[index] = stepCopy;
|
||||
dispatch(overwrite(sequence, seqCopy));
|
||||
}
|
|
@ -102,6 +102,11 @@ export enum MinVersionOverride {
|
|||
export function shouldDisplay(
|
||||
current: string | undefined, lookupData: MinOsFeatureLookup | undefined) {
|
||||
return function (feature: Feature): boolean {
|
||||
/** Escape hatch for platform developers doing offline development. */
|
||||
if (localStorage.getItem("IM_A_DEVELOPER")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isString(current)) {
|
||||
const min = (lookupData || {})[feature] || MinVersionOverride.NEVER;
|
||||
switch (semverCompare(current, min)) {
|
||||
|
|
Loading…
Reference in New Issue