=================================================================== Subject: Automated migration of old Periodic Slots to new Series Slots w/Periodic Input. Date: Fri, 17 Aug 2012 18:01 From: Phil Weinstein =================================================================== I was able to develop and test automated migration of model files containing Periodic Slots to RiverWare revisions defining such slots instead as Series Slots with Periodic Input. This is checked in to the "SerSlotPerInput" branch (on Alamosa). This will be relevant when we change existing Periodic Slots to Series Slots with Periodic Input. This may apply to slots which had originally been Series Slots, but which have since been changed to Periodic Slots. That is, I understand that we may want to change some of those BACK TO Series Slots. This involves Engineering Library changes, i.e. code which accesses these slots. - Phil ------------------------------------------------------------------------- Automated migration of old Periodic Slots to new Series Slots w/Periodic Input. Bug Number: n/a Release notes (y/n): n For Release Nums: 6.3 When loading a physical Periodic Slot from a model file to a slot which has since been changed to a Series Slot, the following actions occur: (1) [If necessary -- though not expected to occur]: The Series Slot is "promoted" to a "Series Slot with Periodic Input". NOTE: The reason this is not expected to occur is that this whole scenario will result specifically from our recoding of existing Periodic Slots AS "Series Slots with Periodic Input". So, the Series Slot should already be "with Periodic Input". (2) The Slot is put into "Periodic Input" mode. (3) A diagnostic warning is generated. An example of the currently implemented message text: Promoting Series Slot "Reach1.Inflow" to a "Series Slot with Periodic Input" for periodic slot data migration. (4) The Series Slot's time range is set to the run period. (5) The Periodic Slot from the model file is loaded into the child "Periodic Input" Periodic Slot. (6) The Series Slot's series values are recomputed from the Periodic Input. (This is done as a deferred "Done Loading" command). Note that this migration will be performed only on Series Slots. It will NOT effect Series Slot subclasses, e.g. AggSeriesSlots or MultiSlots. THIS WAS TESTED by editing a tiny model file, replacing a serialized Series Slot (Inflow on a Reach) with a Periodic Slot serialization. (This isn't intended to be a realistic example in terms of the chosen slot). The slot became a "Series Slot with Peridic Input", with all of the actions above correctly performed. See test images: http://cadswes2.colorado.edu/~philw/2012/SeriesSlotPeriodicInputs/ ... Migrate/test1.png Modified Files: Sim/SimObj.cpp Sim/SeriesSlot.hpp Sim/SeriesSlot.AltInp.cpp Sim/libSimMsgs.hpp Sim/libSimMsgs.cpp See primary processing in Tcl function (in SimObj.cpp): int simObjCmd (ClientData, Tcl_Interp*, int argc, char *argv[]) See deferred "done loading" processing (in SeriesSlot.AltInp.cpp): bool SeriesSlot::fillFromPeriodicInputCmd ( bool loadOk, DoneLoadingData*, QString& errorRet) New Sim-library Diagnostic Message symbols: MSG_SSLOT_PROMO_WPER MSG_SSLOT_PROMO_WPER_ERR ---