62 lines
2.2 KiB
Python
62 lines
2.2 KiB
Python
from ..core.SyslabUnit import SyslabUnit
|
|
|
|
|
|
class Photovoltaics(SyslabUnit):
|
|
"""The Photovoltaics class represents a photovoltaic panel array in SYSLAB.
|
|
The Photovoltaics class is instantiated using a string with the unique name of the dumpload, ie. 'which'
|
|
|
|
A full list of available panel arrays can be found by calling 'Photovoltaics.getAvailablePhotovoltaics()'
|
|
|
|
Alternatively, the user may specify a host and port to connect to via the *host* and *port* arguments.
|
|
"""
|
|
|
|
__PHOTOVOLTAICS = {
|
|
'pv319': ('syslab-24.syslab.dk', '8080', 'pv319'),
|
|
'pv715': ('syslab-10.syslab.dk', '8080', 'pv715'),
|
|
'pv117': ('syslab-07.syslab.dk', '8080', 'pv117'),
|
|
'simlab-03': ('192.168.0.103', '8080', 'pv715'),
|
|
'simlab-13': ('192.168.0.113', '8080', 'pv319'),
|
|
'vpv319': ('simlab-24', '8080', 'pv319'),
|
|
'vpv715': ('simlab-10', '8080', 'pv715'),
|
|
}
|
|
|
|
def __init__(self, which=None, host=None, port=None, unitname=None):
|
|
|
|
baseurl = 'http://{host}:{port}/typebased_WebService_PV/PVSystemWebService/{unit_name}/'
|
|
super().__init__(
|
|
baseurl=baseurl,
|
|
which=which,
|
|
units=self.__PHOTOVOLTAICS,
|
|
host=host,
|
|
port=port,
|
|
unit_name=unitname,
|
|
unit_type="Photovoltaics")
|
|
|
|
def getACActivePower(self):
|
|
return self._request_resource('getACActivePower')
|
|
|
|
def getACReactivePower(self):
|
|
return self._request_resource('getACReactivePower')
|
|
|
|
def getPacLimit(self):
|
|
return self._request_resource('getPacLimit')
|
|
|
|
def getQSetpoint(self):
|
|
return self._request_resource('getQSetpoint')
|
|
|
|
def getRatedPower(self):
|
|
return self._request_resource('getRatedP')
|
|
|
|
def getName(self):
|
|
return self._request_resource('getSystemName')
|
|
|
|
def setPacLimit(self, setPoint):
|
|
return self._request_resource('setPacLimit', setPoint, 'put')
|
|
|
|
def setQSetpoint(self, Q):
|
|
return self._request_resource('setQ', Q, 'put')
|
|
|
|
@staticmethod
|
|
def getAvailablePhotovoltaics():
|
|
return list(Photovoltaics.__PHOTOVOLTAICS.keys())
|