bacnet/bacnet.py
changeset 3931 1c0263e2b3b1
parent 3750 f62625418bff
equal deleted inserted replaced
3930:1cb8f90bf4fd 3931:1c0263e2b3b1
   151     #                             (these are the objects that implement a grid table to edit/view the
   151     #                             (these are the objects that implement a grid table to edit/view the
   152     #                              corresponding mode parameters)
   152     #                              corresponding mode parameters)
   153     #
   153     #
   154     #  Logic:
   154     #  Logic:
   155     #    - The xx_VarEditor classes inherit from wx.grid.Grid
   155     #    - The xx_VarEditor classes inherit from wx.grid.Grid
   156     #    - The xx_ObjTable  classes inherit from wx.grid.PyGridTableBase
   156     #    - The xx_ObjTable  classes inherit from wx.grid.GridTableBase
   157     #  To be more precise, the inheritance tree is actually:
   157     #  To be more precise, the inheritance tree is actually:
   158     #    xx_VarEditor -> ObjectGrid -> CustomGrid   -> wx.grid.Grid
   158     #    xx_VarEditor -> ObjectGrid -> CustomGrid   -> wx.grid.Grid
   159     #    xx_ObjTable  -> ObjectTable -> CustomTable -> wx.grid.PyGridTableBase)
   159     #    xx_ObjTable  -> ObjectTable -> CustomTable -> wx.grid.GridTableBase)
   160     #
   160     #
   161     #  Note that wx.grid.Grid is prepared to work with wx.grid.PyGridTableBase as the container of
   161     #  Note that wx.grid.Grid is prepared to work with wx.grid.GridTableBase as the container of
   162     #  data that is displayed and edited in the Grid.
   162     #  data that is displayed and edited in the Grid.
   163 
   163 
   164     ConfNodeMethods = [
   164     ConfNodeMethods = [
   165         {"bitmap": "ExportSlave",
   165         {"bitmap": "ExportSlave",
   166          "name": _("Export slave"),
   166          "name": _("Export slave"),
   407         # so we only need to save the data that is stored in ObjTablesData objects
   407         # so we only need to save the data that is stored in ObjTablesData objects
   408         # Note that we do not store the ObjTables objects. ObjTables is of a class that
   408         # Note that we do not store the ObjTables objects. ObjTables is of a class that
   409         # contains more stuff we do not need to store. Actually it is a bad idea to store
   409         # contains more stuff we do not need to store. Actually it is a bad idea to store
   410         # this extra stuff (as we would make the files we generate dependent on the actual
   410         # this extra stuff (as we would make the files we generate dependent on the actual
   411         # version of the wx library we are using!!! Remember that ObjTables evetually
   411         # version of the wx library we are using!!! Remember that ObjTables evetually
   412         # derives/inherits from wx.grid.PyGridTableBase). Another reason not to store the whole
   412         # derives/inherits from wx.grid.GridTableBase). Another reason not to store the whole
   413         # object is because it is not pickable (i.e. pickle.dump() cannot handle it)!!
   413         # object is because it is not pickable (i.e. pickle.dump() cannot handle it)!!
   414         try:
   414         try:
   415             fd = open(filepath,   "w")
   415             fd = open(filepath,   "w")
   416             pickle.dump(self.ObjTablesData, fd)
   416             pickle.dump(self.ObjTablesData, fd)
   417             fd.close()
   417             fd.close()