Ejemplo n.º 1
0
def getButton(off=False):
    sb = createBooleanBlock(off, 'getButton', 'purple')
    sb.addCodeElement('o')
    sb.addVariableElement(gettext_noop('button'), countComponents,
                          'component_button')
    sb.addCodeElement('está pressionado')
    return sb
Ejemplo n.º 2
0
def logicType(varName, color, off=False):
    bb = createBooleanBlock(off, 'logicType', color)
    bb.varName = varName
    bb.addCodeElement()
    bb.addCodeElement(varName)
    bb.addCodeElement()
    bb.custom = True
    return bb
Ejemplo n.º 3
0
def logicOperation(name, operator, off):
    bb = createBooleanBlock(off, name)
    bb.addArgumentHolder(createBooleanBlockHolder(off, bb))
    bb.addCodeElement(operator, {
        gettext_noop('and'): 'and_',
        gettext_noop('or'): 'or_'
    })
    bb.addArgumentHolder(createBooleanBlockHolder(off, bb))
    return bb
Ejemplo n.º 4
0
def logicConstant(name, operator, off):
    bb = createBooleanBlock(off, name)
    bb.addCodeElement(operator, {
        gettext_noop('TRUE'): 'true_',
        gettext_noop('FALSE'): 'false_'
    }, {
        gettext_noop('T'): gettext_noop('TRUE'),
        gettext_noop('F'): gettext_noop('FALSE')
    })
    return bb
Ejemplo n.º 5
0
def relationalOperation(name, operator, off):
    bb = createBooleanBlock(off, name)
    bb.addArgumentHolder(createNumberBlockHolder(off, bb))
    bb.addCodeElement(
        operator, {
            '=': 'equals',
            '<': 'lesser',
            '>': 'greater',
            '&le;': 'lesser_equals',
            '&ge;': 'greater_equals',
            '&ne;': 'not_equals'
        })
    bb.addArgumentHolder(createNumberBlockHolder(off, bb))
    return bb
Ejemplo n.º 6
0
def getLogicVar(off=False):
    bb = createBooleanBlock(off, 'getLogicVar', 'red')
    bb.addCodeElement()
    bb.addVariableElement(TITLE_LOGIC_VAR, logicVars)
    bb.addCodeElement()
    return bb
Ejemplo n.º 7
0
def available(off=False):
    bb = createBooleanBlock(off, 'available', 'darkblue')
    bb.addCodeElement('o monior serial recebeu msg')
    return bb
Ejemplo n.º 8
0
def alphanumericOperation(name, operator, off):
    bb = createBooleanBlock(off, name, 'darkblue')
    bb.addArgumentHolder(createStringBlockHolder(off, bb))
    bb.addCodeElement(operator, {'=': 'str_equals', '&ne;': 'str_not_equals'})
    bb.addArgumentHolder(createStringBlockHolder(off, bb))
    return bb
Ejemplo n.º 9
0
def irReceived(off=False):
    bb = createBooleanBlock(off, 'irReceived', 'purple')
    bb.addCodeElement('o')
    bb.addVariableElement('infravermelho', countComponents, 'component_IR')
    bb.addCodeElement('recebeu sinal')
    return bb
Ejemplo n.º 10
0
def keyPressed(off=False):
    bb = createBooleanBlock(off, 'keyPressed', 'purple')
    bb.addCodeElement('o')
    bb.addVariableElement('teclado', countComponents, 'component_keypad')
    bb.addCodeElement('foi pressionado')
    return bb
Ejemplo n.º 11
0
def getJoystickSW(off=False):
    nb = createBooleanBlock(off, 'getJoystickSW', 'purple')
    nb.addCodeElement('o')
    nb.addVariableElement('joystick', countComponents, 'component_joystick')
    nb.addCodeElement('est&aacute; pressionado')
    return nb
Ejemplo n.º 12
0
def digitalRead(off=False):
    bb = createBooleanBlock(off, 'digitalRead', 'purple')
    bb.addCodeElement(gettext_noop('digital pin'))
    bb.addArgumentHolder(createDropdownNumberBlockHolder(off, ALL_PINS, bb))
    bb.addCodeElement()
    return bb
Ejemplo n.º 13
0
def not_(off=False):
    bb = createBooleanBlock(off, 'not_')
    bb.addCodeElement(gettext_noop('not'))
    bb.addArgumentHolder(createBooleanBlockHolder(off, bb))
    return bb