예제 #1
0
    processor.set_default_calibrator("/YSS/SIMULATOR/BatteryVoltage2",
                                     "polynomial", [1, 0.1])


def reset_calibrator():
    """Reset the calibrator to the original MDB value."""
    processor.reset_calibrators("/YSS/SIMULATOR/BatteryVoltage2")


def clear_calibrator():
    """Clear(remove) the calibrator."""
    processor.clear_calibrators("/YSS/SIMULATOR/BatteryVoltage2")


if __name__ == "__main__":
    client = YamcsClient("localhost:8090")
    processor = client.get_processor(instance="simulator",
                                     processor="realtime")

    subscribe_param()
    sleep(5)
    print("Set calibrator")
    set_calibrator()
    sleep(10)
    print("Remove calibrator")
    clear_calibrator()
    sleep(10)
    print("reset calibrator to original MDB value")
    reset_calibrator()
    sleep(10)
예제 #2
0
from time import sleep

from yamcs.client import YamcsClient

# This demonstrates how to use a single command history subscription to
# follow the acknowledgments of multiple commands.

if __name__ == "__main__":
    client = YamcsClient("localhost:8090")
    processor = client.get_processor("simulator", "realtime")

    # Start to listen to command history
    history_subscription = processor.create_command_history_subscription()

    commands = []

    # Submit a few commands
    for i in range(5):
        command = processor.issue_command("/YSS/SIMULATOR/SWITCH_VOLTAGE_OFF",
                                          args={"voltage_num": 1})
        commands.append(command)
        print("Issued", command)

        command = processor.issue_command("/YSS/SIMULATOR/SWITCH_VOLTAGE_ON",
                                          args={"voltage_num": 1})
        commands.append(command)
        print("Issued", command)

    while True:
        print("------")
        for command in commands:
예제 #3
0
def set_alarms():
    """Set the default (i.e. non-contextual) limits for the parameter."""
    processor.set_default_alarm_ranges('/YSS/SIMULATOR/BatteryVoltage2', watch=(-10, 10), critical=(-100, None))
 
def clear_alarm_ranges():
    """Clear(remove) all limits for the parameter. Note that if the is an alarm being triggered, it is not automatically acknowledged."""
    processor.clear_alarm_ranges('/YSS/SIMULATOR/BatteryVoltage2')

def reset_alarms():
    """Reset the alarm limits for the parameter to the original MDB value."""
    processor.reset_alarm_ranges('/YSS/SIMULATOR/BatteryVoltage2')

if __name__ == '__main__':
    client = YamcsClient('localhost:8090')
    processor = client.get_processor(instance='simulator',
                                     processor='realtime')

    subscribe_param()
    sleep(5)
    
    print('Set alarms')
    set_alarms()
    sleep(10)

    print('Clear(remove) all alarms')
    clear_alarm_ranges()
    sleep(10)
    
    print('reset alarms to their MDB value')
    reset_alarms()
    sleep(10)
예제 #4
0
# fmt: off
import sys

from yamcs.client import YamcsClient

if __name__ == '__main__':
    client = YamcsClient('localhost:8090')
    processor = client.get_processor('simulator', 'realtime')

    conn = processor.create_command_connection()

    while True:
        command = conn.issue('/YSS/SIMULATOR/SWITCH_VOLTAGE_OFF',
                             args={
                                 'voltage_num': 1,
                             })

        sys.stdout.write(command.id)
        sys.stdout.write(' ... ')
        sys.stdout.flush()

        ack = command.await_acknowledgment('Acknowledge_Queued')
        sys.stdout.write(str(ack))
        sys.stdout.write(' ... ')
        sys.stdout.flush()

        if ack.status == 'OK':
            ack = command.await_acknowledgment('Acknowledge_Sent')
            sys.stdout.write(str(ack))
            sys.stdout.write(' ... ')
            sys.stdout.flush()