77
88
99# from odmtools.common.logger import LoggerTool
10- from odmtools .odmdata import series
1110
1211
1312# tool = LoggerTool()
1615
1716OvlCheckEvent , EVT_OVL_CHECK_EVENT = wx .lib .newevent .NewEvent ()
1817from collections import OrderedDict
19- def returnDict ():
20- keys = ['SeriesID' , 'SiteID' , 'SiteCode' , 'SiteName' , 'VariableID' , 'VariableCode' , 'VariableName' , 'Speciation' ,
21- 'VariableUnitsID' , 'VariableUnitsName' , 'SampleMedium' , 'ValueType' , 'TimeSupport' , 'TimeUnitsID' ,
22- 'TimeUnitsName' , 'DataType' , 'GeneralCategory' , 'MethodID' , 'MethodDescription' , 'SourceID' ,
23- 'SourceDescription' , 'Organization' , 'Citation' , 'QualityControlLevelID' , 'QualityControlLevelCode' ,
24- 'BeginDateTime' , 'EndDateTime' , 'BeginDateTimeUTC' , 'EndDateTimeUTC' , 'ValueCount'
25- ]
26- values = ['id' , 'site_id' , 'site_code' , 'site_name' , 'variable_id' , 'variable_code' , 'variable_name' , 'speciation' ,
27- 'variable_units_id' , 'variable_units_name' , 'sample_medium' , 'value_type' , 'time_support' ,
28- 'time_units_id' , 'time_units_name' , 'data_type' , 'general_category' , 'method_id' , 'method_description' ,
29- 'source_id' , 'source_description' , 'organization' , 'citation' , 'quality_control_level_id' ,
30- 'quality_control_level_code' , 'begin_date_time' , 'end_date_time' , 'begin_date_time_utc' ,
31- 'end_date_time_utc' , 'value_count'
32- ]
33- return OrderedDict (zip (keys , values ))
18+ # def returnDict():
19+ # keys = ['SeriesID', 'SiteID', 'SiteCode', 'SiteName', 'VariableID', 'VariableCode', 'VariableName', 'Speciation',
20+ # 'VariableUnitsID', 'VariableUnitsName', 'SampleMedium', 'ValueType', 'TimeSupport', 'TimeUnitsID',
21+ # 'TimeUnitsName', 'DataType', 'GeneralCategory', 'MethodID', 'MethodDescription', 'SourceID',
22+ # 'SourceDescription', 'Organization', 'Citation', 'QualityControlLevelID', 'QualityControlLevelCode',
23+ # 'BeginDateTime', 'EndDateTime', 'BeginDateTimeUTC', 'EndDateTimeUTC', 'ValueCount'
24+ # ]
25+ # values = ['id', 'site_id', 'site_code', 'site_name', 'variable_id', 'variable_code', 'variable_name', 'speciation',
26+ # 'variable_units_id', 'variable_units_name', 'sample_medium', 'value_type', 'time_support',
27+ # 'time_units_id', 'time_units_name', 'data_type', 'general_category', 'method_id', 'method_description',
28+ # 'source_id', 'source_description', 'organization', 'citation', 'quality_control_level_id',
29+ # 'quality_control_level_code', 'begin_date_time', 'end_date_time', 'begin_date_time_utc',
30+ # 'end_date_time_utc', 'value_count'
31+ # ]
32+ # return OrderedDict(zip(keys, values))
33+
34+
35+
36+ # def returnDict():
3437
3538class clsSeriesTable (FastObjectListView ):
3639 def __init__ (self , * args , ** kwargs ):
@@ -47,8 +50,8 @@ def __init__(self, *args, **kwargs):
4750 """Object being edited"""
4851 self .editingObject = None
4952
50- self ._buildColumns ()
51- self . CreateCheckStateColumn ()
53+ # self._buildColumns()
54+
5255
5356 def rowFormatter (listItem , point ):
5457 listItem .SetFont (wx .Font (11 , wx .FONTFAMILY_DEFAULT , wx .FONTSTYLE_NORMAL , wx .FONTWEIGHT_NORMAL , False ))
@@ -60,13 +63,16 @@ def onKeyPress(self, evt):
6063 """Ignores Keypresses"""
6164 pass
6265
63- def _buildColumns (self ):
66+ def _buildColumns (self , columns ):
6467 seriesColumns = [
65- ColumnDefn (key , align = "left" , minimumWidth = 100 , valueGetter = value ,
68+ ColumnDefn (key , align = "left" , minimumWidth = 100 , valueGetter = key ,
6669 # stringConverter = '%s')
6770 stringConverter = '%Y-%m-%d %H:%M:%S' if "date" in key .lower () else '%s' )
68- for key , value in returnDict ().iteritems ()]
71+ for key in columns ]
72+
73+
6974 self .SetColumns (seriesColumns )
75+ self .CreateCheckStateColumn ()
7076
7177 """User can select series using the mouse to click on check boxes """
7278
0 commit comments