Compare commits

..

13 Commits

Author SHA1 Message Date
e4ad9bf271 README: Introduce Thermostat GUI
Co-authored-by: topquark12 <aw@m-labs.hk>
2024-11-25 18:08:17 +08:00
28df792cdc PyThermostat GUI: Set up packaging
Co-authored-by: Egor Savkin <es@m-labs.hk>
2024-11-25 18:08:17 +08:00
0d58d70607 PyThermostat GUI: Implement Control Panel
Co-authored-by: linuswck <linuswck@m-labs.hk>
Co-authored-by: Egor Savkin <es@m-labs.hk>
2024-11-25 18:08:17 +08:00
d948d1d0a0 PyThermostat GUI: Implement PlotSettingsMenu
Co-authored-by: linuswck <linuswck@m-labs.hk>
2024-11-25 18:08:17 +08:00
232fe19ae4 PyThermostat GUI: Implement plotting
Co-authored-by: linuswck <linuswck@m-labs.hk>
2024-11-25 18:08:17 +08:00
063dbc43a4 PyThermostat GUI: Incorporate autotuning
Co-authored-by: topquark12 <aw@m-labs.hk>
Co-authored-by: linuswck <linuswck@m-labs.hk>
Co-authored-by: Egor Savkin <es@m-labs.hk>
2024-11-25 18:08:17 +08:00
1b6939ee30 PyThermostat GUI: Implement ThermostatSettingsMenu
Co-authored-by: linuswck <linuswck@m-labs.hk>
Co-authored-by: Egor Savkin <es@m-labs.hk>
2024-11-25 18:08:17 +08:00
dd22470a30 PyThermostat GUI: Implement status line
Co-authored-by: linuswck <linuswck@m-labs.hk>
Co-authored-by: Egor Savkin <es@m-labs.hk>
2024-11-25 18:08:17 +08:00
a2b8a85244 PyThermostat: Create GUI to Thermostat
- Add connection menu

- Add basic GUI layout skeleton

Co-authored-by: linuswck <linuswck@m-labs.hk>
Co-authored-by: Egor Savkin <es@m-labs.hk>
2024-11-25 18:08:17 +08:00
62d3666275 PyThermostat: Create asyncio clients 2024-11-25 15:48:23 +08:00
8cba8d8717 flake: Add PyThermostat to devShell
Make Python scripts in PyThermostat available in the development shell
(thermostat_plot, thermostat_autotune, and thermostat_test).
2024-11-25 15:48:19 +08:00
e6a9ce7fe5 flake: Add PyThermostat to PYTHONPATH in devshell
For easier testing of PyThermostat code in the development shell, so
that the following is possible right in the repo root:

```
$ python -m pythermostat.plot
Channel 0 target temperature: 25.000
$ python
Python 3.11.9 (main, Apr  2 2024, 08:25:04) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pythermostat.client import Client
>>> c = Client()
>>> c
<pythermostat.client.Client object at 0x7f9a41cab190>
>>>
```
2024-11-25 15:48:19 +08:00
130bde480e PyThermostat: Replace setup.py with pyproject.toml 2024-11-25 13:14:54 +08:00
4 changed files with 13 additions and 6 deletions

View File

@ -78,7 +78,7 @@
dontWrapQtApps = true; dontWrapQtApps = true;
postFixup = '' postFixup = ''
wrapQtApp "$out/bin/tec_qt" wrapQtApp "$out/bin/thermostat_qt"
''; '';
}; };
@ -105,7 +105,7 @@
apps.x86_64-linux.thermostat_gui = { apps.x86_64-linux.thermostat_gui = {
type = "app"; type = "app";
program = "${self.packages.x86_64-linux.pythermostat}/bin/tec_qt"; program = "${self.packages.x86_64-linux.pythermostat}/bin/thermostat_qt";
}; };
hydraJobs = { hydraJobs = {
@ -130,7 +130,11 @@
pyqt6 pyqt6
qasync qasync
pglive pglive
pythermostat
]); ]);
shellHook = ''
export PYTHONPATH=`git rev-parse --show-toplevel`/pythermostat:$PYTHONPATH
'';
}; };
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style; formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;

View File

@ -10,10 +10,13 @@ description = "Control TEC"
urls.Repository = "https://git.m-labs.hk/M-Labs/thermostat" urls.Repository = "https://git.m-labs.hk/M-Labs/thermostat"
license = {text = "GPLv3"} license = {text = "GPLv3"}
[project.gui-scripts]
thermostat_plot = "pythermostat.plot:main"
thermostat_qt = "pythermostat.thermostat_qt:main"
[project.scripts] [project.scripts]
thermostat_autotune = "pythermostat.autotune:main" thermostat_autotune = "pythermostat.autotune:main"
thermostat_test = "pythermostat.test:main" thermostat_test = "pythermostat.test:main"
[project.gui-scripts] [tool.setuptools]
thermostat_plot = "pythermostat.plot:main" packages.find = {}
thermostat_qt = "pythermostat.thermostat_qt:main"

View File

@ -55,7 +55,7 @@ class MainWindow(QtWidgets.QMainWindow):
def __init__(self, args): def __init__(self, args):
super().__init__() super().__init__()
ui_file_path = importlib.resources.files("pythermostat.gui.view").joinpath("tec_qt.ui") ui_file_path = importlib.resources.files("pythermostat.gui.view").joinpath("MainWindow.ui")
uic.loadUi(ui_file_path, self) uic.loadUi(ui_file_path, self)
self._info_box = InfoBox() self._info_box = InfoBox()