-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathIngestQRevManager.py
596 lines (432 loc) · 21 KB
/
IngestQRevManager.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
import math
from xml.etree import ElementTree
import wx
def GetRoot(filePath):
return ElementTree.parse(filePath).getroot()
def GetStationID(filePath):
try:
channel = GetRoot(filePath)
stationID = channel.find('SiteInformation').find('SiteID').text
return stationID
except:
print("Unable to read the xml file")
return -1
def GetDate(filePath):
channel = GetRoot(filePath)
date = channel.find('Transect').find('StartDateTime').text
#06/28/2016 08:31:36
dt = date[6:10] + "/" + date[:5]
return dt
def GetQRevVersion(filePath):
QRevVer = GetRoot(filePath).attrib['QRevVersion']
return float(QRevVer[(len(QRevVer) - 5):])
#Summary
def GetStartTime(filePath):
return GetRoot(filePath).find('Transect').find('StartDateTime').text[11:16]
def GetEndTime(filePath):
return GetRoot(filePath).findall('Transect')[-1].find('EndDateTime').text[11:16]
def GetWidth(filePath):
return GetRoot(filePath).find('ChannelSummary').find('Other').find('MeanWidth').text
def GetArea(filePath):
return GetRoot(filePath).find('ChannelSummary').find('Other').find('MeanArea').text
def GetVelocity(filePath):
return GetRoot(filePath).find('ChannelSummary').find('Other').find('MeanQoverA').text
def GetDischarge(filePath):
return GetRoot(filePath).find('ChannelSummary').find('Discharge').find('Total').text
def GetUncertainty(filePath):
return GetRoot(filePath).find('ChannelSummary').find('Uncertainty').find('Total').text
def GetMBCorrection(filePath):
return GetRoot(filePath).find('ChannelSummary').find('Discharge').find('MovingBedPercentCorrection').text
# Does NOT work with xml files as of QRev Version 4.3.4 (Verification Temperature field does not exist)
def GetWaterTemp(filePath):
return GetRoot(filePath).find('QA').find('TemperatureCheck').find('VerificationTemperature').text
#Detail
def GetDiagTest(filePath):
return GetRoot(filePath).find('QA').find('DiagnosticTestResult').text
def GetADCPDepth(filePath):
return GetRoot(filePath).find('Processing').find('Depth').find('ADCPDepth').text
def GetMagDeclination(filePath):
return GetRoot(filePath).find('Processing').find('Navigation').find('MagneticVariation').text
def GetSerialNum(filePath):
return GetRoot(filePath).find('Instrument').find('SerialNumber').text
def GetManufacturer(filePath):
return GetRoot(filePath).find('Instrument').find('Manufacturer').text
def GetModel(filePath):
return GetRoot(filePath).find('Instrument').find('Model').text
def GetFrequency(filePath):
return GetRoot(filePath).find('Instrument').find('Frequency').text
def GetFrequencyUnit(filePath):
return GetRoot(filePath).find('Instrument').find('Frequency').attrib['unitsCode']
def GetFirmware(filePath):
return GetRoot(filePath).find('Instrument').find('FirmwareVersion').text
def GetSoftware(filePath):
return GetRoot(filePath).find('Processing').find('SoftwareVersion').text
#Moving Boat
def GetLoop(filePath):
MovingBedTests = GetRoot(filePath).find('QA').findall('MovingBedTest')
for movingBedTest in MovingBedTests:
if movingBedTest.find('UserValid').text.lower() == "yes":
return movingBedTest.find('TestType').text
# return GetRoot(filePath).find('QA').find('MovingBedTest').find('TestType').text
def GetDetected(filePath):
MovingBedTests = GetRoot(filePath).find('QA').findall('MovingBedTest')
for movingBedTest in MovingBedTests:
if movingBedTest.find('UserValid').text.lower() == "yes":
return movingBedTest.find('PercentMovingBed').text
def GetReference(filePath):
return GetRoot(filePath).find('Processing').find('Navigation').find('Reference').text
def GetCompTracks(filePath):
return GetRoot(filePath).find('Processing').find('Navigation').find('CompositeTrack').text
def GetLeftType(filePath):
return GetRoot(filePath).find('Processing').find('Edge').find('LeftType').text
def GetLeftCoeff(filePath):
return GetRoot(filePath).find('Processing').find('Edge').find('LeftEdgeCoefficient').text
def GetRightType(filePath):
return GetRoot(filePath).find('Processing').find('Edge').find('RightType').text
def GetRightCoeff(filePath):
return GetRoot(filePath).find('Processing').find('Edge').find('RightEdgeCoefficient').text
def GetDepthRef(filePath):
return GetRoot(filePath).find('Processing').find('Depth').find('Reference').text
def GetTopMethod(filePath):
return GetRoot(filePath).find('Processing').find('Extrapolation').find('TopMethod').text
def GetBottomMethod(filePath):
return GetRoot(filePath).find('Processing').find('Extrapolation').find('BottomMethod').text
def GetExponent(filePath):
return GetRoot(filePath).find('Processing').find('Extrapolation').find('Exponent').text
def GetSDM(filePath):
if GetQRevVersion(filePath) >= 4.30: #this is for backwards compatability - transitioning to QRev 4.3.0, the file structure is different, and obtaining this field is different
return GetRoot(filePath).find('ChannelSummary').find('QRevUAUncertainty').find('COV').text
else:
return GetRoot(filePath).find('ChannelSummary').find('Uncertainty').find('COV').text
def GetExtraUncer(filePath):
if GetQRevVersion(filePath) >= 4.30: #this is for backwards compatability - transitioning to QRev 4.3.0, the file structure is different, and obtaining this field is different
return GetRoot(filePath).find('ChannelSummary').find('QRevUAUncertainty').find('Extrapolation').text
else:
return GetRoot(filePath).find('ChannelSummary').find('Uncertainty').find('Extrapolation').text
def GetAllTransects(filePath):
results = []
for i, row in enumerate(GetRoot(filePath).findall('Transect')):
line = []
tempName = row.find('Filename').text
if len(tempName) >= 22:
fileName = row.find('Filename').text[17:]
else:
fileName = tempName
startEdge = row.find('Edge').find('StartEdge').text
startDateTime = row.find('StartDateTime').text[11:]
# endDateTime = row.find('EndDateTime').text[11:]
leftDistance = row.find('Edge').find('LeftDistance').text
rightDistance = row.find('Edge').find('RightDistance').text
total = row.find('Discharge').find('Total').text
line.append(fileName)
line.append(startEdge)
line.append(startDateTime)
line.append(leftDistance)
line.append(rightDistance)
line.append(total)
results.append(line)
return results
def GetStartDateTime(filePath):
return GetRoot(filePath).find('Transect').find('StartDateTime').text[11:]
def GetEndDateTime(filePath):
return GetRoot(filePath).findall('Transect')[-1].find('EndDateTime').text[11:]
def GetMessage(filePath):
MovingBedTests = GetRoot(filePath).find('QA').findall('MovingBedTest')
for movingBedTest in MovingBedTests:
if movingBedTest.find('UserValid').text.lower() == "yes":
return movingBedTest.find('Message').text
# return GetRoot(filePath).find('QA').find('MovingBedTest').find('Message').text
def GetQRevMessage(filePath):
return GetRoot(filePath).find('QA').find('QRev_Message').text
def GetUserComment(filePath):
return GetRoot(filePath).find('UserComment').text
#Calculate the mean time
def mean(start, end):
startHour = int(start.GetHourVal())
endHour = int(end.GetHourVal())
startMin = int(start.GetMinuteVal())
endMin = int(end.GetMinuteVal())
startSec = int(start.GetSecondVal())
endSec = int(end.GetSecondVal())
start = float(startHour * 3600 + startMin * 60 + startSec)
end = float(endHour * 3600 + endMin * 60 + endSec)
mean = round((start + end) / 2)
meanHour = int(mean / 3600)
meanMin = int(mean % 3600 / 60)
meanSec = int(mean % 3600 % 60)
# if (startHour + endHour)%2 != 0:
# endMin += 60
# if (startMin + endMin)%2 != 0:
# endSec += 60
# meanHour = (startHour + endHour) / 2
# meanMin = (startMin + endMin) / 2
# meanSec = (startSec + endSec) / 2
meanHour = str(meanHour) if meanHour > 9 else ("0" + str(meanHour))
meanMin = str(meanMin) if meanMin > 9 else ("0" + str(meanMin))
meanSec = str(meanSec) if meanSec > 9 else ("0" + str(meanSec))
meanTime = meanHour + ':' + meanMin + ':' + meanSec
return meanTime
def AddMovingBoat(filePath, movingBoatManager, evt):
# movingBoatManager.Clear()
loop = GetLoop(filePath)
detected = GetDetected(filePath)
reference = GetReference(filePath)
compTracks = GetCompTracks(filePath)
# leftType = GetLeftType(filePath)
leftCoeff = GetLeftCoeff(filePath)
# rightType = GetRightType(filePath)
rightCoeff = GetRightCoeff(filePath)
if float(leftCoeff) == 0.3535 or float(leftCoeff) == 0.353:
leftType = movingBoatManager.gui.bankList[1]
elif float(leftCoeff) == 0.91:
leftType = movingBoatManager.gui.bankList[2]
else:
leftType = movingBoatManager.gui.bankList[3]
if float(rightCoeff) == 0.3535 or float(rightCoeff) == 0.353:
rightType = movingBoatManager.gui.bankList[1]
elif float(rightCoeff) == 0.91:
rightType = movingBoatManager.gui.bankList[2]
else:
rightType = movingBoatManager.gui.bankList[3]
depthRef = GetDepthRef(filePath)
if depthRef == "BT":
depthRef = "Bottom Track"
elif depthRef == "":
depthRef = ""
else:
depthRef = ""
topMethod = GetTopMethod(filePath)
bottomMethod = GetBottomMethod(filePath)
exponent = GetExponent(filePath)
sdm = GetSDM(filePath)
extrap = GetExtraUncer(filePath)
mbCorrection = GetMBCorrection(filePath)
dis = GetDischarge(filePath)
# print "extrap {0}".format(extrap)
allTransects = GetAllTransects(filePath)
# for i in allTransects:
# print i
color = movingBoatManager.manager.gui.importedBGColor
# color = (210, 210, 210)
for row, tran in enumerate(allTransects):
if row > len(movingBoatManager.tableSizer.GetChildren()) - 3:
movingBoatManager.gui.AddEntry()
movingBoatManager.SetFontColor(row, 0, 'Black')
movingBoatManager.SetTableValue(row, 1, "True")
movingBoatManager.SetTableValue(row, 2, tran[0])
movingBoatManager.SetTableColor(row, 2, color)
movingBoatManager.SetTableValue(row, 3, tran[1][0])
movingBoatManager.SetTableColor(row, 3, color)
movingBoatManager.SetTableValue(row, 4, tran[2])
if tran[1][0] == "L":
movingBoatManager.SetTableValue(row, 6, tran[3])
movingBoatManager.SetTableColor(row, 6, color)
movingBoatManager.SetTableValue(row, 7, tran[4])
movingBoatManager.SetTableColor(row, 7, color)
else:
movingBoatManager.SetTableValue(row, 6, tran[4])
movingBoatManager.SetTableColor(row, 6, color)
movingBoatManager.SetTableValue(row, 7, tran[3])
movingBoatManager.SetTableColor(row, 7, color)
movingBoatManager.SetTableValue(row, 8, tran[5])
movingBoatManager.SetTableColor(row, 8, color)
# movingBoatManager.SetTableValue(row, 8, tran[6])
# movingBoatManager.SetTableColor(row, 8, color)
startDateTime = GetStartDateTime(filePath)
endDateTime = GetEndDateTime(filePath)
try:
message = GetMessage(filePath)
except:
message = ""
try:
qRevMessage = GetQRevMessage(filePath)
except:
qRevMessage = ""
try:
userComment = GetUserComment(filePath)
except:
userComment = ""
movingBoatManager.mbCmbo = loop if loop is not None else movingBoatManager.mbCmbo
if loop != "" or loop is not None:
movingBoatManager.mbCB = True
else:
movingBoatManager.mbCB = False
if detected is not None:
movingBoatManager.detectedCtrl = detected
movingBoatManager.GetDetectedCtrl().SetBackgroundColour(color)
if reference is not None:
movingBoatManager.trackRefCmbo = reference
movingBoatManager.GetTrackRefCmbo().SetBackgroundColour(color)
if compTracks is not None:
movingBoatManager.compositeTrackCmbo = compTracks
movingBoatManager.GetCompositeTrackCmbo().SetBackgroundColour(color)
if leftType is not None:
movingBoatManager.leftBankCmbo = leftType
if rightType is not None:
movingBoatManager.rightBankCmbo = rightType
if leftType == movingBoatManager.gui.bankList[3]:
movingBoatManager.leftBankOtherCtrl = leftCoeff
movingBoatManager.GetLeftBankOtherCtrl().SetBackgroundColour(color)
else:
movingBoatManager.leftBankOtherCtrl = ""
if rightType == movingBoatManager.gui.bankList[3]:
movingBoatManager.rightBankOtherCtrl = rightCoeff
movingBoatManager.GetRightBankCmbo().SetBackgroundColour(color)
else:
movingBoatManager.rightBankOtherCtrl = ""
if depthRef is not None:
movingBoatManager.depthRefCmbo = depthRef
movingBoatManager.GetDepthRefCmbo().SetBackgroundColour(color)
if topMethod is not None:
movingBoatManager.velocityTopCombo = topMethod
movingBoatManager.GetVelocityTopCombo().SetBackgroundColour(color)
if bottomMethod is not None:
movingBoatManager.velocityBottomCombo = bottomMethod
movingBoatManager.GetVelocityBottomCombo().SetBackgroundColour(color)
if exponent is not None:
movingBoatManager.velocityExponentCtrl = exponent
movingBoatManager.GetVelocityExponentCtrl().SetBackgroundColour(color)
if sdm is not None:
movingBoatManager.standDevMeanDischCtrl = sdm
movingBoatManager.GetStandDevMeanDischCtrl().SetBackgroundColour(color)
if extrap is not None:
movingBoatManager.extrapUncerCtrl = extrap
movingBoatManager.GetExtrapUncerCtrl().SetBackgroundColour(color)
if mbCorrection is not None:
movingBoatManager.mbCorrAppCtrl = mbCorrection
movingBoatManager.GetMbCorrAppCtrl().SetBackgroundColour(color)
if dis is not None:
movingBoatManager.finalDischCtrl = dis
movingBoatManager.GetFinalDischCtrl().SetBackgroundColour(color)
movingBoatManager.mmntStartTimeCtrl = startDateTime
movingBoatManager.mmntEndTimeCtrl = endDateTime
start = movingBoatManager.gui.mmntStartTimeCtrl
end = movingBoatManager.gui.mmntEndTimeCtrl
meanTime = mean(start, end)
# print meanTime
movingBoatManager.mmntMeanTimeCtrl = meanTime
movingBoatManager.gui.UpdateSammury(evt)
attrib = wx.TextAttr("black", colBack=color)
# print movingBoatManager.GetCommentsCtrl().GetRange(0,2)
# print movingBoatManager.GetCommentsCtrl().GetValue()
if movingBoatManager.commentsCtrl != "":
print("not empty comments")
movingBoatManager.commentsCtrl += "\n"
movingBoatManager.commentsCtrl += 'Moving Bed Test Message: ' + message + '\n\n' if message is not None else ""
movingBoatManager.commentsCtrl += 'QRev Message: ' + qRevMessage + '\n\n' if qRevMessage is not None else ''
movingBoatManager.commentsCtrl += 'User Comment: ' + userComment + '\n\n' if userComment is not None else ''
def AddDischargeSummary(filePath, disMeasManager):
color = disMeasManager.manager.gui.importedBGColor
start = GetStartTime(filePath)
end = GetEndTime(filePath)
width = GetWidth(filePath)
area = GetArea(filePath)
vel = GetVelocity(filePath)
dis = GetDischarge(filePath)
uncert = str(round(float(GetUncertainty(filePath)), 2))
# water = GetWaterTemp(filePath)
mbCorrection = GetMBCorrection(filePath)
disMeasManager.startTimeCtrl = start
disMeasManager.endTimeCtrl = end
if width is not None:
disMeasManager.widthCtrl = width
myEvent = wx.FocusEvent(eventType=wx.wxEVT_KILL_FOCUS, id=wx.NewId())
myEvent.SetEventObject(disMeasManager.GetWidthCtrl())
wx.PostEvent(disMeasManager.GetWidthCtrl(), myEvent)
disMeasManager.GetWidthCtrl().SetBackgroundColour(color)
if area is not None:
disMeasManager.areaCtrl = area
myEvent = wx.FocusEvent(eventType=wx.wxEVT_KILL_FOCUS, id=wx.NewId())
myEvent.SetEventObject(disMeasManager.GetAreaCtrl())
wx.PostEvent(disMeasManager.GetAreaCtrl(), myEvent)
disMeasManager.GetAreaCtrl().SetBackgroundColour(color)
if vel is not None:
disMeasManager.meanVelCtrl = vel
myEvent = wx.FocusEvent(eventType=wx.wxEVT_KILL_FOCUS, id=wx.NewId())
myEvent.SetEventObject(disMeasManager.GetMeanVelCtrl())
wx.PostEvent(disMeasManager.GetMeanVelCtrl(), myEvent)
disMeasManager.GetMeanVelCtrl().SetBackgroundColour(color)
if dis is not None:
disMeasManager.dischCtrl = dis
myEvent = wx.FocusEvent(eventType=wx.wxEVT_KILL_FOCUS, id=wx.NewId())
myEvent.SetEventObject(disMeasManager.GetDischCtrl())
wx.PostEvent(disMeasManager.GetDischCtrl(), myEvent)
disMeasManager.GetDischCtrl().SetBackgroundColour(color)
disMeasManager.manager.movingBoatMeasurementsManager.finalDischCtrl = dis
disMeasManager.manager.movingBoatMeasurementsManager.gui.finalDischCtrl.SetBackgroundColour(color)
if uncert is not None:
disMeasManager.uncertaintyCtrl = uncert
myEvent = wx.FocusEvent(eventType=wx.wxEVT_KILL_FOCUS, id=wx.NewId())
myEvent.SetEventObject(disMeasManager.GetUncertaintyCtrl())
wx.PostEvent(disMeasManager.GetUncertaintyCtrl(), myEvent)
disMeasManager.GetUncertaintyCtrl().SetBackgroundColour(color)
# Adding uncertainty text to Discharge Activity Remarks
dischargeUncertainty = '@ Uncertainty: QRev Uncertainty Analysis (DS Mueller, 2016), 2-sigma value (1 x Uncertainty Value reported in *.xml File). @'
dischargeRemarks = disMeasManager.dischRemarksCtrl
if dischargeRemarks != '':
disMeasManager.dischRemarksCtrl = dischargeRemarks + '\n' + dischargeUncertainty
else:
disMeasManager.dischRemarksCtrl = dischargeUncertainty
# if water is not None:
# disMeasManager.waterTempCtrl = water
# myEvent = wx.FocusEvent(eventType=wx.wxEVT_KILL_FOCUS, id=wx.NewId())
# myEvent.SetEventObject(disMeasManager.GetWaterTempCtrl())
# wx.PostEvent(disMeasManager.GetWaterTempCtrl(), myEvent)
# disMeasManager.GetWaterTempCtrl().SetBackgroundColour(color)
if mbCorrection is not None:
disMeasManager.manager.movingBoatMeasurementsManager.mbCorrAppCtrl = mbCorrection
myEvent = wx.FocusEvent(eventType=wx.wxEVT_KILL_FOCUS, id=wx.NewId())
myEvent.SetEventObject(disMeasManager.manager.movingBoatMeasurementsManager.GetMbCorrAppCtrl())
wx.PostEvent(disMeasManager.manager.movingBoatMeasurementsManager.GetMbCorrAppCtrl(), myEvent)
disMeasManager.manager.movingBoatMeasurementsManager.gui.mbCorrAppCtrl.SetBackgroundColour(color)
disMeasManager.gui.Refresh()
# disMeasManager.GetStartTimeCtrl().SetBackgroundColour(color)
def AddDischargeDetail(filePath, instrDepManager):
color = instrDepManager.manager.gui.importedBGColor
diagTest = GetDiagTest(filePath)
depth = GetADCPDepth(filePath)
magDeclination = GetMagDeclination(filePath)
serialNum = GetSerialNum(filePath)
manufacturer = GetManufacturer(filePath)
model = GetModel(filePath)
frequency = GetFrequency(filePath)
freUnit = GetFrequencyUnit(filePath)
firmware = GetFirmware(filePath)
software = GetSoftware(filePath)
if diagTest is not None:
if diagTest.lower() == "pass":
instrDepManager.GetDiagTestCB().SetValue(True)
else:
instrDepManager.GetDiagTestCB().SetValue(False)
instrDepManager.GetDiagTestCB().SetBackgroundColour(color)
if depth is not None:
instrDepManager.adcpDepthCtrl = depth
instrDepManager.GetAdcpDepthCtrl().SetBackgroundColour(color)
if magDeclination is not None:
instrDepManager.magnDeclCtrl = magDeclination
instrDepManager.GetMagnDeclCtrl().SetBackgroundColour(color)
if serialNum is not None:
instrDepManager.serialCmbo = serialNum
instrDepManager.GetSerialCmbo().SetBackgroundColour(color)
if manufacturer is not None:
instrDepManager.manufactureCmbo = manufacturer
instrDepManager.GetManufactureCmbo().SetBackgroundColour(color)
if model is not None:
instrDepManager.modelCmbo = model
instrDepManager.GetModelCmbo().SetBackgroundColour(color)
if frequency is not None:
if freUnit is not None:
if "m" in freUnit.lower():
# frequency = str(float(frequency) * 1000)
frequency += "000"
try:
instrDepManager.frequencyCmbo = str(math.trunc(float(frequency)))
instrDepManager.GetFrequencyCmbo().SetBackgroundColour(color)
except:
print("Frequency in QRev File is NOT a number, value: ", frequency)
if firmware is not None:
instrDepManager.firmwareCmbo = firmware
instrDepManager.GetFirmwareCmbo().SetBackgroundColour(color)
if software is not None:
instrDepManager.softwareCtrl = software
instrDepManager.GetSoftwareCtrl().SetBackgroundColour(color)