Beispiel #1
0
def abstime():
    """
    Returns the current date and time, in seconds, relative to the operating system's epoc.

    **Note**: Only available for RT sequences.
    """
    raise VeristandNotImplementedError()
Beispiel #2
0
def clearlasterror():
    """
    Clears the last error set by :func:`generate_error`.

    **Note**: Only available for RT sequences.
    """
    raise VeristandNotImplementedError()
Beispiel #3
0
def getlasterror():
    """
    Returns the numeric error code of the last error set by :func:`generate_error`.

    **Note**: Only available for RT sequences.
    """
    raise VeristandNotImplementedError()
def recip(x):
    """
    Returns 1/x.

    Args:
        x: divisor.

    **Note**: Only available for RT sequences.
    """
    raise VeristandNotImplementedError()
Beispiel #5
0
def binaryoperator_transformer(node, resources):
    operator = _operator(node.op.__class__.__name__)
    if operator == "unknown":
        raise VeristandNotImplementedError()
    if operator in ('<<', '>>'):
        # Validate only the right hand side, on the left it makes sense to have negative numbers.
        validations.raise_if_negative_binary_operator_operand(
            node.right, resources)
    left = utils.generic_ast_node_transform(node.left, resources)
    right = utils.generic_ast_node_transform(node.right, resources)
    return "((" + left + ") " + operator + " (" + right + "))"
Beispiel #6
0
def booloperator_transformer(node, resources):
    operator = _operator(node.op.__class__.__name__)
    if operator == "unknown":
        raise VeristandNotImplementedError()
    for value in node.values:
        validations.raise_if_invalid_bool_operand(value, resources)
    result = "( " + utils.generic_ast_node_transform(node.values[0],
                                                     resources) + " "
    for o in node.values[1:]:
        op = utils.generic_ast_node_transform(o, resources)
        result += operator + " " + op + " "
    return result + ")"
Beispiel #7
0
def compareoperator_transformer(node, resources):
    left = utils.generic_ast_node_transform(node.left, resources)
    result = "((" + left + ") "
    if len(node.ops) > 1:
        raise TranslateError(
            _errormessages.cascaded_comparison_operators_not_allowed)
    operator = _operator(node.ops[0].__class__.__name__)
    if operator == "unknown":
        raise VeristandNotImplementedError()
    right = utils.generic_ast_node_transform(node.comparators[0], resources)
    result += operator + " (" + right + ")"
    result += ")"
    return result
def clearfault(x):
    """
    Clears all faults set on channel x.

    Args:
        x: the channel you want to clear faults on.

    Channel `x` must be a reference to a channel and should not be a reference to a local variable.
    If `channel` references a local variable, :func:`clearfault` performs no operation.

    **Note**: Only available for RT sequences.
    """
    raise VeristandNotImplementedError()
Beispiel #9
0
def unaryoperator_transformer(node, resources):
    operator = _operator(node.op.__class__.__name__)
    if operator == "unknown":
        raise VeristandNotImplementedError()
    if operator == '!':
        if isinstance(node.operand, ast.UnaryOp):
            validations.raise_if_invalid_bool_operand(node.operand.operand, resources)
        else:
            validations.raise_if_invalid_bool_operand(node.operand, resources)
    if operator == '~':
        validations.raise_if_invalid_invert_operand(node.operand, resources)
    operand = utils.generic_ast_node_transform(node.operand, resources)
    return "(" + operator + "(" + operand + ")" + ")"
Beispiel #10
0
def fix(x):
    """
    Rounds x to the nearest integer between x and zero.

    Args:
        x(float): value you want to round.

    Returns:
        (float): floating-point representation of the rounded value.

    **Note**: Only available for RT sequences.

    """
    raise VeristandNotImplementedError()
def fault(channel, value):
    """
    Faults `channel` with `value`.

    Args:
        channel: channel to fault.
        value(float): value to fault the channel.

    `channel` must be a reference to a channel and should not be a reference to a local variable.
    If `channel` references a local variable, :func:`fault` performs no operation.

    **Note**: Only available for RT sequences.
    """
    raise VeristandNotImplementedError()
Beispiel #12
0
def run_rtseq(toplevelseq, destfolder):
    raise VeristandNotImplementedError()
Beispiel #13
0
def validate_py_as_rtseq(toplevelobj):
    raise VeristandNotImplementedError()
Beispiel #14
0
def save_rtseq_as_py(toplevelseq, srcfolder, destfolder):
    raise VeristandNotImplementedError()