示例#1
0
def run():
    if not AppUtils.checkInputOLR(ARGVS.fi, PY_FILE, PARSER_INPUTS):
        return
    if not AppUtils.checkInputPK(ARGVS.pk, 'Bus', PY_FILE, PARSER_INPUTS):
        return
    #
    OlxAPILib.open_olrFile(ARGVS.fi, ARGVS.olxpath)
    #
    sres = 'App: ' + PY_FILE
    sres += '\nUser: '******'\nDate: ' + time.asctime()
    sres += '\nOLR file: ' + ARGVS.fi
    print('Selected Bus: ', str(ARGVS.pk))
    for i in range(len(ARGVS.pk)):
        sres += '\n\nSelected Bus:' + ARGVS.pk[i]
        # get handle of object picked up
        bhnd = OlxAPILib.FindObj1LPF_check(ARGVS.pk[i], TC_BUS)
        #
        br_res, bus_res = getRemoteTerminals(bhnd)
        sres += getRemoteTerminals_str(br_res, bus_res)
    #
    ARGVS.fo = AppUtils.get_file_out(fo=ARGVS.fo,
                                     fi=ARGVS.fi,
                                     subf='',
                                     ad='_res',
                                     ext='.txt')
    #
    AppUtils.saveString2File(ARGVS.fo, sres)
    print("\nReport file had been saved in:\n" + ARGVS.fo)
    if ARGVS.ut == 0:
        AppUtils.launch_notepad(ARGVS.fo)
    return 1
示例#2
0
    def saveReportBusFile(self):
        ARGVS.fb = AppUtils.get_file_out(fo=ARGVS.fb,
                                         fi=ARGVS.fi,
                                         subf='',
                                         ad='_bus',
                                         ext='.txt')
        #
        sr = []
        sr.append('App : ' + PY_FILE)
        sr.append('User: '******'Date: ' + time.asctime())
        sr.append('\nBus report:')

        k = 0
        for b1 in self.busA:
            k += 1
            sb = OlxAPILib.fullBusName(b1)
            sr.append(str(k).ljust(5) + sb)
        if k == 0:
            sr.append('\tNo bus found')
        #
        AppUtils.saveArString2File(ARGVS.fb, sr)
        print('\nReport bus file had been saved in:\n"%s"' % ARGVS.fb)
        #
        if ARGVS.gui > 0 and ARGVS.ut == 0:
            AppUtils.launch_notepad(ARGVS.fb)