Problem
When a .omsim project file is opened and re-saved (including "Save As"), the following issues occur:
- XML comments are lost: Comments within
AddressDescriptionMap are partially or fully discarded.
- Timestamps change every save:
AddressTimestampMap is rewritten with millisecond precision on every save, even when data hasn't changed.
- Runtime values are saved: Register values modified by simulation scripts are written to the file, causing different content each time.
- View settings are mixed in: Column widths and window positions are saved alongside project data.
These issues make it difficult to manage .omsim files with version control (git), as every save produces unnecessary diffs that obscure meaningful changes.
Why this matters
XML comments in .omsim files are useful for documenting register mappings, grouping registers by device/function, and providing context for each address range. This is especially important when project files are generated or managed by AI tools — the AI typically includes explanatory comments and section headers alongside the register definitions. However, once the file is opened and re-saved in OpenModSim, these comments are lost.
Additionally, when .omsim files are tracked with git, every save produces noise from timestamps, runtime values, and view settings, making it hard to review actual project changes.
Expected behavior
- XML comments preserved: All XML comments within
AddressDescriptionMap (and ideally other sections) should be retained when loading and saving .omsim project files, including section header comments like <!-- ===== Device 1: AnalogIO ===== -->.
- Timestamps stable: Consider making timestamps optional or excluding them from save by default.
- Runtime values separated: Consider separating "initial values" from "runtime values", or providing an option to save only the project configuration without runtime state.
- View settings separated: Consider storing view settings (column widths, window positions) in a separate file (e.g.,
.omsim.user) so that project data remains stable.
Example
Before saving in OpenModSim:
<AddressDescriptionMap>
<!-- ===== Device 1: AnalogIO ===== -->
<!-- Analog Input (Input Registers, Type=3) -->
<Description DeviceId="1" Type="3" Address="0"><![CDATA[Temperature Setpoint]]></Description>
<!-- Analog Output (Holding Registers, Type=4) -->
<Description DeviceId="1" Type="4" Address="256"><![CDATA[Pump Control]]></Description>
</AddressDescriptionMap>
Problem
When a
.omsimproject file is opened and re-saved (including "Save As"), the following issues occur:AddressDescriptionMapare partially or fully discarded.AddressTimestampMapis rewritten with millisecond precision on every save, even when data hasn't changed.These issues make it difficult to manage
.omsimfiles with version control (git), as every save produces unnecessary diffs that obscure meaningful changes.Why this matters
XML comments in
.omsimfiles are useful for documenting register mappings, grouping registers by device/function, and providing context for each address range. This is especially important when project files are generated or managed by AI tools — the AI typically includes explanatory comments and section headers alongside the register definitions. However, once the file is opened and re-saved in OpenModSim, these comments are lost.Additionally, when
.omsimfiles are tracked with git, every save produces noise from timestamps, runtime values, and view settings, making it hard to review actual project changes.Expected behavior
AddressDescriptionMap(and ideally other sections) should be retained when loading and saving.omsimproject files, including section header comments like<!-- ===== Device 1: AnalogIO ===== -->..omsim.user) so that project data remains stable.Example
Before saving in OpenModSim: