Ejemplo n.º 1
0
def convert_compile_load(convert_xml2tse):
    tse_path = convert_xml2tse
    cpd_path = tse_path[:-4] + " Target files\\" + tse_path.split("\\")[-1][:-4] + ".cpd"
    # Open the converted tse file
    model.load(tse_path)
    # Compile the model
    model.compile()
Ejemplo n.º 2
0
def load_and_compile(tse_path, use_vhil=True):
    cpd_path = tse_path[:-4] + " Target files\\" + tse_path.split(
        "\\")[-1][:-4] + ".cpd"
    # Open the converted tse file
    model.load(tse_path)
    # Compile the model
    model.compile()
    # Load to VHIL
    hil.load_model(file=cpd_path, offlineMode=False, vhil_device=use_vhil)
def convert_compile_load(convert_xml2tse):
    tse_path = convert_xml2tse
    cpd_path = tse_path[:-4] + " Target files\\" + tse_path.split("\\")[-1][:-4] + ".cpd"
    # Open the converted tse file
    model.load(tse_path)
    # Compile the model
    model.compile()

    # Load to VHIL
    hil.load_model(file=cpd_path, offlineMode=False, vhil_device=vhil)
Ejemplo n.º 4
0
def compile_tse(convert_xml2tse):
    # Compiles the tse file
    tse_path = convert_xml2tse
    # Convert the model
    cpd_path = tse_path[:-4] + " Target files\\" + tse_path.split("\\")[-1][:-4] + ".cpd"
    # Open the converted tse file
    model.load(tse_path)
    # Compile the model
    model.compile()

    return cpd_path
Ejemplo n.º 5
0
def convert_compile_load():
    # Comment this if don't wont to compile model again

    ###################################################
    # Convert the model
    converter = Converter("psim", netlist_path)
    tse_path = converter.convert_schema(compile_model=False)
    # Open the converted tse file
    model.load(tse_path)
    # Compile the model
    model.compile()
    ###################################################

    # Load to VHIL
    hil.load_model(file=cpd_path, offlineMode=False, vhil_device=vhil)
Ejemplo n.º 6
0
    def load_schematic(self):
        '''
        Load HIL simulation schematic
        '''

        if self.model_name[-4:] == ".tse":
            model_file = self.hil_model_dir + self.model_name
        else:
            model_file = self.hil_model_dir + self.model_name + r".tse"

        self.ts.log("Model File: %s" % model_file)

        if os.path.isfile(model_file):
            self.ts.log_debug(
                "Model file exists! Starting to compile power electronic parts..."
            )
        else:
            self.ts.log_debug(
                "Model file does not exist! {}".format(model_file))
            status = False
            return status

        # load schematic (with default component parameters)
        if not model.load(model_file, debug=self.debug):
            self.ts.log_warning("Model did not load!")
            status = False
            return status
        return True
def convert_compile_load():
    # Comment this if don't wont to compile model again

    # ###################################################
    # # Convert the model
    converter = Converter("psim", netlist_path)
    tse_path = converter.convert_schema(compile_model=False)[0]
    cpd_path = tse_path[:-4] + " Target files\\" + tse_path.split("\\")[-1][:-4] + ".cpd"
    # Open the converted tse file
    model.load(tse_path)
    # Compile the model
    model.compile()
    ###################################################

    # Load to VHIL
    hil.load_model(file=cpd_path, offlineMode=False, vhil_device=vhil)
Ejemplo n.º 8
0
def convert_compile_load(convert_xml2tse):
    tse_path = convert_xml2tse
    cpd_path = tse_path[:-4] + " Target files\\" + tse_path.split("\\")[-1][:-4] + ".cpd"
    # Open the converted tse file
    model.load(tse_path)
    # Compile the model
    model.compile()

    # Load to VHIL
    hil.load_model(file=cpd_path, offlineMode=False, vhil_device=vhil)

    hil.set_pv_input_file("SCP1", psim_tests_dir + '\\E50530_Thin_Film.ipvx', illumination=1000.0, temperature=25.0)

    # Start simulation
    hil.start_simulation()

    yield

    hil.stop_simulation()
def convert_compile_load(convert_xml2tse):
    tse_path = convert_xml2tse
    cpd_path = tse_path[:-4] + " Target files\\" + tse_path.split(
        "\\")[-1][:-4] + ".cpd"
    # Open the converted tse file
    model.load(tse_path)
    # Compile the model
    model.compile()

    # Load to VHIL
    hil.load_model(file=cpd_path, offlineMode=False, vhil_device=vhil)

    # Set source value
    hil.set_source_sine_waveform(name='Vsin3ph',
                                 rms=220,
                                 frequency=50,
                                 phase=0)

    hil.start_simulation()

    yield

    # Stop simulation
    hil.stop_simulation()
