-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathElectronicFieldNotesGUI.py
More file actions
3280 lines (2523 loc) · 123 KB
/
Copy pathElectronicFieldNotesGUI.py
File metadata and controls
3280 lines (2523 loc) · 123 KB
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
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# All works in this code have been curated by ECCC and licensed under the GNU General Public License v3.0.
# Read more: https://www.gnu.org/licenses/gpl-3.0.en.html
from xml import etree
from TitleHeaderPanel import *
from GenInfoPanel import *
from DischargeMeasurementsPanel import *
from StageMeasurementsPanel import *
from EnvironmentConditionsPanel import *
from MeasurementResultsPanel import *
from InstrumentDeploymentInfoPanel import *
from PartyInfoPanel import *
# from AnnualLevellingPanel import *
from WaterLevelRunPanel import *
from FRChecklistPanel import *
from MovingBoatMeasurementsPanel import *
from MidSectionMeasurementsPanel import *
# from CalcPanel import *
from AquariusUploadDialog import *
from ConfigPanel import *
# from RatingCurveExtractionToolFrame import *
from AQUARIUSDataExtractionToolFrame import *
from RatingCurveViewerToolFrame import *
# from AquariusUploadDialog2 import *
from IngestOptionFrame import *
from configparser import SafeConfigParser
from ZoomPanel import *
# from RemarksPanel import *
from InnovTechChecklistPanel import *
from InventoryManagementPanel import *
from MidsectionImportPanel import MidsectionImportPanel
import VersionCheck
import wx.lib.scrolledpanel as scrolledpanel
import wx.lib.agw.flatnotebook as fnb
import os
import sys
import datetime
from wx import adv
import _thread
import os.path
import multiprocessing
import csv
from xml.etree.ElementTree import Element
import wx.lib.agw.zoombar as zb
import qrcode
import zipfile
import shutil
from win32api import GetSystemMetrics
from AttachmentPanel import *
from xml.etree import ElementTree
from xml.etree.ElementTree import Element
from xml.etree.ElementTree import SubElement
from xml.dom import minidom
import subprocess
# import pyHook
# import pythoncom, win32api
# import threading, time
# from time import sleep
# import painting
ID_FILE_NEW = wx.NewId()
ID_FILE_OPEN = wx.NewId()
ID_FILE_SAVE = wx.NewId()
ID_FILE_EXIT = wx.NewId()
#ID_FILE_EXPORT_PDF = wx.NewId()
ID_FILE_EXPORT_PDF_SUMM = wx.NewId()
ID_FILE_EXPORT_PDF_VIEW = wx.NewId()
ID_FILE_EXPORT_XML = wx.NewId()
ID_FILE_EXPORT_AQUARIUS = wx.NewId()
ID_EDIT_PREF = wx.NewId()
ID_HELP_ABOUT = wx.NewId()
ID_HELP_EHELP = wx.NewId()
ID_HELP_UPDATE = wx.NewId()
ID_CONF_CONF = wx.NewId()
ID_CONF_ADET = wx.NewId()
# ID_IMPORT_DIS = wx.NewId()
# ID_IMPORT_XML = wx.NewId()
ID_IMPORT_HFC = wx.NewId()
ID_IMPORT_FTDIS = wx.NewId()
ID_IMPORT_FT2 = wx.NewId()
ID_IMPORT_QRXML = wx.NewId()
ID_IMPORT_QRIMXML = wx.NewId()
ID_IMPORT_SXSMMT = wx.NewId()
ID_IMPORT_RSSDIS = wx.NewId()
# ID_TOOLS_CALC = wx.NewId()
ID_TOOLS_RCVT = wx.NewId()
# ID_TOOLS_MAGN = wx.NewId()
ID_TOOLS_SCALING_SUB1 = wx.NewId()
ID_TOOLS_SCALING_SUB2 = wx.NewId()
# ID_TOOLS_SCALING_SUB3 = wx.NewId()
ID_FILE_SAVE_EXIT = wx.NewId()
ID_IMPORT_EHSN = wx.NewId()
# ID_TOOLS_DRAW = wx.NewId()
ID_FV_PACKAGE = wx.NewId()
eHSN_WINDOW_SIZE = (500, 400)
# def resource_path(relative):
# if hasattr(sys, "_MEIPASS"):
# return os.path.join(sys._MEIPASS, relative)
# return os.path.join(relative)
# # Define File Drop Target class
# class FileDropTarget(wx.FileDropTarget):
# """ This object implements Drop Target functionality for Files """
# def __init__(self, obj):
# """ Initialize the Drop Target, passing in the Object Reference to
# indicate what should receive the dropped files """
# # Initialize the wxFileDropTarget Object
# wx.FileDropTarget.__init__(self)
# # Store the Object Reference for dropped files
# self.obj = obj
# def OnDropFiles(self, x, y, filenames):
# # """ Implement File Drop """
# # # For Demo purposes, this function appends a list of the files dropped at the end of the widget's text
# # # Move Insertion Point to the end of the widget's text
# # self.obj.SetInsertionPointEnd()
# # # append a list of the file names dropped
# # self.obj.WriteText("%d file(s) dropped at %d, %d:\n" % (len(filenames), x, y))
# # for file in filenames:
# # self.obj.WriteText(file + '\n')
# # self.obj.WriteText('\n')
# print filenames
# return True
class SpecialScrolledPanel(scrolledpanel.ScrolledPanel):
def OnChildFocus(event, other):
pass
class EHSNGui(wx.Frame):
def __init__(self, mode, ver, *args, **kwargs):
super(EHSNGui, self).__init__(*args, **kwargs)
self.ID_IMPORT_HFC = ID_IMPORT_HFC
self.ID_IMPORT_FTDIS = ID_IMPORT_FTDIS
self.ID_IMPORT_FT2 = ID_IMPORT_FT2
self.ID_IMPORT_QRXML = ID_IMPORT_QRXML
self.ID_IMPORT_QRIMXML = ID_IMPORT_QRIMXML
self.ID_IMPORT_SXSMMT = ID_IMPORT_SXSMMT
self.ID_IMPORT_RSSDIS = ID_IMPORT_RSSDIS
self.version = ver
self.noteHeaderTxt = "Hydrometric Survey Notes" + " " + self.version
self.timezone = ""
self.lang = wx.LANGUAGE_ENGLISH
self.mode = mode
self.name = ""
self.fullname = ""
# self.dir = os.getcwd()
self.dir = os.path.dirname(os.path.realpath(sys.argv[0]))
self.uploadDir = self.dir
self.ratingFileDir = self.dir + '\\AQ_Extracted_Data'
self.saveDir = self.dir
self.scriptLoc = 'EHSN_rating_curve.exe'
if hasattr(sys, '_MEIPASS'):
self.scriptLoc = os.path.join(sys._MEIPASS, self.scriptLoc)
else:
self.scriptLoc = os.getcwd() + "\\" + self.scriptLoc
self.config_path = "config.xml"
if hasattr(sys, '_MEIPASS'):
self.config_path = os.path.join(sys._MEIPASS, self.config_path)
else:
self.config_path = os.getcwd() + "\\" + self.config_path
# Label variables
self.fNewLabel = 'New\tCtrl+N'
self.fNewDesc = 'Start a new eHSN application'
self.fOpenLabel = '&Open\tCtrl+O'
self.fOpenDesc = "Open an existing field note (this will be in XML format)"
self.fXmlLabel = '&Save As\tCtrl+A'
self.fXmlDesc = 'Save the current eHSN field note as an XML file.'
self.fSaveLabel = 'Save\tCtrl+S'
self.fSaveDesc = 'Save the current eHSN field note as an XML file.'
#self.fPdfLabel = 'Generate PDF - Booklet Type\tCtrl+P'
#self.fPdfDesc = 'Generate a PDF of the current field note in the same size format as previous paper field notes.'
self.fPdfsLabel = "Generate PDF - Front Page Only"
self.fPdfsDesc = "Generate a PDF of the front page of the current field note (good for providing to partners and clients)."
self.fPdfvLabel = "Generate PDF - Complete Note on Full Page\tCtrl+P"
self.fPdfvDesc = "Generate pdf for the current field visit as 8.5 x 11 size format."
self.fAquLabel = '&Upload eHSN && FV Package to AQUARIUS\tCtrl+U'
self.fAquDesc = 'Upload this Field Visit\'s information to AQUARIUS (saves XML and PDF at the same time)'
self.fExitLabel = '&Quit\tCtrl+Q'
self.fExitDesc = 'Exit Program'
self.hAboutLabel = '&About'
self.hAboutDesc = 'About eHSN'
self.heHelpLabel = 'eHSN &Help'
self.fSaveExitLabel = 'Save && Exit\tCtrl+E'
self.fSaveExitDesc = 'Save and Exit'
self.heHelpDesc = "Instructions for the completion of eHSN"
# self.tCalcLabel = "Calculator\tCtrl+L"
self.tMagnDesc = "Windows Magnifier"
self.tMagnLabel = "Magnifier\tCtrl+M"
# self.tCalcDesc = "A simple calculator."
self.tScalLabel = "Scaling"
self.tScalDesc = "Scaling"
self.tScalSub1Label = "Size ++\tCtrl+="
self.tScalSub1Desc = "Size ++"
self.tScalSub2Label = "Size --\tCtrl+-"
self.tScalSub2Desc = "Size --"
# self.scalLbl = "100%-------------"
# self.tScalSub3Label = "80%"
# self.tScalSub3Desc = "80%"
self.iDisLabel = 'Import MB ADCP (*.dis) Files'
self.iDisDesc = 'Import MB ADCP (*.dis) Files'
self.iMmtLabel = 'Import MB ADCP (*.mmt) Files'
self.iMmtDesc = 'Import MB ADCP (*.mmt) Files'
self.cConfLabel = 'Configure Stations, Meters and BM/Ref file locations'
self.cConfDesc = 'Optionally set the file locations for the stations metadata, meters, and Bench Mark configuration Files.'
self.tRcvtLabel = 'Rating Curve Viewer Tool\tCtrl+R'
self.tRcvtDesc = 'use this tool to view your measurement in comparison to previous discharge measurements graphically, as well as the shift and % differences from the curve.'
self.cAdetLabel = 'AQUARIUS Data Extraction Tool\tCtrl+D'
self.cAdetDesc = 'Run this tool first while in the office. It will extract data from AQUARIUS so you can take it into the field.'
self.hUpdatelabel = 'Updates/Messages'
self.hUpdateDesc = 'Update eHSN'
self.iHfcLabel = "Import HFC Files (*.mq*)"
self.iHfcDesc = "Import HFC Files (*.mq*)"
self.iFtDisLabel = "Import FlowTracker (*.dis)"
self.iFtDisDesc = "Import FlowTracker (*.dis)"
self.iQrXmlLabel = "Import QRev (*.xml)"
self.iQrXmlDesc = "Import QRev (*.xml)"
self.iQrIntMSXmlLabel = "Import QRevMS (*.xml)"
self.iQrIntMSXmlDesc = "Import QRevMS (*.xml)"
self.iSxsProMmtLabel = "Import SxS Pro mmt (*.xml)"
self.iSxsProMmtDesc = "Import SxS Pro mmt (*.xml)"
self.iRsslDisLabel = "Import RSSL (*.dis)"
self.iRsslDisDesc = "Import RSSL (*.dis)"
self.iFt2Label = "Import FlowTracker2 (*.ft)"
self.iFt2Desc = "Import FlowTracker2 (*.ft)"
self.iEhsnLabel = "Merge eHSN Midsection (*.xml)"
self.iEhsnDesc = "Merge eHSN Midsection (*.xml)"
self.FVpackLabel = "Create Field Visit Package (ready for RFT)"
self.FVpackDesc = "Create a ZIP file with eHSN XML and PDF, along with all files in the attachment tab (if there are any), for Aquarius Field Visit Upload."
self.fullStyleSheetFileName = 'WSC_EHSN.xsml'
self.summStyleSheetFileName = 'WSC_EHSN_Summary.xsml'
self.viewStyleSheetFileName = 'WSC_EHSN_VIEW.xsml'
if hasattr(sys, '_MEIPASS'):
self.fullStyleSheetFilePath = os.path.join(sys._MEIPASS, self.fullStyleSheetFileName)
self.summStyleSheetFilePath = os.path.join(sys._MEIPASS, self.summStyleSheetFileName)
self.viewStyleSheetFilePath = os.path.join(sys._MEIPASS, self.viewStyleSheetFileName)
else:
self.fullStyleSheetFilePath = os.getcwd() + "\\" + self.fullStyleSheetFileName
self.summStyleSheetFilePath = os.getcwd() + "\\" + self.summStyleSheetFileName
self.viewStyleSheetFilePath = os.getcwd() + "\\" + self.viewStyleSheetFileName
# self.stylesheetPath = "Saved Field Visits"
self.fileSaveTitle = 'Save As'
self.fileSavePDFStylesheetMessage = "Stylesheet not found, please locate stylesheet file: " + self.fullStyleSheetFileName
self.fileSavePDFStylesheetTitle = "Locate Stylesheet"
self.fileSavePDFStylesheetSummMessage = "Stylesheet not found, please locate stylesheet file: " + self.summStyleSheetFileName
self.fileSavePDFStylesheetViewMessage = "Stylesheet not found, please locate stylesheet file: " + self.viewStyleSheetFileName
self.fileSavePDFSaveTitle = 'Save eHSN as PDF'
self.fileOpenTitle = 'Open'
self.fileExitMessage = 'Do you want to Exit?'
self.fileExitTitle = 'Exit'
self.fileAQStnMessage = "Please enter a Station Number"
self.fileAQStnTitle = "Station information missing"
self.fileAQTZMessage = "Please select timezone"
self.fileAQTZTitle = "Time zone missing"
self.fileAQUploadTitle = "Upload eHSN and FV Package to AQUARIUS"
self.fileAQUpSuccessMessage = "Upload Successful"
self.fileAQUpSuccessTitle = "Upload Complete"
self.errorTitle = "Error"
self.fileOpenMessage = "Do you want to save the changes?"
self.helpAboutTitle = 'Hydrometric Survey Notes'
self.helpAboutBaseDesc = 'Version: '
self.helpHelpTitle = "Hydrometric Survey Notes Help"
self.helpHelpMessage = "Help for this application can be found on the 'WSC Information Station' " \
"as well as the NHS ecollab library."
self.movingBoatOpenTitle = 'Open saved moving boat data from an external file'
self.saveBeforeUploadDesc = 'Do you want to save before uploading to AQUARIUS'
self.noSaveBeforeUploadMsg = 'Continue without saving'
self.saveBeforeUploadTitle = 'Save before uploading'
self.iconName = "icon_transparent.ico"
self.logoName = "icon_transparent.jpg"
self.configName = "config.xml"
self.closeRCVDesc = "Please close the plot window first"
self.closeRCVTitle = "Message from Rating Curve View Tool"
self.startTimeErrorMsg = "Start & end time cannot be '00:00'"
self.savePDFErrorMsg = "A pdf file with the same name is open. Please close or rename that file before generating a new one."
self.savePDFErrorTitle = "Error saving PDF file"
self.qrName = "qr.jpg"
self.icon_path = self.iconName
self.qr_path = "c:\\temp\\eHSN\\" + self.qrName
self.logo_path = self.logoName
self.configPath = self.configName
self.uploadOpenPdf = False
self.path = self.dir
self.savedName = ''
self.savedPassword = ''
self.savedServer = ""
self.savedStationsPath = ''
self.savedMetersPath = ''
self.savedLevelsPath = ''
self.notReviewedUploadWarning = """There is no indication that this survey note has been reviewed. Hydrometric survey notes must by reviewed prior to upload. Once reviewed, ensure the check-box on the Front Page has been checked."""
# self.importQRevMsg = "Upon importing all eHSN data entered in the following sections will be overwritten by data imported from measurement file. you can uncheck one or more of these measuremehnts if you opt for the eHSN data not to be overwritten by the imported data."
# self.importQRevOption1 = "Discharge Measurements Summary"
# self.importQRevOption2 = "Discharge Measurement and Equipment Details"
# self.importQRevOption3 = "Moving Boat Page"
self.fileErrMsg = "Unable to read the station ID from the external file specified, please ensure you have selected the correct file."
self.fileErrTitle = "Error reading station IDs"
self.overwriteMsg = "Some information on the current survey note will be overwritten by the imported data. Countinue?"
self.iverwriteTitle = "Imported data overwrite"
self.tzEhsnMissErrMsg = "Missing TimeZone from eHSN"
self.tzEhsnMissErrTitle = "Missing TimeZone from eHSN"
self.tzFt2MissErrMsg = """Missing TimeZone from FlowTracker2\n
The FlowTracker2 date and time is stored as Coordinated Universal Time (UTC)
along with an offset for local time. Make sure the 'Offset From UTC' time is
correct for your location. If the time offset is not correct, the times imported
into eHSN will be wrong."""
self.tzFt2MissErrTitle = "Missing TimeZone from FlowTracker2"
self.tzMatchErrMsg = """The time zone (TZ) entered in eHSN is different from the TZ detected in Flowtracker2 file. The file will not be imported unless this difference is reconciled.\n
Hint!
- Check the TZ selected at the front page of eHSN, Or
- Check the 'offset from UTC' time entered in Flowtracker2 file.
Note: The FlowTracker2 date and time is stored as UTC along with an offset for local time. Make sure the 'Offset From UTC' time is correctly entered for your location."""
self.tzMatchErrTitle = "TimeZones are not matching"
self.readFT2ErrMsg = "Error during reading ft file(FlowTracker2). It may have been caused by a lack of user rights. Please try to log in with another account."
self.readFT2ErrTitle = "Error during reading ft file(FlowTracker2)"
self.sxsImportAttentionMsg = "Attention!\n\nThe xml file displays discharge to two decimal places; the calculated discharge and average velocity might be slightly different from the values viewed in SxS Pro software."
self.sxsImportAttentionTitle = "Attention"
self.qrevImportAttentionMsg = "Attention!\n\nThe minimum recommended QRev version is 4.23. Please consider updating your QRev software at your earliest convenience."
self.qrevImportAttentionTitle = "Attention"
self.RatingCurveViewerToolFrame = None
self.ratingCurveExtraction = None
# self.calc = None
self.config = None
self.manager = None
self.configpath = ''
# subprocess.Popen([file],shell=True)
os.chdir(self.dir)
self.numsRead = []
self.namesRead = []
self.tz = []
self.stationLevel = []
self.bm = []
self.ele = []
self.desc = []
self.bmIndex = []
self.serialNumbers = []
self.instrumentTypes = []
self.manufactruers = []
self.models = []
self.frequencies = []
self.firmware = []
self.emptyStation = False
self.emptyMeter = False
self.emptyLevel = False
# self.qRevFileName = ""
self.qRevDir = ""
self.qRevIntMSDir = ""
self.flowTrackerDir = ""
self.hfcDir = ""
self.ft2FtDir = ""
self.ft2JsonDir = ""
self.sxsDir = ""
self.rsslDir = ""
self.ehsnMidDir = ""
self.importSucessMsg = "Data imported succesfully!"
self.importSucessTitle = "Succesful import"
self.rootPath = self.dir
self.saveAsDirectory = self.dir
self.inipath = self.saveAsDirectory + r'\AQ_Extracted_Data\iniPath.ini'
self.tempPath = "c:\\temp\\eHSN\\"
#self.uploadSaveDir = os.getcwd()
self.uploadSaveDir = self.dir
self.importedBGColor = "#48C9B0"
self.InitUI()
self.Show(True)
self.Update()
self.Refresh()
def InitUI(self):
if self.mode=="DEBUG":
print("Setup the Frame")
self.locale = wx.Locale(self.lang)
myFont = wx.Font(10, wx.DEFAULT, wx.FONTSTYLE_NORMAL, wx.NORMAL, False)
if GetSystemMetrics(11) > 39:
myFont = wx.Font(8, wx.DEFAULT, wx.FONTSTYLE_NORMAL, wx.NORMAL, False)
self.SetFont(myFont)
self.CreateStatusBar(style=wx.STB_SIZEGRIP|wx.STB_SHOW_TIPS|wx.STB_ELLIPSIZE_END|wx.FULL_REPAINT_ON_RESIZE)
self.SetStatusText("Backup located in " + self.tempPath)
fileMenu = wx.Menu()
fnew = fileMenu.Append(ID_FILE_NEW, self.fNewLabel, self.fNewDesc)
fopen = fileMenu.Append(ID_FILE_OPEN, self.fOpenLabel, self.fOpenDesc)
fileMenu.AppendSeparator()
fsave = fileMenu.Append(ID_FILE_SAVE, self.fSaveLabel, self.fXmlDesc)
fxml = fileMenu.Append(ID_FILE_EXPORT_XML, self.fXmlLabel, self.fXmlDesc)
fileMenu.AppendSeparator()
fvpack = fileMenu.Append(ID_FV_PACKAGE, self.FVpackLabel, self.FVpackDesc)
fileMenu.AppendSeparator()
#fpdf = fileMenu.Append(ID_FILE_EXPORT_PDF, self.fPdfLabel, self.fPdfDesc)
fpdfs = fileMenu.Append(ID_FILE_EXPORT_PDF_SUMM, self.fPdfsLabel, self.fPdfsDesc)
#fileMenu.AppendSeparator()
fpdfview = fileMenu.Append(ID_FILE_EXPORT_PDF_VIEW, self.fPdfvLabel, self.fPdfvDesc)
fileMenu.AppendSeparator()
faqu = fileMenu.Append(ID_FILE_EXPORT_AQUARIUS, self.fAquLabel, self.fAquDesc)
fileMenu.AppendSeparator()
# fsexit = fileMenu.Append(ID_FILE_SAVE_EXIT, self.fSaveExitLabel, self.fSaveExitDesc)
fsexit = fileMenu.Append(wx.MenuItem(fileMenu, ID_FILE_SAVE_EXIT, self.fSaveExitLabel, self.fSaveExitDesc))
fexit = wx.MenuItem(fileMenu, ID_FILE_EXIT, self.fExitLabel, self.fExitDesc)
fileMenu.Append(fexit)
# fexit = fileMenu.Append(ID_FILE_EXIT, self.fExitLabel, self.fExitDesc)
configMenu = wx.Menu()
cConfig = configMenu.Append(ID_CONF_CONF, self.cConfLabel, self.cConfDesc)
scalingSubMenu = wx.Menu()
# configMenu.AppendSubMenu(scalingSubMenu,self.tScalLabel, self.tScalDesc)
# tScal1 = scalingSubMenu.Append(ID_TOOLS_SCALING_SUB1, self.tScalSub1Label, self.tScalSub1Desc)
# tScal2 = scalingSubMenu.Append(ID_TOOLS_SCALING_SUB2, self.tScalSub2Label, self.tScalSub2Desc)
toolMenu = wx.Menu()
cAdet = toolMenu.Append(ID_CONF_ADET, self.cAdetLabel, self.cAdetDesc)
tRcvt = toolMenu.Append(ID_TOOLS_RCVT, self.tRcvtLabel, self.tRcvtDesc)
# toolMenu.AppendSeparator()
# tCalc = toolMenu.Append(ID_TOOLS_CALC, self.tCalcLabel, self.tCalcDesc)
# tMagn = toolMenu.Append(ID_TOOLS_MAGN, self.tMagnLabel, self.tMagnDesc)
# tSkatch = toolMenu.Append(ID_TOOLS_DRAW, "Paint", "Draw")
# editMenu = wx.Menu()
# epref = editMenu.Append(ID_EDIT_PREF, '&Preferences', "Edit eHSN Preferences (Currently does nothing)")
helpMenu = wx.Menu()
habout = helpMenu.Append(ID_HELP_ABOUT, self.hAboutLabel, self.hAboutDesc)
hehelp = helpMenu.Append(ID_HELP_EHELP, self.heHelpLabel, self.heHelpDesc)
helpMenu.AppendSeparator()
hupdate = helpMenu.Append(ID_HELP_UPDATE, self.hUpdatelabel, self.hUpdateDesc)
menuImport = wx.Menu()
iHfc = menuImport.Append(ID_IMPORT_HFC, self.iHfcLabel, self.iHfcDesc)
menuImport.AppendSeparator()
iFtdis = menuImport.Append(ID_IMPORT_FTDIS, self.iFtDisLabel, self.iFtDisDesc)
menuImport.AppendSeparator()
iFt2 = menuImport.Append(ID_IMPORT_FT2, self.iFt2Label, self.iFt2Desc)
menuImport.AppendSeparator()
iQrxml = menuImport.Append(ID_IMPORT_QRXML, self.iQrXmlLabel, self.iQrXmlDesc)
menuImport.AppendSeparator()
iQrIntMSxml = menuImport.Append(ID_IMPORT_QRIMXML, self.iQrIntMSXmlLabel, self.iQrIntMSXmlDesc)
menuImport.AppendSeparator()
iSxsmmt = menuImport.Append(ID_IMPORT_SXSMMT, self.iSxsProMmtLabel, self.iSxsProMmtDesc)
menuImport.AppendSeparator()
iRssdis = menuImport.Append(ID_IMPORT_RSSDIS, self.iRsslDisLabel, self.iRsslDisDesc)
menuImport.AppendSeparator()
iEhsn = menuImport.Append(ID_IMPORT_EHSN, self.iEhsnLabel, self.iEhsnDesc)
menuBar = wx.MenuBar()
menuBar.Append(fileMenu, '&File')
menuBar.Append(configMenu, '&Configuration')
menuBar.Append(toolMenu, '&Tools')
menuBar.Append(menuImport, '&Import')
# menuBar.Append(editMenu, '&Edit')
menuBar.Append(helpMenu, '&Help')
self.SetMenuBar(menuBar)
self.Bind(wx.EVT_MENU, self.OnNew, fnew)
self.Bind(wx.EVT_MENU, self.OnFileOpen, fopen)
self.Bind(wx.EVT_MENU, self.OnFileSaveAs, fxml)
self.Bind(wx.EVT_MENU, self.OnFileSave, fsave)
self.Bind(wx.EVT_MENU, self.OnSaveFVPackage, fvpack)
#self.Bind(wx.EVT_MENU, self.OnFileSaveAsPDF, fpdf)
self.Bind(wx.EVT_MENU, self.OnFileSaveAsPDFSumm, fpdfs)
self.Bind(wx.EVT_MENU, self.OnFileSaveAsPDFView, fpdfview)
self.Bind(wx.EVT_MENU, self.OnAquariusUpload, faqu)
self.Bind(wx.EVT_MENU, self.OnFileExit, fexit)
self.Bind(wx.EVT_MENU, self.OnHelpAbout, habout)
self.Bind(wx.EVT_MENU, self.OnHelpEHelp, hehelp)
self.Bind(wx.EVT_CLOSE, self.OnFileExit)
# self.Bind(wx.EVT_MENU, self.OnCalc, tCalc)
# self.Bind(wx.EVT_MENU, self.OnMagn, tMagn)
# self.Bind(wx.EVT_MENU, self.OnScal1, tScal1)
# self.Bind(wx.EVT_MENU, self.OnScal2, tScal2)
# self.Bind(wx.EVT_MENU, self.OnScal3, tScal3)
# self.Bind(wx.EVT_MENU, self.OnImportMovingBoaiMmt, iMmt)
self.Bind(wx.EVT_MENU, self.OnConfig, cConfig)
# self.Bind(wx.EVT_MENU, self.OnMovingBoaiDis, iDis)
self.Bind(wx.EVT_MENU, self.OnRatingCurveViewerToolFrame, tRcvt)
self.Bind(wx.EVT_MENU, self.OnAQUARIUSDataExtractionToolFrame, cAdet)
self.Bind(wx.EVT_MENU, self.OnUpdate, hupdate)
self.Bind(wx.EVT_MENU, self.OnSaveExit, fsexit)
# self.Bind(wx.EVT_MENU, self.OnDraw, tSkatch)
self.Bind(wx.EVT_MENU, self.OnImport, iHfc)
self.Bind(wx.EVT_MENU, self.OnImport, iFtdis)
self.Bind(wx.EVT_MENU, self.OnImport, iFt2)
self.Bind(wx.EVT_MENU, self.OnImport, iQrxml)
self.Bind(wx.EVT_MENU, self.OnImport, iQrIntMSxml)
self.Bind(wx.EVT_MENU, self.OnImport, iSxsmmt)
self.Bind(wx.EVT_MENU, self.OnImport, iRssdis)
self.Bind(wx.EVT_MENU, self.OnImport, iEhsn)
self.layout = None
#Icon Path
if hasattr(sys, '_MEIPASS'):
self.icon_path = os.path.join(sys._MEIPASS, self.icon_path)
self.logo_path = os.path.join(sys._MEIPASS, self.logo_path)
else:
self.icon_path = os.path.join(self.dir, self.icon_path)
self.logo_path = os.path.join(self.dir, self.logo_path)
if os.path.exists(self.icon_path):
png = wx.Image(self.icon_path, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
self.icon = wx.Icon(png)
self.SetIcon(self.icon)
# self.IniSaveAsPath()
self.IniUploadSavePath()
self.CreateFrames()
def CreateFrames(self):
mainSizer = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(mainSizer)
if self.layout is not None:
self.layout.Show(False)
self.layout.Destroy()
self.layout = fnb.FlatNotebook(self, style=wx.NB_TOP, agwStyle=fnb.FNB_NO_X_BUTTON|fnb.FNB_NO_NAV_BUTTONS, size=eHSN_WINDOW_SIZE)
# # Create a File Drop Target object
# fileDrop = FileDropTarget(self.layout)
# # Link the Drop Target Object to the Text Control
# self.layout.SetDropTarget(fileDrop)
#First Page
formSizer = wx.BoxSizer(wx.VERTICAL)
self.form = SpecialScrolledPanel(self.layout, style=wx.SIMPLE_BORDER)
self.form.SetupScrolling()
self.titleHeader = TitleHeaderPanel(self.mode, self.version, self.form, style=wx.NO_BORDER)
self.genInfo = GenInfoPanel(self.mode, self.form, style=wx.SIMPLE_BORDER)
self.disMeas = DischargeMeasurementsPanel(self.mode, self.lang, self.form, style=wx.SIMPLE_BORDER)
midSizer = wx.BoxSizer(wx.HORIZONTAL)
self.stageMeas = StageMeasurementsPanel(self.mode, self.lang, self.form, style=wx.BORDER_NONE, size=(-1, -1))
self.envCond = EnvironmentConditionsPanel(self.mode, self.form, style=wx.SIMPLE_BORDER, size=(-1, -1))
midSizer.Add(self.stageMeas, 23, wx.EXPAND)
midSizer.Add(self.envCond, 10, wx.EXPAND)
self.measResults = MeasurementResultsPanel(self.mode, self.lang, self.form, style=wx.SIMPLE_BORDER, size=(1, -1))
self.instrDep = InstrumentDeploymentInfoPanel(self.mode, self.form, style=wx.SIMPLE_BORDER, size=(720, -1))
# self.remarks = RemarksPanel(self.mode, self.form, style=wx.SIMPLE_BORDER, size=(720, -1))
self.partyInfo = PartyInfoPanel(self.mode, self.form, style=wx.BORDER_NONE, size=(-1, 32))
formSizer.Add(self.titleHeader, 0, wx.EXPAND|wx.ALL, 3)
formSizer.Add(self.genInfo, 0, wx.EXPAND|wx.ALL, 3)
formSizer.Add(self.disMeas, 0, wx.EXPAND|wx.ALL, 3)
formSizer.Add(midSizer, 0, wx.EXPAND|wx.ALL, 3)
formSizer.Add(self.measResults, 0, wx.EXPAND|wx.ALL, 3)
formSizer.Add(self.instrDep, 0, wx.EXPAND|wx.ALL, 3)
# formSizer.Add(self.remarks, 0, wx.EXPAND|wx.ALL, 3)
formSizer.Add(self.partyInfo, 0, wx.EXPAND|wx.LEFT|wx.TOP|wx.RIGHT, 3)
self.form.SetSizerAndFit(formSizer)
form2_1Sizer = wx.BoxSizer(wx.VERTICAL)
self.form2_1 = SpecialScrolledPanel(self.layout, style=wx.SIMPLE_BORDER)
self.form2_1.SetupScrolling()
self.waterLevelRun = WaterLevelRunPanel(self.mode, self.lang, self.dir, self.form2_1, style=wx.BORDER_NONE, size = (900, -1))
form2_1Sizer.Add(self.waterLevelRun, 1, wx.EXPAND)
self.form2_1.SetSizerAndFit(form2_1Sizer)
#Moving Boat Page
form3Sizer = wx.BoxSizer(wx.VERTICAL)
self.form3 = SpecialScrolledPanel(self.layout, style=wx.SIMPLE_BORDER)
self.form3.SetupScrolling()
self.movingBoatMeasurements = MovingBoatMeasurementsPanel(self.mode, self.lang, self.form3, style=wx.SIMPLE_BORDER, size=(780, -1))
form3Sizer.Add(self.movingBoatMeasurements, 1, wx.EXPAND)
self.form3.SetSizerAndFit(form3Sizer)
#Midsec Page
form4Sizer = wx.BoxSizer(wx.VERTICAL)
self.form4 = SpecialScrolledPanel(self.layout, style=wx.SIMPLE_BORDER)
self.form4.SetupScrolling()
self.midsecMeasurements = MidSectionMeasurementsPanel(self.mode, self.lang, self.form4, style=wx.SIMPLE_BORDER, size=(920, -1))
form4Sizer.Add(self.midsecMeasurements, 1, wx.EXPAND)
self.form4.SetSizerAndFit(form4Sizer)
#Checklist third page
form5Sizer = wx.BoxSizer(wx.VERTICAL)
self.form5 = SpecialScrolledPanel(self.layout, style=wx.SIMPLE_BORDER)
self.form5.SetupScrolling()
self.frChecklist = FRChecklistPanel(self.mode, self.form5, style=wx.SIMPLE_BORDER, size=(1, -1))
form5Sizer.Add(self.frChecklist, 1, wx.EXPAND)
self.form5.SetSizerAndFit(form5Sizer)
# Attachment Page Added
form6Sizer = wx.BoxSizer(wx.VERTICAL)
self.form6 = SpecialScrolledPanel(self.layout, style=wx.SIMPLE_BORDER)
self.form6.SetupScrolling()
self.attachment = AttachmentPanel(self, self.mode, self.lang, self.form6, size=(1, -1))
form6Sizer.Add(self.attachment, 1, wx.EXPAND)
self.form6.SetSizerAndFit(form6Sizer)
self.form6.SetSizerAndFit(form6Sizer)
# Attachment Page Added
#Imported Midsection page
# self.form6Sizer = wx.BoxSizer(wx.VERTICAL)
# self.form6 = SpecialScrolledPanel(self.layout, style=wx.SIMPLE_BORDER)
# self.form6.SetupScrolling()
# self.midsecImportPanel = None
# self.showBtn = wx.Button(self.form6, label="Show / Refresh", size=(200, -1))
# self.showBtn.Bind(wx.EVT_BUTTON, self.OnMidShowBtn)
# self.removeBtn = wx.Button(self.form6, label="Remove")
# self.removeBtn.Bind(wx.EVT_BUTTON, self.OnMidRemoveBtn)
# self.form6Sizer.Add(self.showBtn, 0, wx.EXPAND)
# self.form6.SetSizerAndFit(self.form6Sizer)
# InnovTech tab (containing Salt Dilution and Image Velocimitry details currently)
form7Sizer = wx.BoxSizer(wx.VERTICAL)
self.form7 = SpecialScrolledPanel(self.layout, style=wx.SIMPLE_BORDER)
self.form7.SetupScrolling()
self.innovTechChecklist = InnovTechChecklistPanel(self.mode, self.form7, style=wx.SIMPLE_BORDER, size=(1, -1))
form7Sizer.Add(self.innovTechChecklist, 1, wx.EXPAND)
self.form7.SetSizerAndFit(form7Sizer)
# Inventory Management tab
form8Sizer = wx.BoxSizer(wx.VERTICAL)
self.form8 = SpecialScrolledPanel(self.layout, style=wx.SIMPLE_BORDER)
self.form8.SetupScrolling()
self.inventoryManagement = InventoryManagementPanel(self.mode, self.dir, self.form8, style=wx.SIMPLE_BORDER, size=(1, -1))
form8Sizer.Add(self.inventoryManagement, 1, wx.EXPAND)
self.form8.SetSizerAndFit(form8Sizer)
self.layout.AddPage(self.form, "Front Page")
self.layout.AddPage(self.form2_1, "Level Notes")
self.layout.AddPage(self.form3, "Moving Boat")
self.layout.AddPage(self.form4, "Mid-Section")
self.layout.AddPage(self.form5, "Field Review")
self.layout.AddPage(self.form7, "Other Methods")
self.layout.AddPage(self.form8, "Inventory")
# Attachment Page Added
self.layout.AddPage(self.form6, "FV Package")
# self.layout.AddPage(self.form6, "Imported Mid-Section")
# self.layout.AddPage(form6, "User Config")
self.layout.Show(True)
self.Show(True)
self.layout.Layout()
self.layout.Fit()
self.SendSizeEvent()
self.Update()
self.Refresh()
self.Layout()
self.genInfo.stnNumCmbo.Bind(wx.EVT_TEXT, self.OnStationSelect)
self.genInfo.stnNumCmbo.Bind(wx.EVT_COMBOBOX, self.OnStationHasBeenSelected)
self.genInfo.stnNumCmbo.Bind(wx.EVT_KILL_FOCUS, self.OnStationKillFocus)
self.genInfo.stnNameCtrl.Bind(wx.EVT_TEXT, self.OnStationNameSelect)
self.zoomPanel = ZoomPanel(self.mode, self, size=(-1,20))
mainSizer.Add(self.layout, 1, wx.EXPAND)
mainSizer.Add(self.zoomPanel, 0, wx.EXPAND)
# mainSizer.Add((-1,20), 0, wx.EXPAND)
#Auto save an xml file in the the same directory of the eHSN folder for every seperate model
#(the event will be placed on each common filed for each model, after the focus leaving the event will be triggered)
#The saved xml will be seperate than the original xml file and only overwrite the autosave.xml
def OnAutoSave(self, event):
self.AutoSave(str(event.GetEventObject().GetValue()))
event.Skip()
def AutoSave(self, msg):
self.manager.ExportAsXML(self.dir + "\\AutoSave.xml", msg)
defaultName = "AutoSave.xml"
if self.manager is not None:
date = datetime.datetime.strptime(str(self.manager.genInfoManager.datePicker), self.manager.DT_FORMAT)
date = date.strftime("%Y%m%d")
defaultName = str(self.manager.genInfoManager.stnNumCmbo) + "_" + str(date) + "_FV.xml"
folder = "c:\\temp\\eHSN\\"
name = folder + defaultName
if not os.path.isdir(folder):
os.makedirs(folder)
self.manager.ExportAsXML(name, msg)
# print "Save to AutoSave.xml"
def OnAQUARIUSDataExtractionToolFrame(self, event):
self.AutoSave(None)
VersionCheck.Check(self.version, self, False)
self.ratingCurveExtraction = AQUARIUSDataExtractionToolFrame(self.mode, self.ratingFileDir, self.scriptLoc, self, self, size=(555, 560))
self.ratingCurveExtraction.Show()
#self.LoadDefaultCbonfig()
# app.MainLoop()
def OnRatingCurveViewerToolFrame(self, event):
self.AutoSave(None)
if self.RatingCurveViewerToolFrame is None:
self.RatingCurveViewerToolFrame = RatingCurveViewerToolFrame(self.mode, self.ratingFileDir, self.manager.genInfoManager.stnNumCmbo,\
self.manager.disMeasManager, wx.LANGUAGE_ENGLISH, self.manager.ratingCurveViewerToolManager, self, size=(770, 578))
self.RatingCurveViewerToolFrame.Bind(wx.EVT_CLOSE, self.closeRatingCurveViewWindow)
self.RatingCurveViewerToolFrame.exitButton.Bind(wx.EVT_BUTTON, self.closeRatingCurveViewWindow)
self.RatingCurveViewerToolFrame.Show()
self.manager.ratingCurveViewerToolManager.FindStationFile()
else:
self.RatingCurveViewerToolFrame.SetFocus()
# #Call subprocess for Windows Magnifier
# def OnMagn(self, event):
# try:
# subprocess.call("C:\\windows\\system32\\magnify.exe", shell=True)
# except:
# dlg = wx.MessageDialog(None, "Error\nWindowsError: [Error 740] The requested operation requires elevation.", "Error!", wx.OK | wx.ICON_ERROR)
# dlg.ShowModal()
#Calling the calculator
'''
def OnCalc(self,e):
if self.calc is None:
self.calc = CalcPanel(self)
_thread.start_new_thread(self.calc.mainloop, ())
elif self.calc.quitFlag:
self.calc = CalcPanel(self)
_thread.start_new_thread(self.calc.mainloop, ())
else:
self.calc.exit()
self.calc = CalcPanel(self)
_thread.start_new_thread(self.calc.mainloop, ())
'''
def closeConfigWindow(self, event):
self.config.Destroy() #This will close the app window.
self.config = None
def closeRatingCurveViewWindow(self, event):
if not self.RatingCurveViewerToolFrame.plotControl:
info = wx.MessageDialog(None, self.closeRCVDesc, self.closeRCVTitle,
wx.OK | wx.ICON_INFORMATION)
info.ShowModal()
else:
self.RatingCurveViewerToolFrame.Destroy() #This will close the app window.
self.RatingCurveViewerToolFrame = None
self.manager.ratingCurveViewerToolManager.gui = None
#On new menu button pressed
def OnNew(self, evt):
# self.CreateFrames()
# self.manager.SetupManagers()
dlg = wx.MessageDialog(self, self.fileOpenMessage, 'New',
wx.YES_NO | wx.CANCEL | wx.ICON_QUESTION)
res = dlg.ShowModal()
if res == wx.ID_YES:
dlg.Destroy()
re = self.OnFileSaveAs(evt)
if re:
self.ResetGUI()
elif res == wx.ID_NO:
dlg.Destroy()
self.ResetGUI()
elif res == wx.ID_CANCEL:
dlg.Destroy()
else:
dlg.Destroy()
self.Destroy()
#Reset user interface from scratch
def ResetGUI(self):
self.Unbind(wx.EVT_SIZE)
self.DestroySubWindows()
#Destroy all the components in the main layout in cluding the self.layout ===========================
for i in self.GetSizer().GetChildren():
i.GetWindow().Destroy()
# self.GetSizer().Destroy()
self.SetSizer(None)
self.layout = None
#======================================================================================================
self.CreateFrames()
self.manager.SetupManagers()
self.SetTitle(self.noteHeaderTxt)
self.name = ""
self.fullname = ""
self.LoadDefaultConfig()
self.manager.BindAutoSave()
self.manager.stageMeasManager.AddEntry()
# 6 Entries
for i in range(9):
self.manager.movingBoatMeasurementsManager.AddEntry()
self.Layout()
def OnConfig(self, event):
self.OpenConfig()
def GetFlatNoteBook(self):
return self.layout
def OpenConfig(self):
if self.config is None:
self.config = ConfigPanel(self, 'Configure Stations, Meters and BM/Ref file locations')
if self.savedStationsPath != '':
self.config.stationsPathText.SetLabel(self.savedStationsPath)
if self.savedMetersPath != '':
self.config.metersPathText.SetLabel(self.savedMetersPath)
if self.savedLevelsPath != '':
self.config.levelsPathText.SetLabel(self.savedLevelsPath)
self.config.stationsResetButton.Bind(wx.EVT_BUTTON, self.OnStationReset)
self.config.stationsButton.Bind(wx.EVT_BUTTON, self.OnStationBrowse)
self.config.levelsButton.Bind(wx.EVT_BUTTON, self.OnLevelBrowse)
self.config.metersButton.Bind(wx.EVT_BUTTON, self.OnMeterBrowse)
self.configpath = os.getcwd()
self.config.Bind(wx.EVT_CLOSE, self.closeConfigWindow)
self.config.closeButton.Bind(wx.EVT_BUTTON, self.closeConfigWindow)
self.config.clearButton.Bind(wx.EVT_BUTTON, self.OnClearAll)
if self.emptyStation:
self.config.stationsPathText.SetForegroundColour("Red")
self.config.stationsPathText.SetLabel('No station information file selected')
if self.emptyMeter:
self.config.metersPathText.SetForegroundColour("Red")
self.config.metersPathText.SetLabel('No meters information file selected')
if self.emptyLevel:
self.config.levelsPathText.SetForegroundColour("Red")
self.config.levelsPathText.SetLabel('No benchmark information file selected')
self.config.Layout()
else:
self.config.SetFocus()
def configExit(self):
self.config.destroy()
self.config = None
def OnSaveExit(self, event):
if self.OnFileSave(event):
self.Destroy()
return True
else:
return False
def OnFileSave(self, e):
if self.fullname == "":
if self.OnFileSaveAs(e):
return True
else: