APSIMInitiative / APSIM710

APSIM
https://www.apsim.info
30 stars 47 forks source link

ApsimX overwrites output db when running individual simulaitons #1254

Closed ApsimBot closed 5 years ago

ApsimBot commented 5 years ago

Legacy Bug ID: 1819 Author: Justin Date: 2014-01-17 15:18:44 +0000 UTC

If you have two sims in an apsimx and run one the output appears as normal in the .db. If you then run the second one, it's output overwrites the first one. The same thing happens even if you change the reporting node name. You get the different table name but the first run is no longer there. It looks like apsimx is overwriting the database instead of apending to it.

ApsimBot commented 5 years ago

Author: fai04d Date: 2014-01-17 15:21:00 +0000 UTC

It is overwriting:

       [EventSubscribe("AllCommencing")]        private void OnAllCommencing(object sender, EventArgs e)        {            SimulationIDs.Clear();

           if (Connection != null)                Disconnect();            string Filename = System.IO.Path.ChangeExtension(Simulations.FileName, ".db");            if (File.Exists(Filename))                File.Delete(Filename);

           Connect();        }

We'll need to change this; there's no need to delete the entire database, we can just delete the output of the simulation being run (safer than overwriting). We'll also need to check for removed sims and delete the output for those.

ApsimBot commented 5 years ago

Author: fai04d Date: 2014-02-14 09:57:00 +0000 UTC

Issue has been resolved.