In this project - there is a Dictionary which is used as the main data structure and records details about custom hardware connected to the serial port.
The serial port is used to interrogate the hardware, and when a device responds with it's serial number and addresss, it is added to the Dictionary.
Devices respond when interrogated ( either individually or in groups ).
The devices each have a unique serial number - duplicate serial numbers are not permitted.
The Dictionary is filled by polling for devices and may take several seconds or even minutes to complete depending on the scale of the connected device hardware.
The dictionary only contains basic information about the connected devices. Once a device has been added to the dictionary, a device object is created that can then be used to represent the real device and additional device properties are set by subsequent serial port requests.
Two important properties assigned to the devices are the AREA and ZONE values that determine how the devices function as part of the system.
These properties are stored in the actual physical device and retrieved as a numeric value when requested.
The most recent project created datagridviews which allowed the user to assign names to these properties. These names are held only on the PC running the application and NOT in the physical device.
Stage 1 is to Save and restore the Dictionary to disk, alongside the Area / Zone Name tables.
It should be possible to save and load this data as a single ( XML?) file. ( ZONE/AREA naming) + (DEVICEDICTIONARY).
At some point other data may need to be stored in this file.
File structure open for suggestions.
Optional if not difficult: It should be possible to save / restore the data types separately if needed - (eg. ZONE/AREA naming as a separate file ).
Attached is the Dictionary Code for examination.