Ejemplo n.º 10
0
    def load_schematic(self):
        '''
        Load HIL simulation schematic
        '''
        lib_dir_raw = os.path.dirname(__file__) + os.path.sep
        lib_dir = lib_dir_raw.replace("\\", "/")
        model_file = r"Typhoon/" + self.model_name + r".tse"
        model_dir = lib_dir + model_file
        self.ts.log("Model File: %s" % model_dir)

        if os.path.isfile(model_dir):
            self.ts.log_debug(
                "Model file exists! Starting to compile power electronic parts..."
            )
        else:
            self.ts.log_debug("Model file does not exist!")
            status = False
            return status

        # load schematic (with default component parameters)
        if not model.load(model_dir, debug=True):
            self.ts.log_warning("Model did not load!")
            status = False
            return status
Ejemplo n.º 11
0
    sys.path.insert(0, r'C:/Typhoon HIL Control Center')
    #sys.path.insert(0, r'C:/Typhoon HIL Control Center/typhoon/conf')
    #sys.path.insert(0, r'C:/Typhoon HIL Control Center/typhoon/conf/components')

    import typhoon.api.hil_control_panel as hil
    from typhoon.api.schematic_editor import model
    import os

    hil.set_debug_level(level=1)
    hil.stop_simulation()

    model.get_hw_settings()
    #model_dir = r'D:/SVP/SVP Directories 11-7-16/UL 1741 SA Dev/Lib/Typhoon/'
    #print model_dir, os.path.isfile(model_dir)
    if not model.load(
            r'D:/SVP/SVP Directories 11-7-16/UL 1741 SA Dev/Lib/Typhoon/ASGC_AI.tse'
    ):
        print "Model did not load!"

    if not model.compile():
        print "Model did not compile!"

    # first we need to load model
    hil.load_model(
        file=
        r'D:/SVP/SVP Directories 11-7-16/UL 1741 SA Dev/Lib/Typhoon/ASGC_AI Target files/ASGC_AI.cpd'
    )

    # we could also open existing settings file...
    hil.load_settings_file(
        file=
Ejemplo n.º 12
0
    import numpy as np
    import math
    sys.path.insert(
        0, r'C:/Typhoon HIL Control Center/python_portable/Lib/site-packages')
    sys.path.insert(0, r'C:/Typhoon HIL Control Center/python_portable')
    sys.path.insert(0, r'C:/Typhoon HIL Control Center')
    import typhoon.api.hil_control_panel as hil
    from typhoon.api.schematic_editor import model
    import os

    hil.set_debug_level(level=3)
    hil.stop_simulation()

    model.get_hw_settings()
    if not model.load(
            r'D:/SVP/SVP 1.4.3 Directories 5-2-17/UL1741 SA for ASGC/Lib/svpelab/Typhoon/ASGC_AI.tse'
    ):
        print("Model did not load!")

    if not model.compile():
        print("Model did not compile!")

    # first we need to load model
    hil.load_model(
        file=
        r'D:/SVP/SVP 1.4.3 Directories 5-2-17/UL1741 SA for ASGC/Lib/svpelab/Typhoon/ASGC_AI Target files/ASGC_AI.cpd'
    )

    # we could also open existing settings file...
    hil.load_settings_file(
        file=
    import numpy as np
    import math
    sys.path.insert(
        0, r'C:/Typhoon HIL Control Center/python_portable/Lib/site-packages')
    sys.path.insert(0, r'C:/Typhoon HIL Control Center/python_portable')
    sys.path.insert(0, r'C:/Typhoon HIL Control Center')
    import typhoon.api.hil_control_panel as hil
    from typhoon.api.schematic_editor import model
    import os

    hil.set_debug_level(level=3)
    hil.stop_simulation()

    model.get_hw_settings()
    if not model.load(
            r'D:/SVP/SVP 1.4.3 Directories 5-2-17/svp_energy_lab-loadsim/Lib/svpelab/Typhoon/ASGC.tse'
    ):
        print "Model did not load!"

    if not model.compile():
        print "Model did not compile!"

    # first we need to load model
    hil.load_model(
        file=r'D:/SVP/SVP 1.4.3 Directories 5-2-17/svp_energy_lab-loadsim/Lib'
        r'/svpelab/Typhoon/ASGC Target files/ASGC.cpd')

    # we could also open existing settings file...
    hil.load_settings_file(
        file=r'D:/SVP/SVP 1.4.3 Directories 5-2-17/svp_energy_lab-loadsim/Lib/'
        r'svpelab/Typhoon/settings2.runx')