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
def run(): """ run linez: """ flog = AppUtils.logger2File(PY_FILE, version=__version__) if not AppUtils.checkInputOLR(ARGVS.fi, PY_FILE, PARSER_INPUTS): return if not AppUtils.checkInputPK(ARGVS.pk, 'BUS/LINE/RLYGROUP', PY_FILE, PARSER_INPUTS): return # OlxObj.load_olxapi(ARGVS.olxpath) # OlxAPI module initialization OlxObj.OLCase.open(ARGVS.fi, 1) # logging.info('\nOLR file: ' + ARGVS.fi) if type(ARGVS.pk) != list: ARGVS.pk = [ARGVS.pk] # for i in range(len(ARGVS.pk)): logging.info('\nSelected Object: ' + str(ARGVS.pk[i])) t0 = OlxObj.OLCase.findOBJ(ARGVS.pk[i]) run1t(t0) print('logFile:', flog) return 1
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) # get handle of object picked up print("Selected BUS: " + str(ARGVS.pk)) bhnd = OlxAPILib.FindObj1LPF_check(ARGVS.pk[0], TC_BUS) # # sr = "\nOLR file: " + os.path.abspath(ARGVS.fi) sr = '\n' + OlxAPILib.fullBusName(bhnd).ljust(25) + ' : BUS FOUND' print(sr) sr += "\n\nBUS FAULT REPORT" sr += "\n ,Phase A ,Phase B ,Phase C" sr += do1busFlt(bhnd) #update file out ARGVS.fo = AppUtils.get_file_out(fo=ARGVS.fo, fi=ARGVS.fi, subf='res', ad='', ext='.csv') # AppUtils.saveString2File(ARGVS.fo, sr) # print('\nReport file had been saved in:\n%s' % ARGVS.fo) if ARGVS.ut == 0: AppUtils.launch_excel(ARGVS.fo) return 1
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 # sr = ''#"\nOLR file: " + os.path.abspath(ARGVS.fi) # OlxAPILib.open_olrFile(ARGVS.fi,ARGVS.olxpath) # print("Selected BUS: "+ str(ARGVS.pk)) for i in range(len(ARGVS.pk)): # get handle of object picked up bhnd = OlxAPILib.FindObj1LPF_check(ARGVS.pk[i],TC_BUS) sb = OlxAPILib.fullBusName(bhnd).ljust(25) +' : BUS FOUND' sr+= "\n"+sb print(sb) # sr += "\nFault, PhaseA, PhaseB, PhaseC, R0+jX0, R1+jX1, R2+jX2, X/R" # sr+= do1busFlt1(bhnd) + "\n" #update file out ARGVS.fo = AppUtils.get_file_out(fo=ARGVS.fo , fi=ARGVS.fi , subf='res' , ad='' , ext='.csv') AppUtils.saveString2File(ARGVS.fo,sr) print('\nReport file had been saved in:\n%s'%ARGVS.fo) if ARGVS.ut ==0: AppUtils.launch_excel(ARGVS.fo) return 1
def run(): if not AppUtils.checkInputOLR(ARGVS.fi, PY_FILE, PARSER_INPUTS): return if not AppUtils.checkInputPK(ARGVS.pk, 'Relay Group', PY_FILE, PARSER_INPUTS): return # OlxAPILib.open_olrFile(ARGVS.fi, ARGVS.olxpath) # bhnd, tc = OlxAPILib.FindObj1LPF(ARGVS.pk[0]) if tc != TC_RLYGROUP: s = "\nNo Relay Group is selected: " + str( ARGVS.pk) + "\nUnable to continue." return AppUtils.FinishCheck(PY_FILE, s, PARSER_INPUTS) # br1 = OlxAPILib.getEquipmentData([bhnd], RG_nBranchHnd)[0] b1 = OlxAPILib.getEquipmentData([br1], BR_nBus1Hnd)[0] nTap1 = OlxAPILib.getEquipmentData([b1], BUS_nTapBus)[0] inSer1 = OlxAPILib.getEquipmentData([br1], BR_nInService)[0] sLocal = "Local Relay Group: " + OlxAPILib.fullBranchName(br1) if nTap1 > 0: s = '\n' + sLocal + "\n\tis located at a TAP bus. Unable to continue." return AppUtils.FinishCheck(PY_FILE, s, None) # if inSer1 != 1: s = '\n' + sLocal + "\n\tis located on out-of-service branch. Unable to continue." return AppUtils.FinishCheck(PY_FILE, s, None) # kr = 0 sres = "" bres = OlxAPILib.getOppositeBranch( hndBr=br1, typeConsi=[] ) # consider all type [TC_LINE,TC_SWITCH,TC_SCAP,TC_PS,TC_XFMR,TC_XFMR3] # for bri in bres: rg1 = -1 try: rg1 = OlxAPILib.getEquipmentData([bri], BR_nRlyGrp1Hnd)[0] except: pass # if rg1 > 0: kr += 1 sres += "\n\t" + OlxAPILib.fullBranchName(bri) # s0 = 'App: ' + PY_FILE s0 += '\nUser: '******'\nDate: ' + time.asctime() s0 += '\nOLR file: ' + ARGVS.fi s0 += '\n\nSelected Relay Group:' + str(ARGVS.pk[0]) if kr > 1: s0 += "\nRemote groups (" + str(kr) + "):" else: s0 += "\nRemote group (" + str(kr) + "):" # ARGVS.fo = AppUtils.get_file_out(fo=ARGVS.fo, fi=ARGVS.fi, subf='res', ad='_res', ext='.txt') # AppUtils.saveString2File(ARGVS.fo, s0 + sres) print("\nReport file had been saved in:\n" + ARGVS.fo) if ARGVS.ut == 0: AppUtils.launch_notepadpp(ARGVS.fo) return 1