refactor: move hendiCtrl.py's main() into scripts/hendi_ctrl_app.py
hendiCtrl.py is now import-only. The new CLI app exposes serial port/baudrate, version/capability info, converter test, heater test, and firmware update as separate flags, instead of one fixed script. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GpePKZiEZWbGo9HrfuML6U
This commit is contained in:
@@ -187,53 +187,3 @@ class HendiCtrl:
|
||||
|
||||
def close(self):
|
||||
self.remoteEnable(False)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
hendi = HendiCtrl('/dev/ttyUSB0', 115200)
|
||||
|
||||
# hendi.firmware_update("HendiCtrl.srec")
|
||||
# hendi.reset()
|
||||
time.sleep(1)
|
||||
|
||||
hendi.getState()
|
||||
hendi.getSoftwareIdentifier()
|
||||
hendi.getSoftwareVersion()
|
||||
caps = hendi.getCapabilties()
|
||||
print("Caps: ", caps)
|
||||
info = hendi.getInfo()
|
||||
print("Info: ", info)
|
||||
|
||||
print("Test converters")
|
||||
for pwr in range(500, 3600, 100):
|
||||
print("pwr", pwr)
|
||||
digits = hendi.toDigits(pwr)
|
||||
print("digits", digits)
|
||||
power = hendi.toWatts(digits)
|
||||
print("power", power)
|
||||
|
||||
print("Test Hendi")
|
||||
with hendi.remote_open():
|
||||
hendi.setSwitch(1)
|
||||
time.sleep(1.0)
|
||||
for pwr in range(500, 3600, 100):
|
||||
hendi.setPowerWatts(pwr)
|
||||
pw = hendi.getPowerWatts()
|
||||
print("power_w", pw)
|
||||
time.sleep(1.0)
|
||||
|
||||
hendi.setSwitch(0)
|
||||
|
||||
if 0:
|
||||
hendi.remoteEnable(True)
|
||||
if hendi.isRemoteEnable():
|
||||
hendi.setSwitch(True)
|
||||
for p in range(0, 4096, 100):
|
||||
hendi.setPowerDigits(p)
|
||||
time.sleep(1)
|
||||
|
||||
hendi.setSwitch(False)
|
||||
hendi.remoteEnable(False)
|
||||
|
||||
print("End of program.")
|
||||
|
||||
Reference in New Issue
Block a user