Exemplo n.º 1
0
        def __init__(self, _ACSI, _ied, File):
            self.ied = _ied
            self.ACSI = _ACSI
            self.TX = Trace.File(TL.GENERAL, "GeneratedScript\\" + File)

            self.TX.Trace(('from utest.ATL import *\n'), TL.GENERAL)
            self.TX.Trace(('from VsUtils import variables as vs\n'),
                          TL.GENERAL)
            self.TX.Trace(('from utest import IECToolkit\n'), TL.GENERAL)
            self.TX.Trace(('import time\n'), TL.GENERAL)
            self.TX.Trace(('\n'), TL.GENERAL)
            self.TX.Trace(('\n'), TL.GENERAL)

            self.TX.Trace(('class CheckDA:\n'), TL.GENERAL)
            self.TX.Trace(('\n'), TL.GENERAL)
            self.TX.Trace(('    def initialize(self):\n'), TL.GENERAL)
            self.TX.Trace(('        pass\n'), TL.GENERAL)
            self.TX.Trace(('\n'), TL.GENERAL)

            self.TX.Trace(('    def finalize(self):\n'), TL.GENERAL)
            self.TX.Trace(('        pass\n'), TL.GENERAL)
            self.TX.Trace(('\n'), TL.GENERAL)

            self.IED_ID = self.ACSI.IedName + self.ACSI.APName  # tServer[0].IEDName

            self.TX.Trace(('    def execute(self):\n'), TL.GENERAL)
            self.TX.Trace(('        ' + self.IED_ID +
                           ' = IECToolkit.Manager(' + self.ACSI.IedIP + ')\n'),
                          TL.GENERAL)
            #            IED_AP = ied.Server[0].IEDName + ied.Server[0].APName
            self.TX.Trace(
                ('        ' + 'I_' + self.IED_ID + '= ' + self.ACSI.IedName +
                 '.getACSI(' + self.IED_ID + ')\n'), TL.GENERAL)
Exemplo n.º 2
0
    def main(directory, file, scl):

        TX = TConsole.File(TL.GENERAL, "dump data.txt")
        TR = TConsole.Console(TL.GENERAL)
        GM = globalDataModel(TX, directory + file, scl)
        iec_BasicType = ''
        iec_TypeValue = ''
        iec_EnumType = ''

        T0_Global = time.time()
        for ied in GM.tIED:
            t0_ied = time.time()
            tIEC_adresse = GM.BrowseDataModel(ied)
            if ied.IP is None:
                ip = '0.0.0.0'
            else:
                ip = ied.IP
            nbDa = len(GM.tIED)
            Resultat = str(time.time() - t0_ied)
            TX.Trace(("Time for IED:" + ied.name + '(' + ip +
                      ") Number of DA:" + str(nbDa) + "Time" + Resultat),
                     TL.GENERAL)

            index = 0
            IED_ID = ied.name + ied.tAccessPoint[
                0].name  #  ied.name   # TODO ou ied.name+AP_Name
            for iec in tIEC_adresse:

                if iec.BasicType is None:
                    iec_BasicType = " - "
                if iec.TypeValue is None:
                    iec_TypeValue = " - "
                if iec.EnumType is None:
                    iec_EnumType = " - "

                TX.Trace(("MMS_ADR" + iec.mmsAdr + " FC:" + iec.fc +
                          " bType:" + iec_BasicType + " EnumType:" +
                          iec_EnumType + "Value:" + iec_TypeValue + "\n"),
                         TL.GENERAL)
                index = index + 1
        T1 = time.time()
        TempsTotal = str(time.time() - T0_Global)
        TX.Close()
        TR.Trace(("Total execution time" + file + ':' + TempsTotal),
                 TL.GENERAL)
        TR.Trace(("*** finished ***"), TL.GENERAL)
Exemplo n.º 3
0
    def getAPI_TXT(self, mode):
        if mode == "IED":
            return (TEST.IED)
        if mode == "SYSTEM":
            return (TEST.System)
        if mode == "DUMMY":
            return (TEST.Dummy)


##
# \b MAIN call the unitary test 'Test_ParcoursDataModel'
if __name__ == '__main__':

    TX = TR.Console(TL.GENERAL)
    TR1 = TR.Console(TL.DETAIL)
    TXF = TR.File(TL.DETAIL, "Trace_FctTst.txt")
    tIEDfull = []

    myCpt = 0

    tstAPI = API_Test("test iedIED")
    dumACSI = tstAPI.getAPI_TXT("DUMMY")
    iedACSI = tstAPI.getAPI_TXT("IED")
    sysACSI = tstAPI.getAPI_TXT("SYSTEM")

    for file in FileListe.lstSystem:

        GM = globalDataModel(TX, 'SCL_files/' + file, None)

        indIED = 0
        T0 = time.time()