| 1 |
nino.borges |
695 |
"""
|
| 2 |
|
|
|
| 3 |
|
|
DatReportDialog
|
| 4 |
|
|
|
| 5 |
|
|
Created by
|
| 6 |
|
|
Emanuel Borges
|
| 7 |
|
|
2020.05.13
|
| 8 |
|
|
|
| 9 |
|
|
This dialog displays the results of the DAT analysis.
|
| 10 |
|
|
|
| 11 |
|
|
"""
|
| 12 |
|
|
|
| 13 |
|
|
|
| 14 |
|
|
|
| 15 |
|
|
|
| 16 |
|
|
import wx
|
| 17 |
|
|
|
| 18 |
|
|
class DatReportDialog(wx.Dialog):
|
| 19 |
|
|
|
| 20 |
|
|
def __init__(self, parent, totalRecordCount, fullFieldList, populatedFieldsList, emptyFieldsList, parsingErrorCount):
|
| 21 |
nino.borges |
696 |
self.parent = parent
|
| 22 |
nino.borges |
697 |
wx.Dialog.__init__(self, parent, -1, "DAT Report Results ", style = wx.DEFAULT_DIALOG_STYLE, size = (1000,700))
|
| 23 |
nino.borges |
696 |
recordCountLabel = wx.StaticText(self, -1, "Number of records in DAT: %s "% totalRecordCount)
|
| 24 |
nino.borges |
697 |
parsingErrorCountLabel = wx.StaticText(self, -1, "There are %s parsing errors in this DAT"% parsingErrorCount)
|
| 25 |
nino.borges |
696 |
#self.projectNameTextBox = wx.TextCtrl(self, -1, "", wx.DefaultPosition, (90,-1))
|
| 26 |
|
|
|
| 27 |
nino.borges |
697 |
fullFieldListLabel = wx.StaticText(self, -1, "Fields In DAT:")
|
| 28 |
|
|
fullFieldListText = ''
|
| 29 |
|
|
for i in fullFieldList:
|
| 30 |
|
|
fullFieldListText = fullFieldListText + "%s\n"% i
|
| 31 |
|
|
|
| 32 |
|
|
fullFieldListTextBox = wx.TextCtrl(self, -1, fullFieldListText, wx.DefaultPosition, (300,460), style=wx.TE_MULTILINE)
|
| 33 |
|
|
|
| 34 |
|
|
|
| 35 |
|
|
populatedFieldsListLabel = wx.StaticText(self, -1, "Populated Fields:")
|
| 36 |
|
|
populatedFieldsListText = ''
|
| 37 |
|
|
for i in populatedFieldsList:
|
| 38 |
|
|
populatedFieldsListText = populatedFieldsListText + "%s\n"% i
|
| 39 |
|
|
|
| 40 |
|
|
populatedFieldsListTextBox = wx.TextCtrl(self, -1, populatedFieldsListText, wx.DefaultPosition, (300,460), style=wx.TE_MULTILINE)
|
| 41 |
|
|
|
| 42 |
|
|
|
| 43 |
|
|
emptyFieldsListLabel = wx.StaticText(self, -1, "Empty Fields:")
|
| 44 |
|
|
emptyFieldsListText = ''
|
| 45 |
|
|
for i in emptyFieldsList:
|
| 46 |
|
|
emptyFieldsListText = emptyFieldsListText + "%s\n"% i
|
| 47 |
|
|
|
| 48 |
|
|
emptyFieldsListTextBox = wx.TextCtrl(self, -1, emptyFieldsListText, wx.DefaultPosition, (300,460), style=wx.TE_MULTILINE)
|
| 49 |
|
|
|
| 50 |
|
|
topSectionSizer = wx.BoxSizer(wx.HORIZONTAL)
|
| 51 |
|
|
topSectionSizer.Add(recordCountLabel, 0)
|
| 52 |
|
|
topSectionSizer.Add(parsingErrorCountLabel, 0, wx.LEFT, 400)
|
| 53 |
|
|
|
| 54 |
|
|
fullFieldListSizer = wx.BoxSizer(wx.VERTICAL)
|
| 55 |
|
|
fullFieldListSizer.Add(fullFieldListLabel, 0, wx.ALIGN_LEFT)
|
| 56 |
|
|
fullFieldListSizer.Add(fullFieldListTextBox, 0)
|
| 57 |
|
|
|
| 58 |
|
|
populatedFieldsListSizer = wx.BoxSizer(wx.VERTICAL)
|
| 59 |
|
|
populatedFieldsListSizer.Add(populatedFieldsListLabel, 0, wx.ALIGN_LEFT)
|
| 60 |
|
|
populatedFieldsListSizer.Add(populatedFieldsListTextBox, 0)
|
| 61 |
|
|
|
| 62 |
|
|
emptyFieldsListSizer = wx.BoxSizer(wx.VERTICAL)
|
| 63 |
|
|
emptyFieldsListSizer.Add(emptyFieldsListLabel, 0, wx.ALIGN_LEFT)
|
| 64 |
|
|
emptyFieldsListSizer.Add(emptyFieldsListTextBox, 0)
|
| 65 |
|
|
|
| 66 |
|
|
midSectionSizer = wx.BoxSizer(wx.HORIZONTAL)
|
| 67 |
|
|
midSectionSizer.Add(fullFieldListSizer, 0, wx.ALL, 10)
|
| 68 |
|
|
midSectionSizer.Add(populatedFieldsListSizer, 0, wx.ALL, 10)
|
| 69 |
|
|
midSectionSizer.Add(emptyFieldsListSizer, 0, wx.ALL, 10)
|
| 70 |
|
|
|
| 71 |
|
|
|
| 72 |
|
|
|
| 73 |
|
|
|
| 74 |
|
|
#requiredSectionSizer = wx.GridBagSizer(10,2)
|
| 75 |
|
|
#requiredSectionSizer.Add(recordCountLabel,pos = (0,0))
|
| 76 |
|
|
#requiredSectionSizer.Add(parsingErrorCountLabel,pos = (0,1),span=(1,4), flag = wx.EXPAND)
|
| 77 |
nino.borges |
696 |
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
| 78 |
nino.borges |
697 |
mainSizer.Add(topSectionSizer,0, wx.ALL, 40)
|
| 79 |
|
|
mainSizer.Add(midSectionSizer, 0, wx.ALL, 20)
|
| 80 |
|
|
|
| 81 |
nino.borges |
696 |
|
| 82 |
|
|
oKButton = wx.Button(self, wx.ID_OK)
|
| 83 |
|
|
oKButton.SetDefault()
|
| 84 |
nino.borges |
697 |
|
| 85 |
|
|
mainSizer.Add(oKButton,0, wx.ALL|wx.ALIGN_CENTER, 10)
|
| 86 |
nino.borges |
696 |
|
| 87 |
|
|
self.SetSizer(mainSizer)
|