def transformers_write_name(self, argument): """Sets the active transformer by name.""" argument = Base.check_string_param(argument) result = ctypes.c_char_p( self.dss_obj.TransformersS(ctypes.c_int32(3), argument.encode('ascii'))) return result.value.decode('ascii')
def cktelement_write_display(self, argument: str) -> str: """Allows to modify the name of the active circuit element (not necessarily unique).""" argument = Base.check_string_param(argument) result = ctypes.c_char_p( self.dss_obj.CktElementS(ctypes.c_int32(2), argument.encode('ascii'))) return result.value.decode('ascii')
def regcontrols_write_monitored_bus(self, argument): """Sets the name of the remote regulated bus, in lieu of LDC settings.""" argument = Base.check_string_param(argument) result = ctypes.c_char_p( self.dss_obj.RegControlsS(ctypes.c_int32(3), argument.encode('ascii'))) return result.value.decode('ascii')
def reclosers_write_switched_obj(self, argument): """Sets the full name of the circuit element that is being switched by this Recloser.""" argument = Base.check_string_param(argument) result = ctypes.c_char_p( self.dss_obj.ReclosersS(ctypes.c_int32(5), argument.encode('ascii'))) return result.value.decode('ascii')
def transformers_write_xfmr_code(self, argument): """Sets the name of an XfrmCode that supplies electrical parameters for this transformer.""" argument = Base.check_string_param(argument) result = ctypes.c_char_p( self.dss_obj.TransformersS(ctypes.c_int32(1), argument.encode('ascii'))) return result.value.decode('ascii')
def reclosers_write_name(self, argument): """Sets the name of the active Recloser Object.""" argument = Base.check_string_param(argument) result = ctypes.c_char_p( self.dss_obj.ReclosersS(ctypes.c_int32(1), argument.encode('ascii'))) return result.value.decode('ascii')
def reclosers_write_monitored_obj(self, argument): """Sets the full name of object this Recloser is monitoring.""" argument = Base.check_string_param(argument) result = ctypes.c_char_p( self.dss_obj.ReclosersS(ctypes.c_int32(3), argument.encode('ascii'))) return result.value.decode('ascii')
def vsources_write_name(self, argument): """Sets the name of the active VSource.""" argument = Base.check_string_param(argument) result = ctypes.c_char_p( self.dss_obj.VsourcesS(ctypes.c_int32(1), argument.encode('ascii'))) return result.value.decode('ascii')
def meters_write_peak_current(self, argument): """Receives an array of doubles to set values of Peak Current Property.""" argument = Base.check_string_param(argument) t = Text(self.dss_obj) mt = MetersS(self.dss_obj) mt_name = mt.meters_read_name() return t.text(f'edit EnergyMeter.{mt_name} peakcurrent = {argument}')
def regcontrols_write_transformer(self, argument): """Sets the name of the transformer this regulator controls.""" argument = Base.check_string_param(argument) result = ctypes.c_char_p( self.dss_obj.RegControlsS(ctypes.c_int32(5), argument.encode('ascii'))) return result.value.decode('ascii')
def linecodes_write_name(self, argument: str) -> str: """Sets the name of the active LineCode element. The new value must be specified in the argument as a string.""" argument = Base.check_string_param(argument) result = ctypes.c_char_p( self.dss_obj.LineCodesS(ctypes.c_int32(1), argument.encode('ascii'))) return result.value.decode('ascii')
def lines_write_cmatrix(self, argument) -> int: """Sets the capacitance matrix (full), nanofarads per unit length. Variant array of doubles.""" argument = Base.check_string_param(argument) t = Text(self.dss_obj) lc = Lines.LinesS(self.dss_obj) lc_name = lc.lines_read_name() return t.text(f'edit Line.{lc_name} Cmatrix = {argument}')
def lines_write_xmatrix(self, argument) -> List[float]: """Sets the reactance matrix (full), ohms per unit length. Variant array of doubles.""" argument = Base.check_string_param(argument) t = Text(self.dss_obj) lc = Lines.LinesS(self.dss_obj) lc_name = lc.lines_read_name() return t.text(f'edit Line.{lc_name} Xmatrix = {argument}')
def regcontrols_write_name(self, argument): """Sets the active RegControl name.""" argument = Base.check_string_param(argument) result = ctypes.c_char_p( self.dss_obj.RegControlsS(ctypes.c_int32(1), argument.encode('ascii'))) return result.value.decode('ascii')
def settings_write_auto_bus_list(self, argument): """Sets the list of Buses or (File=xxxxx) syntax for the AutoAdd solution mode.""" argument = Base.check_string_param(argument) result = ctypes.c_char_p( self.dss_obj.SettingsS(ctypes.c_int32(1), argument.encode('ascii'))) return result.value.decode('ascii')
def settings_write_price_curve(self, argument): """Sets the name of LoadShape object that serves as the source of price signal data for yearly simulations, etc.""" argument = Base.check_string_param(argument) result = ctypes.c_char_p( self.dss_obj.SettingsS(ctypes.c_int32(3), argument.encode('ascii'))) return result.value.decode('ascii')
def capacitors_write_name(self, capacitor_name: str) -> str: """Sets the name of the Capacitor element to set it active. :param capacitor_name: the desired name to the capacitor """ # TODO: what is the the return type? capacitor_name = Base.check_string_param(capacitor_name) import ctypes ctypes.c_char_p(capacitor_name.encode('utf-8')) return (self.dss_obj.CapacitorsS(1, ctypes.c_char_p(capacitor_name.encode('utf-8')))).decode('ascii')
def linecodes_write_cmatrix(self, argument): """Sets the capacitance matrix in ohms per unit length of the active LineCode. The new values must be entered as a vector of doubles using the argument. :param argument: must be a string like that [383.948 |0 383.948 |0 0 383.948 ] """ argument = Base.check_string_param(argument) t = Text(self.dss_obj) lc = LineCodesS.LineCodesS(self.dss_obj) lc_name = lc.linecodes_read_name() t.text(f'edit Linecode.{lc_name} Cmatrix = {argument}')
def linecodes_write_rmatrix(self, argument): """Sets the resistance matrix in ohms per unit length of the active LineCode. The new values must be entered as a vector of doubles using the argument. :param argument: must be a string like that [0.791721 | 0.318476 0.781649 | 0.28345, 0.318476, 0.791721] """ argument = Base.check_string_param(argument) t = Text(self.dss_obj) lc = LineCodesS.LineCodesS(self.dss_obj) lc_name = lc.linecodes_read_name() t.text(f'edit Linecode.{lc_name} Rmatrix = {argument}')
def linecodes_write_xmatrix(self, argument): """Sets the reactance matrix in ohms per unit length of the active LineCode. The new values must be entered as a vector of doubles using the argument. """ argument = Base.check_string_param(argument) t = Text(self.dss_obj) lc = LineCodesS.LineCodesS(self.dss_obj) lc_name = lc.linecodes_read_name() t.text(f'edit Linecode.{lc_name} Xmatrix = {argument}')
def loads_write_zipv(self, argument): """Allows to write the array of 7 elements (doubles) for ZIP property of the active Load object. :param argument: Array of 7 coefficients: First 3 are ZIP weighting factors for real power (should sum to 1) Next 3 are ZIP weighting factors for reactive power (should sum to 1) Last 1 is cut-off voltage in p.u. of base kV; load is 0 below this cut-off No defaults; all coefficients must be specified if using model=8. """ argument = Base.check_string_param(argument) t = Text(self.dss_obj) load = LoadsS(self.dss_obj) load_name = load.loads_read_name() return t.text(f'edit Load.{load_name} zipv = {argument}')
def relays_write_switched_obj(self, argument): """Sets the full name of element that will switched when relay trips.""" argument = Base.check_string_param(argument) result = ctypes.c_char_p(self.dss_obj.RelaysS(ctypes.c_int32(5), argument.encode('ascii'))) return result.value.decode('ascii')
def settings_write_voltage_bases(self, argument): """Sets the array of doubles defining the legal voltage bases in kV L-L.""" argument = Base.check_string_param(argument) t = Text(self.dss_obj) return t.text(f'Voltagebases = {argument}')
def monitors_channel(self, argument): """Returns a variant array of doubles for the specified channel (usage: MyArray = DSSmonitor. Channel(i)) A save or SaveAll should be executed first. Done automatically by most standard solution modes. """ argument = Base.check_string_param(argument) return Bridge.VarArrayFunction(self.dss_obj.MonitorsV, ctypes.c_int(5), argument, None)
def sensors_write_metered_element(self, argument): """Sets the full name of the measured element.""" argument = Base.check_string_param(argument) result = ctypes.c_char_p( self.dss_obj.SensorsS(ctypes.c_int32(3), argument.encode('ascii'))) return result.value.decode('ascii')
def text(self, argument): """Can be used to send commands to the text interface of OpenDSS (DSS.Text).""" argument = Base.check_string_param(argument) result = ctypes.c_char_p( self.dss_obj.DSSPut_Command(argument.encode('ascii'))) return result.value.decode("ascii")
def circuit_set_active_class(self, argument: str) -> str: """Allows tto activate a Class of the active circuit, the Class must be specified by name. As a result, this parameter will deliver a string with the index of the active Class.""" argument = Base.check_string_param(argument, default="") result = ctypes.c_char_p(self.dss_obj.CircuitS(ctypes.c_int32(5), argument.encode('ascii'))) return result.value.decode('ascii')
def solution_write_default_yearly(self, argument): """Sets the default yearly load shape (defaults to "Default").""" argument = Base.check_string_param(argument) result = ctypes.c_char_p(self.dss_obj.SolutionS(ctypes.c_int32(6), argument.encode('ascii'))) return result.value.decode('ascii')
def dss_new_circuit(self, argument: str) -> str: """Makes a new circuit, the name of the circuit must be specified in the Argument.""" argument = Base.check_string_param(argument) result = ctypes.c_char_p( self.dss_obj.DSSS(ctypes.c_int32(0), argument.encode('ascii'))) return result.value.decode('ascii')
def solution_write_ld_curve(self, argument): """Sets the Load-Duration Curve name for LD modes.""" argument = Base.check_string_param(argument) result = ctypes.c_char_p(self.dss_obj.SolutionS(ctypes.c_int32(2), argument.encode('ascii'))) return result.value.decode('ascii')