Skip to content

Commit

Permalink
Storage Tests completed
Browse files Browse the repository at this point in the history
  • Loading branch information
PauloRadatz committed Oct 7, 2024
1 parent bc9afe3 commit 2e9096a
Show file tree
Hide file tree
Showing 5 changed files with 353 additions and 23 deletions.
7 changes: 7 additions & 0 deletions src/py_dss_interface/configurations.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@
"F"
]
},
{
"name": "Storages",
"types": [
"S",
"F"
]
},

{
"name": "SwtControls",
Expand Down
20 changes: 0 additions & 20 deletions src/py_dss_interface/models/Storages/StoragesF.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,139 +25,119 @@ def _pu_soc_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(0), ctypes.c_double(0)))

def _pu_soc_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(1), ctypes.c_double(argument)))

def _amp_limit_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(2), ctypes.c_double(0)))

def _amp_limit_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(3), ctypes.c_double(argument)))

def _amp_limit_gain_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(4), ctypes.c_double(0)))

def _amp_limit_gain_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(5), ctypes.c_double(argument)))

def _charge_trigger_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(6), ctypes.c_double(0)))

def _charge_trigger_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(7), ctypes.c_double(argument)))

def _discharge_trigger_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(8), ctypes.c_double(0)))

def _discharge_trigger_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(9), ctypes.c_double(argument)))

def _eff_charge_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(10), ctypes.c_double(0)))

def _eff_charge_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(11), ctypes.c_double(argument)))

def _eff_discharge_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(12), ctypes.c_double(0)))

def _eff_discharge_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(13), ctypes.c_double(argument)))

def _kp_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(14), ctypes.c_double(0)))

def _kp_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(15), ctypes.c_double(argument)))

def _kv_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(16), ctypes.c_double(0)))

def _kv_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(17), ctypes.c_double(argument)))

def _kva_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(18), ctypes.c_double(0)))

def _kva_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(19), ctypes.c_double(argument)))

def _kvar_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(20), ctypes.c_double(0)))

def _kvar_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(21), ctypes.c_double(argument)))

def _kvdc_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(22), ctypes.c_double(0)))

def _kvdc_write(self, argument) -> float: # TODO waiting Davis to answer the order
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(23), ctypes.c_double(argument)))

def _kw_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(24), ctypes.c_double(0)))

def _kw_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(25), ctypes.c_double(argument)))

def _kwh_rated_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(26), ctypes.c_double(0)))

def _kwh_rated_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(27), ctypes.c_double(argument)))

def _kw_rated_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(28), ctypes.c_double(0)))

def _kw_rated_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(29), ctypes.c_double(argument)))

def _limit_current_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(30), ctypes.c_double(0)))

def _limit_current_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(31), ctypes.c_double(argument)))

def _pf_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(32), ctypes.c_double(0)))

def _pf_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(33), ctypes.c_double(argument)))

def _pi_tol_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(34), ctypes.c_double(0)))

def _pi_tol_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(35), ctypes.c_double(argument)))

def _safe_voltage_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(36), ctypes.c_double(0)))

def _safe_voltage_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(37), ctypes.c_double(argument)))

def _time_charge_trig_read(self) -> float:
return float(self._dss_obj.StoragesF(ctypes.c_int32(38), ctypes.c_double(0)))

def _time_charge_trig_write(self, argument) -> float:
argument = Base._check_float_param(argument)
return float(self._dss_obj.StoragesF(ctypes.c_int32(39), ctypes.c_double(argument)))

5 changes: 2 additions & 3 deletions src/py_dss_interface/models/Storages/StoragesS.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@

class StoragesS(Base):

def _name_read(self):
def _name_read(self) -> str:
result = ctypes.c_char_p(self._dss_obj.StoragesS(ctypes.c_int32(0), ctypes.c_int32(0)))
return result.value.decode('ascii')

def _name_write(self, argument):
argument = Base._check_string_param(argument)
def _name_write(self, argument: str) -> str:
result = ctypes.c_char_p(self._dss_obj.StoragesS(ctypes.c_int32(1), argument.encode('ascii')))
return result.value.decode('ascii')
4 changes: 4 additions & 0 deletions tests/py_dss_interface/test_pvsystems.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ def test_pvsystems_first(self, dss):
actual = dss.pvsystems.first()
assert actual == expected

expected = 'pv1'
actual = dss.pvsystems.name
assert actual == expected

def test_pvsystems_next(self, dss):
dss.text(r"New PVSystem.PV2 phases=3 "
r"bus1=680 "
Expand Down
Loading

0 comments on commit 2e9096a

Please sign in to comment.