forked from M-Labs/kirdy
Compare commits
2 Commits
3125e7cff0
...
ebe668ded7
Author | SHA1 | Date | |
---|---|---|---|
ebe668ded7 | |||
dda15ac2ea |
@ -67,7 +67,6 @@
|
|||||||
propagatedBuildInputs =
|
propagatedBuildInputs =
|
||||||
[ pkgs.qt6.qtbase ]
|
[ pkgs.qt6.qtbase ]
|
||||||
++ (with pkgs.python3Packages; [
|
++ (with pkgs.python3Packages; [
|
||||||
aenum
|
|
||||||
numpy
|
numpy
|
||||||
pyqtgraph
|
pyqtgraph
|
||||||
pyqt6
|
pyqt6
|
||||||
@ -101,7 +100,7 @@
|
|||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
rust openocd dfu-util glibc
|
rust openocd dfu-util glibc
|
||||||
] ++ (with python3Packages; [
|
] ++ (with python3Packages; [
|
||||||
numpy matplotlib pyqtgraph setuptools pyqt6 qasync pglive aenum sipyco
|
numpy matplotlib pyqtgraph setuptools pyqt6 qasync pglive sipyco
|
||||||
]);
|
]);
|
||||||
shellHook=
|
shellHook=
|
||||||
''
|
''
|
||||||
|
@ -4,10 +4,23 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from aenum import StrEnum, NoAlias
|
from enum import StrEnum, EnumType
|
||||||
import queue
|
import queue
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
|
|
||||||
|
class NoAlias(EnumType):
|
||||||
|
def __call__(cls, value=None, *args, **kwargs):
|
||||||
|
if args == () and kwargs == {} and not isinstance(value, cls):
|
||||||
|
raise TypeError("NoAlias enumerations cannot be looked up by value")
|
||||||
|
return super().__call__(value, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
class NoAliasStrEnum(StrEnum, metaclass=NoAlias):
|
||||||
|
"""StrEnum that cannot be looked up by value."""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class _dt(StrEnum):
|
class _dt(StrEnum):
|
||||||
ip_settings = "ip_settings"
|
ip_settings = "ip_settings"
|
||||||
temp_adc_filter = "temp_adc_filter"
|
temp_adc_filter = "temp_adc_filter"
|
||||||
@ -20,10 +33,10 @@ class State(StrEnum):
|
|||||||
connected = "connected"
|
connected = "connected"
|
||||||
|
|
||||||
class CmdList:
|
class CmdList:
|
||||||
class tec_set_i(StrEnum, settings=NoAlias):
|
class tec_set_i(NoAliasStrEnum):
|
||||||
_target = "tec_set_i"
|
_target = "tec_set_i"
|
||||||
tec_set_i = _dt.f32
|
tec_set_i = _dt.f32
|
||||||
class device(StrEnum, settings=NoAlias):
|
class device(NoAliasStrEnum):
|
||||||
_target = "device_cmd"
|
_target = "device_cmd"
|
||||||
SetIPSettings = _dt.ip_settings
|
SetIPSettings = _dt.ip_settings
|
||||||
SetPdFinGain = _dt.f32
|
SetPdFinGain = _dt.f32
|
||||||
@ -37,7 +50,7 @@ class CmdList:
|
|||||||
LoadFlashSettings = _dt.none
|
LoadFlashSettings = _dt.none
|
||||||
HardReset = _dt.none
|
HardReset = _dt.none
|
||||||
|
|
||||||
class ld(StrEnum, settings=NoAlias):
|
class ld(NoAliasStrEnum):
|
||||||
_target = "laser_diode_cmd"
|
_target = "laser_diode_cmd"
|
||||||
SetDefaultPowerOn = _dt.bool
|
SetDefaultPowerOn = _dt.bool
|
||||||
PowerUp = _dt.none
|
PowerUp = _dt.none
|
||||||
@ -51,7 +64,7 @@ class CmdList:
|
|||||||
SetLdPwrLimit = _dt.f32
|
SetLdPwrLimit = _dt.f32
|
||||||
ClearAlarm = _dt.none
|
ClearAlarm = _dt.none
|
||||||
|
|
||||||
class thermostat(StrEnum, settings=NoAlias):
|
class thermostat(NoAliasStrEnum):
|
||||||
_target = "thermostat_cmd"
|
_target = "thermostat_cmd"
|
||||||
SetDefaultPowerOn = _dt.bool,
|
SetDefaultPowerOn = _dt.bool,
|
||||||
PowerUp = _dt.f32,
|
PowerUp = _dt.f32,
|
||||||
|
@ -10,7 +10,6 @@ description = "Python utilities for the Sinara 1550 Kirdy"
|
|||||||
urls.Repository = "https://git.m-labs.hk/M-Labs/kirdy"
|
urls.Repository = "https://git.m-labs.hk/M-Labs/kirdy"
|
||||||
license = {text = "GPLv3"}
|
license = {text = "GPLv3"}
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aenum >= 3.1.15",
|
|
||||||
"numpy >= 2.0.0",
|
"numpy >= 2.0.0",
|
||||||
"pyqtgraph >= 0.13.7",
|
"pyqtgraph >= 0.13.7",
|
||||||
"pyqt6 >= 6.8.0",
|
"pyqt6 >= 6.8.0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user