lecore 0.2.1__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lecore-0.2.1/src/lecore.egg-info → lecore-0.2.2}/PKG-INFO +5 -3
- {lecore-0.2.1 → lecore-0.2.2}/README.md +55 -53
- {lecore-0.2.1 → lecore-0.2.2}/pyproject.toml +1 -1
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/LeBinDev.py +2 -2
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/ModbusDev.py +10 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/QUICKSTART.md +1 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Scaffold.py +583 -520
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/VisualModbus/AppLogging.py +35 -11
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/VisualModbus/ReadWrite.py +1 -1
- {lecore-0.2.1 → lecore-0.2.2/src/lecore.egg-info}/PKG-INFO +5 -3
- {lecore-0.2.1 → lecore-0.2.2}/LICENSE +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/MANIFEST.in +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/setup.cfg +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/DeviceBase.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/PhaseDet/ComSettings.json +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/PhaseDet/PhaseDet.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/PhaseDet/PhaseDetRegs.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/PhaseDet/PhaseDet_Modbus.json +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/PhaseDet/UpgradeSettings.json +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/PhaseDet/VisualSettings.json +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/PhaseDet/__init__.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/Rftb/ComSettings.json +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/Rftb/Rftb.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/Rftb/RftbLeBin.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/Rftb/UpgradeSettings.json +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/Rftb/VisualSettings.json +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/Rftb/__init__.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/Rftb/rftbRegs.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/Rftb/rftb_Modbus.json +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/Rftb/rftb_registers.json +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/RtdEmul/ComSettings.json +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/RtdEmul/RtdEmul.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/RtdEmul/RtdEmulRegs.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/RtdEmul/RtdEmul_Modbus.json +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/RtdEmul/UpgradeSettings.json +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/RtdEmul/VisualSettings.json +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/RtdEmul/__init__.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/Validation.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/VmsRtd/ComSettings.json +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/VmsRtd/UpgradeSettings.json +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/VmsRtd/VMS_RTDRegs.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/VmsRtd/VMS_RTD_Modbus.json +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/VmsRtd/VisualSettings.json +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/VmsRtd/VmsRtd.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/VmsRtd/__init__.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Devices/__init__.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Doc/ModbusTable.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Doc/__init__.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Fg320/Fg320.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Fg320/__init__.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/LeBin/RegisterMap.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/LeBin/SerialCom.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/LeBin/UpgradeFirmware.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/LeBin/VisualLeBin.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/LeBin/__init__.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/Looger.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/TestFrame/CoreTest.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/TestFrame/ModbusUnitTest.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/TestFrame/RtuClient.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/TestFrame/Runner.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/TestFrame/TestUtils.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/TestFrame/__init__.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/VisualModbus/Crc32.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/VisualModbus/HelpAbout.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/VisualModbus/MbClient.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/VisualModbus/MbUpgrade.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/VisualModbus/RegMap.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/VisualModbus/TextMbApp.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/VisualModbus/TextMbAppCss.tcss +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/VisualModbus/VisualMbApp.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/VisualModbus/VmSettings.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/VisualModbus/__init__.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/__init__.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/__main__.py +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore/py.typed +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore.egg-info/SOURCES.txt +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore.egg-info/dependency_links.txt +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore.egg-info/entry_points.txt +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore.egg-info/requires.txt +0 -0
- {lecore-0.2.1 → lecore-0.2.2}/src/lecore.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lecore
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Logic Elements core utilities
|
|
5
5
|
Author-email: Jan Bartovský <jan.bartovsky@logicelements.cz>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -34,6 +34,7 @@ Dynamic: license-file
|
|
|
34
34
|
|
|
35
35
|
# LE core package
|
|
36
36
|
|
|
37
|
+
[](https://github.com/LogicElements/lecore/actions/workflows/ci.yml)
|
|
37
38
|
[](https://pypi.org/project/lecore/)
|
|
38
39
|
[](https://pypi.org/project/lecore/)
|
|
39
40
|
[](LICENSE)
|
|
@@ -76,11 +77,12 @@ New device class (in the directory with the register map): `python -m lecore new
|
|
|
76
77
|
|
|
77
78
|
## Documentation
|
|
78
79
|
|
|
79
|
-
- [Devices](doc/devices.md) - RTD Emulator, VMS-1502 RTD Meter, Phase Detector, FG-320
|
|
80
80
|
- [Creating a new device](doc/new-device.md)
|
|
81
|
-
- [
|
|
81
|
+
- [Device API](doc/api.md) - Modbus and LeBin device: read, write, firmware upgrade
|
|
82
82
|
- [User interfaces](doc/user-interfaces.md) - graphical and terminal register browser
|
|
83
|
+
- [Devices](doc/devices.md) - RTD Emulator, VMS-1502 RTD Meter, Phase Detector, FG-320
|
|
83
84
|
- [Build and release](doc/build.md)
|
|
85
|
+
- [Looger](doc/looger.md)
|
|
84
86
|
|
|
85
87
|
## License
|
|
86
88
|
|
|
@@ -1,53 +1,55 @@
|
|
|
1
|
-
# LE core package
|
|
2
|
-
|
|
3
|
-
[
|
|
47
|
-
- [
|
|
48
|
-
- [User interfaces](doc/user-interfaces.md) - graphical and terminal register browser
|
|
49
|
-
- [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
# LE core package
|
|
2
|
+
|
|
3
|
+
[](https://github.com/LogicElements/lecore/actions/workflows/ci.yml)
|
|
4
|
+
[](https://pypi.org/project/lecore/)
|
|
5
|
+
[](https://pypi.org/project/lecore/)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
Core Python utilities for Logic Elements:
|
|
9
|
+
- Looger client
|
|
10
|
+
- Proprietary LeBin protocol
|
|
11
|
+
- Proprietary Modbus RTU register map handling - VisualModbus
|
|
12
|
+
- Test frame
|
|
13
|
+
- Logic Elements devices
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
Requires Python 3.9 or newer.
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
pip install lecore
|
|
21
|
+
pip install --upgrade lecore
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Optional extras: `lecore[extra]` (graphical UI, Word documentation) and `lecore[tui]` (terminal UI).
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
import lecore.Devices.RtdEmul as RE
|
|
30
|
+
|
|
31
|
+
# Create RTD emulator object and open communication at COM2 (default is COM1)
|
|
32
|
+
rtd = RE.RtdEmul()
|
|
33
|
+
rtd.open(comport='COM2')
|
|
34
|
+
|
|
35
|
+
# Read serial number
|
|
36
|
+
sn = rtd.read(RE.Reg.FACT_SERIAL_NUMBER)
|
|
37
|
+
|
|
38
|
+
# Write emulated temperature at output 1
|
|
39
|
+
rtd.write(RE.Reg.EMUL_TEMPERATURE_1, 30.5)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
New device class (in the directory with the register map): `python -m lecore new-device MyDevice`, quick guide: `python -m lecore guide`.
|
|
43
|
+
|
|
44
|
+
## Documentation
|
|
45
|
+
|
|
46
|
+
- [Creating a new device](doc/new-device.md)
|
|
47
|
+
- [Device API](doc/api.md) - Modbus and LeBin device: read, write, firmware upgrade
|
|
48
|
+
- [User interfaces](doc/user-interfaces.md) - graphical and terminal register browser
|
|
49
|
+
- [Devices](doc/devices.md) - RTD Emulator, VMS-1502 RTD Meter, Phase Detector, FG-320
|
|
50
|
+
- [Build and release](doc/build.md)
|
|
51
|
+
- [Looger](doc/looger.md)
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
MIT, see [LICENSE](LICENSE).
|
|
@@ -228,8 +228,8 @@ class LeBinDev(DeviceBase):
|
|
|
228
228
|
check_file(file, "File to send")
|
|
229
229
|
# Run upgrade procedure
|
|
230
230
|
self._upg.load_file(file)
|
|
231
|
-
|
|
232
|
-
return
|
|
231
|
+
# LeBin upgrade returns True on success (unlike Modbus return code 0)
|
|
232
|
+
return bool(self._upg.run())
|
|
233
233
|
|
|
234
234
|
def _visual(self) -> None:
|
|
235
235
|
"""
|
|
@@ -190,6 +190,16 @@ class ModbusDev(DeviceBase):
|
|
|
190
190
|
self.close()
|
|
191
191
|
return self._vis.handle(timeout)
|
|
192
192
|
|
|
193
|
+
def enable_log(self, enable: bool = True, directory: Optional[PathLike] = None) -> None:
|
|
194
|
+
"""
|
|
195
|
+
Enable or disable logging of communication into file (disabled by default)
|
|
196
|
+
:param enable: True to enable, False to disable logging into file
|
|
197
|
+
:param directory: Directory of log files, default 'log/' in current working directory
|
|
198
|
+
"""
|
|
199
|
+
if self._vis is None:
|
|
200
|
+
raise RuntimeError(f"{type(self).__name__}: device is not initialized")
|
|
201
|
+
self._vis.log.enable_file(enable, directory)
|
|
202
|
+
|
|
193
203
|
def textual(self) -> None:
|
|
194
204
|
"""
|
|
195
205
|
Run textual user interface application
|
|
@@ -29,6 +29,7 @@ Python API: `lecore.new_device("MyDevice", directory=".", ...)` returns `{path:
|
|
|
29
29
|
| `VisualSettings.json` | created if missing (Modbus only) - GUI settings incl. default `slave_address` |
|
|
30
30
|
| `__init__.py` | created if missing - exports device class, register class and alias `Reg`; existing one is not changed |
|
|
31
31
|
| `__main__.py` | created if missing - command line: `python -m <package> [--comport COM5] [--slave 3] [--read NAME ...] [--list] [--gui \| --tui]` |
|
|
32
|
+
| `CLAUDE.md` | created if missing - short API and command line notes (Modbus/LeBin) for AI assistants; existing one is not changed |
|
|
32
33
|
|
|
33
34
|
Run it from the package directory as `python . [options]`, or from its parent as `python -m mydevice [options]`;
|
|
34
35
|
without options all registers are read and printed. `python MyDevice.py` does not work (relative imports).
|