Task #474

Task #465: load models and their channels into memory and work on these objects

FrSkyServer.deleteModel needs to change currentModel if deleting currentmodel

Added by Espen Solbu about 5 years ago. Updated about 5 years ago.

Status:ClosedStart date:06/12/2012
Priority:NormalDue date:
Assignee:Android Dashboard Developers% Done:

100%

Category:-Spent time:-
Target version:2.0 Multiple models

Description

Best would be for deleteModel to call setCurrentModel(modelMap.firstKey()) but
setCurrentModel is now not static
Figure out how to solve this. (e.g. make setCurrentModel static..)

Associated revisions

Revision 438
Added by Espen Solbu about 5 years ago

refs #474 hack to solve deletion of currentModel (in getCurrentModel), refs #464 Delete model dialog now handled by activity

Revision 457
Added by Hans Cappelle about 5 years ago

closes #474 making setCurrentModel(Model model):void static
refs #465 using the model Id as reference to models in map where possible (still ongoing, some methods still accept objects that could be updated elsewhere)
added single method for checking if current model is valid (=consistency)
removed use of Model1 == Model2 which is not guaranteed to work, implemented equals on Model instead (comparing IDs)

History

#1 Updated by Espen Solbu about 5 years ago

  • Assignee set to Android Dashboard Developers

#2 Updated by Hans Cappelle about 5 years ago

Espen Solbu wrote:

Best would be for deleteModel to call setCurrentModel(modelMap.firstKey()) but
setCurrentModel is now not static
Figure out how to solve this. (e.g. make setCurrentModel static..)

I agree deleteModel should check if this is current model or not and if so the current model can be update to first model in map.

No problem to make setCurrentModel static for me. There is only one server anyone (or should be at least). If you don't like static you can use singleton pattern. Then you would call it like this: FrSkyServer.getInstance().setCurrentModel(int key):Model

#3 Updated by Espen Solbu about 5 years ago

I think static would be best for server. I hit some challenges in my initial attempt to convert it though, was a while back so cant remember what it was.

#4 Updated by Hans Cappelle about 5 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Applied in changeset r457.

Also available in: Atom PDF