コード例 #1
0
 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')
コード例 #2
0
 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')
コード例 #3
0
 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')
コード例 #4
0
 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')
コード例 #5
0
 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')
コード例 #6
0
 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')
コード例 #7
0
 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')
コード例 #8
0
 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')
コード例 #9
0
 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}')
コード例 #10
0
 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')
コード例 #11
0
 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')
コード例 #12
0
 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}')
コード例 #13
0
 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}')
コード例 #14
0
 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')
コード例 #15
0
 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')
コード例 #16
0
 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')
コード例 #17
0
 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')
コード例 #18
0
 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}')
コード例 #19
0
 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}')
コード例 #20
0
    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}')
コード例 #21
0
 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}')
コード例 #22
0
 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')
コード例 #23
0
 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}')
コード例 #24
0
 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)
コード例 #25
0
 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')
コード例 #26
0
 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")
コード例 #27
0
 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')
コード例 #28
0
 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')
コード例 #29
0
 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')
コード例 #30
0
 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')