Compare commits

..

No commits in common. "7e0d85acc735e7f91b0dc4c5a0f0f2784e23ebd0" and "b750e80c80afc91e679662031f9de9c77f4546bd" have entirely different histories.

3 changed files with 4 additions and 13 deletions

View File

@ -41,23 +41,14 @@ nucon.set_dummy_mode(True)
# Read a parameter
core_temp = nucon.CORE_TEMP.value
print(f"Core Temperature: {core_temp}")
# >> Core Temperature: 500.0
# Read a parameter with an enum type
pump_status = nucon.COOLANT_CORE_CIRCULATION_PUMP_0_STATUS.value
print(f"Pump 0 Status: {pump_status}")
if nucon.COOLANT_CORE_CIRCULATION_PUMP_0_STATUS.value:
print('Pump 0 is active.')
# >> Pump 0 Status: PumpStatus.INACTIVE
# Write to a parameter (has no effect in dummy mode)
# Write to a parameter
nucon.RODS_POS_ORDERED.value = 50
print(f"Rods Position Ordered: {nucon.RODS_POS_ORDERED.value}")
# >> Rods Position Ordered: 50.0
# The repr of an attribute contains all contained info
nucon.CORE_TEMP
# >> NuconParameter(id='CORE_TEMP', value=500.0, param_type=float, writable=False)
```
## API Reference
@ -83,7 +74,7 @@ Class methods:
- `nucon.get_all_iter()`: Get all parameter values as a dictionary as a generator
- `nucon.get_multiple(params)`: Get values for multiple specified parameters
- `nucon.get_multiple_iter(params)`: Get values for multiple specified parameters as a generator
- `nucon.set_dummy_mode(dummy_mode)`: Enable or disable dummy mode for testing. In dummy mode we won't connect to the game and just return sensible values for all params and allow but ignore all writes to writable parameters.
- `nucon.set_dummy_mode(dummy_mode)`: Enable or disable dummy mode for testing
Custom Enum Types:
- `PumpStatus`: Enum for pump status (INACTIVE, ACTIVE_NO_SPEED_REACHED\*, ACTIVE_SPEED_REACHED\*, REQUIRES_MAINTENANCE, NOT_INSTALLED, INSUFFICIENT_ENERGY)

View File

@ -1 +1 @@
from nucon.core import Nucon, PumpStatus, PumpDryStatus, PumpOverloadStatus, PumpOverloadStatus, CoreState, CoolantCoreState, RodsState, NuconParameter
from nucon.core import *

View File

@ -99,7 +99,7 @@ class NuconParameter:
self.nucon.set(self, new_value, force)
def __repr__(self):
return f"NuconParameter(id='{self.id}', value={self.value}, param_type={self.param_type.__name__}, writable={self.is_writable})"
return f"NuconParameter(id='{self.id}', value={self.value}, type={self.param_type.__name__}, writable={self.is_writable})"
def __str__(self):
return self.id