Ejemplo n.º 1
0
    def __init__(self, codenames=None):
        threading.Thread.__init__(self)

        import ramp
        self.ramp = ramp.ramp()
        self.run_ramp = False
        if codenames == None:
            codenames = [
                'tabs_guard_temperature_setpoint',
                'tabs_floor_temperature_setpoint',
                'tabs_ceiling_temperature_setpoint',
                'tabs_cooling_temperature_setpoint',
                'tabs_all_control_active',
            ]
        self.screen = curses.initscr()
        self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        self.sock.settimeout(3)
        self.codenames = codenames
        self.active_channel = None
        curses.noecho()
        curses.cbreak()
        curses.curs_set(False)
        self.screen.keypad(1)
        self.screen.nodelay(1)
        self.time = time.time()
        self.countdown = False
        self.last_key = None
        self.quit = False
        self.active = False
        self.ttl = 50
        self.SYSTEMS = {}
        sys = [
            'tabs_guard', 'tabs_floor', 'tabs_ceiling', 'tabs_cooling',
            'tabs_ice'
        ]
        vals = [
            'temperature_inlet', 'temperature_outlet', 'temperature_setpoint',
            'valve_cooling', 'valve_heating', 'pid_value', 'water_flow'
        ]
        for sy in sys:
            for val in vals:
                self.SYSTEMS[sy + '_' + val] = None
        #        {sy + '_'+'temperature_inlet': None, # float in C
        #                        'temperature_outlet': None, # float in C
        #                        'temperature_setpoint': None, # float in C
        #                        'valve_cooling': None, # float 0-1
        #                        'valve_heating': None, # float 0-1
        #                        'pid_value': None, # float -1-1
        #                        'water_flow': None} # float in l/min
        self.update_ramp()
Ejemplo n.º 2
0
 def __init__(self, codenames=None):
     threading.Thread.__init__(self)
     
     import ramp
     self.ramp = ramp.ramp()
     self.run_ramp = False
     if codenames == None:
         codenames = ['tabs_guard_temperature_setpoint',
                  'tabs_floor_temperature_setpoint',
                  'tabs_ceiling_temperature_setpoint',
                  'tabs_cooling_temperature_setpoint',
                  'tabs_all_control_active',
                  ]
     self.screen = curses.initscr()
     self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
     self.sock.settimeout(3)
     self.codenames = codenames
     self.active_channel = None
     curses.noecho()
     curses.cbreak()
     curses.curs_set(False)
     self.screen.keypad(1)
     self.screen.nodelay(1)
     self.time = time.time()
     self.countdown = False
     self.last_key = None
     self.quit = False
     self.active = False
     self.ttl = 50
     self.SYSTEMS = {}
     sys = ['tabs_guard', 'tabs_floor', 'tabs_ceiling', 'tabs_cooling', 'tabs_ice']
     vals = ['temperature_inlet', 'temperature_outlet', 'temperature_setpoint', 'valve_cooling', 'valve_heating', 'pid_value', 'water_flow']
     for sy in sys:
         for val in vals:
             self.SYSTEMS[sy + '_' + val] = None
     #        {sy + '_'+'temperature_inlet': None, # float in C
     #                        'temperature_outlet': None, # float in C
     #                        'temperature_setpoint': None, # float in C
     #                        'valve_cooling': None, # float 0-1
     #                        'valve_heating': None, # float 0-1
     #                        'pid_value': None, # float -1-1
     #                        'water_flow': None} # float in l/min
     self.update_ramp()
Ejemplo n.º 3
0
 def load_ramp(self,):
     """ load a ramp defined in external script"""
     import ramp
     reload(ramp)
     self.ramp = ramp.ramp()
     self.run_ramp = True
Ejemplo n.º 4
0
 def load_ramp(self, ):
     """ load a ramp defined in external script"""
     import ramp
     reload(ramp)
     self.ramp = ramp.ramp()
     self.run_ramp = True