Exemplo n.º 1
0
def _set_run(capstone_ion, password_ion, value, asyncOK):
    turbine = capstone_ion.turbine
    if value == 1:
        # Start running...
        utlcon = command.UTLCON(turbine, 2)
        medbtu = command.MEDBTU(turbine, 1)
        autrst = command.AUTRST(turbine, 1)
        strcmd = command.STRCMD(turbine, 1)
        response = capstone_ion.line_handler.command(utlcon)
        response = capstone_ion.line_handler.command(medbtu)
        response = capstone_ion.line_handler.command(autrst)
        response = capstone_ion.line_handler.command(strcmd)
    elif value == 0:
        strcmd = command.STRCMD(turbine, 0)
        response = capstone_ion.line_handler.command(strcmd)
    else:
        raise EInvalidValue, ('run', value)
Exemplo n.º 2
0
def start(line_handler, turbine=0):
    l = line_handler
    r = l.command(command.PSSWRD(turbine, 'USR123P'))
    print 'protect mode', r.is_protect()
    r = l.command(command.UTLCON(turbine, 2))  # Set grid connect mode?
    print 'utility connection number', r.utility_connection_value()
    r = l.command(command.MEDBTU(turbine, 1))
    print 'mode', r.mode()
    r = l.command(command.AUTRST(turbine, 1))
    print 'auto restart', r.auto_restart()
    #r = l.command(command.WFRAMP(turbine,5)) # ?
    #print 'can start', r.can_start()
    r = l.command(command.STRCMD(
        turbine, 1))  # Starts/stops the turbine (if USRSTR allows).
    print 'will start', r.will_start()
Exemplo n.º 3
0
 def _create_single_children(self):
     SingleValueCommand(self, 'password', command.PSSWRD(self.turbine),
                        _get_password_mode, _set_password)
     SingleValueCommand(self, 'run', command.STRCMD(self.turbine),
                        _get_will_start, _set_run)
     cache = RO_CommandCache(self, self.line_handler,
                             command.SYSSSL(self.turbine))
     response_base = 'self.cached_response().'
     _cache_roc_by_name(cache, response_base, 'system_severity_level')
     cache = RO_CommandCache(self, self.line_handler,
                             command.SYSSTA(self.turbine))
     response_base = 'self.cached_response().'
     _cache_roc_by_name(cache, response_base, 'current_system_state_string')
     cache = RO_CommandCache(self, self.line_handler,
                             command.WARNTY(self.turbine))
     response_base = 'self.cached_response().'
     _cache_roc_by_name(cache, response_base, 'hours_of_operation')
     _cache_roc_by_name(cache, response_base, 'start_events')
Exemplo n.º 4
0
def stop(line_handler, turbine=0):
    r = l.command(command.PSSWRD(turbine, 'USR123P'))
    print 'protect mode', r.is_protect()
    r = l.command(command.STRCMD(turbine, 0))  # Stop the turbine.
    print 'will start', r.will_start()
Exemplo n.º 5
0
    for i in c.children_names():
        print i, c.get_child(i).get()


r = l.command(command.ALLDAT())

for sr in r._line_map.keys():
    print r._get_response(sr)

r = l.command(command.PSSWRD(0, 'USR123P'))
print 'protect mode', r.is_protect()

r = l.command(command.USRSTR())  # Checks user-start.
print 'can start', r.can_start()

r = l.command(command.STRCMD())  # Starts/stops the turbine (if USRSTR allows).
print 'will start', r.will_start()

r = l.command(command.LOGOFF())
print 'reset', r.reset()


def start(line_handler, turbine=0):
    l = line_handler
    r = l.command(command.PSSWRD(turbine, 'USR123P'))
    print 'protect mode', r.is_protect()
    r = l.command(command.UTLCON(turbine, 2))  # Set grid connect mode?
    print 'utility connection number', r.utility_connection_value()
    r = l.command(command.MEDBTU(turbine, 1))
    print 'mode', r.mode()
    r = l.command(command.AUTRST(turbine, 1))