diff --git a/_alp/Agents/Zero_Interface/Code/AdditionalClassCode.java b/_alp/Agents/Zero_Interface/Code/AdditionalClassCode.java index 514a2787..467d0a60 100644 --- a/_alp/Agents/Zero_Interface/Code/AdditionalClassCode.java +++ b/_alp/Agents/Zero_Interface/Code/AdditionalClassCode.java @@ -9,4 +9,4 @@ public ShapeCheckBox getCb_showFilterInterface(){ } public ShapeComboBox getCb_filterOptions(){ return this.cb_filterOptions; -} \ No newline at end of file +} diff --git a/_alp/Agents/Zero_Interface/Code/Functions.java b/_alp/Agents/Zero_Interface/Code/Functions.java index 13acb8af..66e5731c 100644 --- a/_alp/Agents/Zero_Interface/Code/Functions.java +++ b/_alp/Agents/Zero_Interface/Code/Functions.java @@ -2091,6 +2091,8 @@ else if(c_manualFilterDeselectedGC.contains(clickedGC)){ double f_setStartView() {/*ALCODESTART::1743518032245*/ +//traceln("f_setStartView() reached!"); + if(map_centre_latitude != null && map_centre_longitude != null && map_centre_latitude != 0 && map_centre_longitude != 0){ map.setCenterLatitude(map_centre_latitude); map.setCenterLongitude(map_centre_longitude); @@ -3128,7 +3130,7 @@ else if(maxLoad_fr_gc_feedin > maxLoad_fr_gc_delivery && gc.v_rapidRunData.conne String[] RadioButtonOptions = RadioButtonOptions_list.toArray(String[]::new); //Create the radiobutton and set the correct action. -rb_mapOverlay = new ShapeRadioButtonGroup(presentable, ispublic, x ,y, width, height, textColor, enabled, font, vertical, RadioButtonOptions){ +rb_mapOverlay = new ShapeRadioButtonGroup(group_legenda.getPresentable(), ispublic, x ,y, width, height, textColor, enabled, font, vertical, RadioButtonOptions){ @Override public void action() { f_setMapOverlay(); @@ -3288,3 +3290,55 @@ public void action() { } /*ALCODEEND*/} +double f_updateOrderedListsAfterDeserialising(EnergyModel newEnergyModel) +{/*ALCODESTART::1753713001191*/ +// Update references of GClists +for (int i=0; i< c_orderedPVSystemsHouses.size(); i++) { + String GCid = c_orderedPVSystemsHouses.get(i).p_gridConnectionID; + c_orderedPVSystemsHouses.set(i,findFirst(newEnergyModel.Houses, x->x.p_gridConnectionID == GCid)); +} + +for (int i=0; i< c_orderedPVSystemsCompanies.size(); i++) { + String GCid = c_orderedPVSystemsCompanies.get(i).p_gridConnectionID; + c_orderedPVSystemsCompanies.set(i,findFirst(newEnergyModel.UtilityConnections, x->x.p_gridConnectionID == GCid)); +} + +for (int i=0; i< c_orderedHeatingSystemsCompanies.size(); i++) { + String GCid = c_orderedHeatingSystemsCompanies.get(i).p_gridConnectionID; + c_orderedHeatingSystemsCompanies.set(i,findFirst(newEnergyModel.UtilityConnections, x->x.p_gridConnectionID == GCid)); +} + +for (int i=0; i< c_orderedHeatingSystemsHouses.size(); i++) { + String GCid = c_orderedHeatingSystemsHouses.get(i).p_gridConnectionID; + c_orderedHeatingSystemsHouses.set(i,findFirst(newEnergyModel.Houses, x->x.p_gridConnectionID == GCid)); +} + +for (int i=0; i< c_orderedPublicChargers.size(); i++) { + String GCid = c_orderedPublicChargers.get(i).p_gridConnectionID; + c_orderedPublicChargers.set(i,findFirst(newEnergyModel.PublicChargers, x->x.p_gridConnectionID == GCid)); +} + +// TODO: Update references of J_EAlists + +/*ALCODEEND*/} + +ArrayList f_updateGClistAfterDeserialisation(ArrayList GClist,EnergyModel newEnergyModel) +{/*ALCODESTART::1753713085487*/ +for (int i=0; i< GClist.size(); i++) { + String GCid = GClist.get(i).p_gridConnectionID; + GClist.set(i,findFirst(newEnergyModel.c_gridConnections, x->x.p_gridConnectionID == GCid)); +} + + +/*ALCODEEND*/} + +ArrayList f_updateJ_EAlistAfterDeserialisation(ArrayList EAlist,EnergyModel newEnergyModel) +{/*ALCODESTART::1753713662613*/ +for (int i=0; i< EAlist.size(); i++) { + String GCid = EAlist.get(i).getParentAgent();p_gridConnectionID; + EAlist.set(i,findFirst(newEnergyModel.c_gridConnections, x->x.p_gridConnectionID == GCid)); +} + + +/*ALCODEEND*/} + diff --git a/_alp/Agents/Zero_Interface/Code/Functions.xml b/_alp/Agents/Zero_Interface/Code/Functions.xml index 2cf472bb..9355b3db 100644 --- a/_alp/Agents/Zero_Interface/Code/Functions.xml +++ b/_alp/Agents/Zero_Interface/Code/Functions.xml @@ -277,7 +277,7 @@ 1714130288661 85 - -680 + -710