From 2571bca1a3f8588b4076368bd48d5cdf42dc841f Mon Sep 17 00:00:00 2001 From: jacques franc Date: Wed, 12 Nov 2025 16:02:41 +0100 Subject: [PATCH 1/4] css --- geos-trame/src/geos/trame/app/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geos-trame/src/geos/trame/app/core.py b/geos-trame/src/geos/trame/app/core.py index 1f66b96ab..fff5a29b7 100644 --- a/geos-trame/src/geos/trame/app/core.py +++ b/geos-trame/src/geos/trame/app/core.py @@ -121,7 +121,7 @@ def deck_ui( self ) -> None: self.deckEditor = DeckEditor( source=self.tree, classes="ma-2", - style="flex: 1; height: 100%;", + style="flex: 1; height: 100vh;", ) with vuetify.VCol( From fd2016e98f117d9e5736338301e9dac71bb0bd34 Mon Sep 17 00:00:00 2001 From: jacques franc Date: Wed, 12 Nov 2025 18:02:33 +0100 Subject: [PATCH 2/4] try proxy --- geos-trame/src/geos/trame/app/ui/timeline.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/geos-trame/src/geos/trame/app/ui/timeline.py b/geos-trame/src/geos/trame/app/ui/timeline.py index bca6dd38c..fb104b8e5 100644 --- a/geos-trame/src/geos/trame/app/ui/timeline.py +++ b/geos-trame/src/geos/trame/app/ui/timeline.py @@ -74,16 +74,26 @@ def _updated_tasks(self, *tasks: Any, **_: Any) -> None: if not self.tree._search(f'Problem/Events/0/PeriodicEvent/{t["id"]}'): self.tree.input_file.pb_dict['Problem']['Events'][0]['PeriodicEvent'].append( self.tree.encode_data(PeriodicEvent(name="test")) ) + #TODO test if tasks/events added + proxy = self.simput_manager.proxymanager.get(f'Problem/Events/0/PeriodicEvent/{t["id"]}') self.tree.update(f'Problem/Events/0/PeriodicEvent/{t["id"]}','beginTime', event['begin_time']) + proxy.set_property("begin_time",event['begin_time']) self.tree.update(f'Problem/Events/0/PeriodicEvent/{t["id"]}','endTime', event['end_time']) + proxy.set_property("end_time",event['end_time']) self.tree.update(f'Problem/Events/0/PeriodicEvent/{t["id"]}','name', event['name']) + proxy.set_property("name",event['name']) self.tree.update(f'Problem/Events/0/PeriodicEvent/{t["id"]}','target', self.tree.registered_targets[event['category']]) + proxy.set_property("target", self.tree.registered_targets[event['category']] ) if "freq" in t and t["freq"] is not None: self.tree.update(f'Problem/Events/0/PeriodicEvent/{t["id"]}','timeFrequency', timedelta(days=int(t["freq"])).total_seconds()) + proxy.set_property("time_frequency", timedelta(days=int(t["freq"])).total_seconds()) + + proxy.commit() + - rm_list.extend( range(len(self.state.tasks),len(self.tree.input_file.problem.events[0].periodic_event)) ) #remove lost indexes + rm_list.extend( range(len(self.state.tasks),len(self.tree.input_file.problem.events[0].periodic_event)) ) for i in rm_list: self.tree.drop(f'Problem/Events/0/PeriodicEvent/{i}') From 3cbc0942e05d8b5cf0b13daad2b29472df4bd857 Mon Sep 17 00:00:00 2001 From: jacques franc Date: Fri, 14 Nov 2025 15:32:05 +0100 Subject: [PATCH 3/4] concile all --- geos-trame/src/geos/trame/app/deck/tree.py | 2 +- geos-trame/src/geos/trame/app/ui/editor.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/geos-trame/src/geos/trame/app/deck/tree.py b/geos-trame/src/geos/trame/app/deck/tree.py index c27918b5e..132e617be 100644 --- a/geos-trame/src/geos/trame/app/deck/tree.py +++ b/geos-trame/src/geos/trame/app/deck/tree.py @@ -139,7 +139,7 @@ def to_xml( obj: BaseModel ) -> str: attribute_name_generator=text.camel_case, ) - config = SerializerConfig( indent=" ", xml_declaration=False ) + config = SerializerConfig( indent=" ", xml_declaration=False, ignore_default_attributes=True ) serializer = XmlSerializer( context=context, config=config ) return format_xml( serializer.render( obj ) ) diff --git a/geos-trame/src/geos/trame/app/ui/editor.py b/geos-trame/src/geos/trame/app/ui/editor.py index dc5b4f5b2..14b8a51d1 100644 --- a/geos-trame/src/geos/trame/app/ui/editor.py +++ b/geos-trame/src/geos/trame/app/ui/editor.py @@ -81,12 +81,21 @@ def _on_active_id( self, active_id: str | None, **_: Any ) -> None: self.state.active_type = None self.state.active_types = [] return + + # read from the tree active_block = self.tree.decode( active_id ) simput_type = type( active_block ).__name__ - self.simput_manager.proxymanager.get_instances_of_type( simput_type ) + #TODO (Q1) why the return is not used ?? + # sim_item = self.simput_manager.proxymanager.get_instances_of_type( simput_type ) + #update proxy with decoded data + proxy = self.simput_manager.proxymanager.get(active_id) + if not proxy: + return + for k,v in dict(active_block).items(): + proxy.set_property(k,v) self.state.active_id = active_id self.state.active_ids = [ active_id ] From fab84afc651cf1de56324c44d7f53cd239bee527 Mon Sep 17 00:00:00 2001 From: jacques franc Date: Fri, 14 Nov 2025 16:13:38 +0100 Subject: [PATCH 4/4] better ? --- geos-trame/src/geos/trame/app/ui/editor.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/geos-trame/src/geos/trame/app/ui/editor.py b/geos-trame/src/geos/trame/app/ui/editor.py index 14b8a51d1..62b06302d 100644 --- a/geos-trame/src/geos/trame/app/ui/editor.py +++ b/geos-trame/src/geos/trame/app/ui/editor.py @@ -91,11 +91,14 @@ def _on_active_id( self, active_id: str | None, **_: Any ) -> None: #TODO (Q1) why the return is not used ?? # sim_item = self.simput_manager.proxymanager.get_instances_of_type( simput_type ) #update proxy with decoded data - proxy = self.simput_manager.proxymanager.get(active_id) - if not proxy: - return - for k,v in dict(active_block).items(): - proxy.set_property(k,v) + + self.simput_manager.proxymanager.commit_all() + # proxy = self.simput_manager.proxymanager.get(active_id) + # if not proxy: + # return + # for k,v in dict(active_block).items(): + # proxy.set_property(k,v) + # proxy.commit() self.state.active_id = active_id self.state.active_ids = [ active_id ]