MCPcopy Create free account
hub / github.com/CopterExpress/clover / buildFrameId

Function buildFrameId

clover_blocks/www/python.js:168–180  ·  view source on GitHub ↗
(block)

Source from the content-addressed store, hash-verified

166}
167
168function buildFrameId(block) {
169 let frame = block.getFieldValue('FRAME_ID').toLowerCase();
170 let id = Blockly.Python.valueToCode(block, 'ID', Blockly.Python.ORDER_NONE);
171 if (frame == 'aruco') { // aruco marker frame
172 if (id.match(/^[0-9]+$/)) { // id is positive integer
173 return `'${frame}_${id}'`;
174 } else { // something else...
175 return `'${frame}_' + str(int(${id}))`;
176 }
177 } else {
178 return `'${frame}'`;
179 }
180}
181
182Blockly.Python.navigate = function(block) {
183 let x = Blockly.Python.valueToCode(block, 'X', Blockly.Python.ORDER_NONE);

Callers 1

python.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected