- Posts: 1433
When shall a model config be saved?
- rbe2012
- Topic Author
- Offline
- So much to do, so little time...
Less
More
16 Nov 2013 19:38 #15627
by rbe2012
When shall a model config be saved? was created by rbe2012
I have seen that in the actual code (including beta-11) two lists do not show correct values.
First case is the "Load model" list. A new (unconfigured) model does not have a name set in the modelXX.ini - the entry simply does not exist. The code sets the name to "NONE" when loading such a model and in a second step it is changed to "ModelXX" which is displayed as name - but it is not saved. When you want to load a new model in the list the actual model name still shows "NONE" and not the "ModelXX" (RBE #50).
The second case is: when you change the icon of a model and try to load another model (same list as above) the icon is shown correctly until you select another line in the list and the original line. You will see the old icon, not the new one (RBE #51).
I have changed this behavior in recent commits but I am unsure if the way is correct.
I have used the "feature" of a not saved model config to change the config and save it with "Copy to" to another model config slot. This was nice because when I do some tests I could save them with a new name without changing the original config - and I can decide to do that when I did some changes, not only before I start.
When doing some research how the above issues could be solved alternatively I have seen that since a long time when you change a model's name the config is saved immediately. This is what I have implemented to solve the above issues.
But I also have another solution (in my save_model-branch) where the lists / icons are displayed correctly without saving the model - the values from memory are shown instead those read from the model config file.
Question:
Which way is better?
(1) Save the model immediately (and often) when certain changes are done?
(2) Save the model only when the tx is shut down or a new model is selected?
(2) will give the above described possibility to decide later if the config shall be copied to a new model config or written back to the actual one. (1) might reduce the chance of loosing configuration steps (but only if the tx resets or shuts off unexpected).
I can live with both but prefer (2) (as you might have read between the lines...). I only think we should handle it the same way all over the code.
First case is the "Load model" list. A new (unconfigured) model does not have a name set in the modelXX.ini - the entry simply does not exist. The code sets the name to "NONE" when loading such a model and in a second step it is changed to "ModelXX" which is displayed as name - but it is not saved. When you want to load a new model in the list the actual model name still shows "NONE" and not the "ModelXX" (RBE #50).
The second case is: when you change the icon of a model and try to load another model (same list as above) the icon is shown correctly until you select another line in the list and the original line. You will see the old icon, not the new one (RBE #51).
I have changed this behavior in recent commits but I am unsure if the way is correct.
I have used the "feature" of a not saved model config to change the config and save it with "Copy to" to another model config slot. This was nice because when I do some tests I could save them with a new name without changing the original config - and I can decide to do that when I did some changes, not only before I start.
When doing some research how the above issues could be solved alternatively I have seen that since a long time when you change a model's name the config is saved immediately. This is what I have implemented to solve the above issues.
But I also have another solution (in my save_model-branch) where the lists / icons are displayed correctly without saving the model - the values from memory are shown instead those read from the model config file.
Question:
Which way is better?
(1) Save the model immediately (and often) when certain changes are done?
(2) Save the model only when the tx is shut down or a new model is selected?
(2) will give the above described possibility to decide later if the config shall be copied to a new model config or written back to the actual one. (1) might reduce the chance of loosing configuration steps (but only if the tx resets or shuts off unexpected).
I can live with both but prefer (2) (as you might have read between the lines...). I only think we should handle it the same way all over the code.
Please Log in or Create an account to join the conversation.
- FDR
- Offline
16 Nov 2013 20:31 #15629
by FDR
Replied by FDR on topic When shall a model config be saved?
I think the point is to be consistent.
Those two cases are indeed bugs, but the solution is not necessarily saving the config all the time.
The original working was intended in way (2).
The only drawback it has is when the tx reboots by itself, the model changes will be lost...
Those two cases are indeed bugs, but the solution is not necessarily saving the config all the time.
The original working was intended in way (2).
The only drawback it has is when the tx reboots by itself, the model changes will be lost...
Please Log in or Create an account to join the conversation.
- rbe2012
- Topic Author
- Offline
- So much to do, so little time...
Less
More
- Posts: 1433
17 Nov 2013 08:52 #15641
by rbe2012
Replied by rbe2012 on topic When shall a model config be saved?
But this will be the case if we don't save the config every time something has changed what is overdone in my eyes.
And we don't want sudden reboots
And we don't want sudden reboots
Please Log in or Create an account to join the conversation.
- FDR
- Offline
17 Nov 2013 09:55 #15646
by FDR
Replied by FDR on topic When shall a model config be saved?
I agree.
...and even saving the config all the time won't save your model on a reboot, since it will probably use different channels after the reboot (depending on the protocol), so the link will remain lost...
...and even saving the config all the time won't save your model on a reboot, since it will probably use different channels after the reboot (depending on the protocol), so the link will remain lost...
Please Log in or Create an account to join the conversation.
- rbe2012
- Topic Author
- Offline
- So much to do, so little time...
Less
More
- Posts: 1433
24 Nov 2013 11:59 - 24 Nov 2013 11:59 #15769
by rbe2012
Replied by rbe2012 on topic When shall a model config be saved?
Since there are not much opinions about that I implemented (2) (included after merge with save_model branch in
commit 5b3c89e
).
I lost my old work somehow and had to redo it...
I lost my old work somehow and had to redo it...
Last edit: 24 Nov 2013 11:59 by rbe2012.
Please Log in or Create an account to join the conversation.
Time to create page: 0.068 seconds
- Home
- Forum
- General
- General Discussions
- When shall a model config be saved?