Пример #1
0
def main(cmd_args):
    '''
    Entry point of application; in here we spawn the sensor threads, AI thread and
    realtime data processing thread and then wait till we need to quit
    :param cmd_args: dictionary of expected command line arguments
    :return: 0 on success and non-zero on error
    '''
    data_proc_queue = Queue()
    tty = display.TextTerminalDisplay()
    notification_man = notification_manager.FlexibleNotificationManager(
        Contact('Nurse Suzy', None, None, None),
        notifications_sender.MockSMSSender(),
        notifications_sender.MockTelegramSender(),
        notifications_sender.MockEmailSender())
    database = InMemorySimpleDatabase()
    ai_engine = prediction_engine_He_Li.PredictionEngine(
        10, notification_man, database)
    pulse_reader = sensor_readers.BloodPulseSensorReader(
        1, data_proc_queue, tty, database)
    oxy_reader = sensor_readers.BloodOxygenSensorReader(
        4, data_proc_queue, tty, database)
    pressure_reader = sensor_readers.BloodPressureSensorReader(
        2, data_proc_queue, tty, database)
    real_time_proc = realtime_data_processor.RealTimeDataProcessor(
        data_proc_queue, notification_man)
    pulse_reader.start()
    oxy_reader.start()
    pressure_reader.start()
    real_time_proc.start()
    ai_engine.start()
    oxy_reader.join()
    pressure_reader.join()
    pulse_reader.join()
    real_time_proc.join()
    return 0
Пример #2
0
def main(cmd_args):
    data_queue = Queue()
    text_display = display.TextTerminalDisplay()
    notifications = notification_manager.FlexibleNotificationManager(
        Contact("Nurse Nancy", "NancySMS", "NancyTEL", "NancyEMAIL"),
        notifications_sender.MockSMSSender(),
        notifications_sender.MockTelegramSender(),
        notifications_sender.MockEmailSender())
    oxygen_sensor = sensors.BloodOxygenSensorReader(2, data_queue,
                                                    text_display)
    processing = realtime_data_processor.RealTimeDataProcessor(
        data_queue, notifications)
    oxygen_sensor.start()
    processing.start()
    oxygen_sensor.join()
    return 0
Пример #3
0
def main(cmd_args):
    '''
    Entry point of application; in here we spawn the sensor threads, AI thread and
    realtime data processing thread and then wait till we need to quit
    :param cmd_args: dictionary of expected command line arguments
    :return: 0 on success and non-zero on error
    '''
    settings.init()
    settings.sender_email = input("Type sender email and press enter:")
    settings.receiver_email = input("Type reciever email and press enter:")
    settings.password = input(
        "Type sender password for email and press enter:")
    settings.phone = input("Type reciever phone number:")

    data_proc_queue = Queue()
    tty = display.TextTerminalDisplay()
    notification_man = notification_manager.FlexibleNotificationManager(
        Contact('Nurse Suzy', None, None, None),
        notifications_sender.MockSMSSender(),
        notifications_sender.MockTelegramSender(),
        notifications_sender.MockEmailSender())
    pulse_reader = sensors.BloodPulseSensorReader(1, data_proc_queue, tty)
    oxy_reader = sensors.BloodOxygenSensorReader(4, data_proc_queue, tty)
    pressure_reader = sensors.BloodPressureSensorReader(
        2, data_proc_queue, tty)
    real_time_proc = realtime_data_processor.RealTimeDataProcessor(
        data_proc_queue, notification_man)
    pulse_reader.start()
    oxy_reader.start()
    pressure_reader.start()
    real_time_proc.start()
    oxy_reader.join()
    pressure_reader.join()
    pulse_reader.join()
    real_time_proc.join()
    return 0