Skip to content

Commit

Permalink
Fixing bug from #46 where classes were not saved
Browse files Browse the repository at this point in the history
  • Loading branch information
jordancaraballo committed Oct 22, 2024
1 parent a2ffeb2 commit 1f91a4f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion eo_validation/validation_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,12 +756,21 @@ def create_property_widgets(self, properties):

def changed_checked_widget(b):

# compute seconds per point taken
self._seconds_per_point = round(
time.time() - self._current_time, 4)

# update date of validated point
self._feature['properties']['date'] = str(pd.Timestamp.now())

# update seconds per point taken
self._feature['properties']['seconds_taken'] = \
self._seconds_per_point
self._feature['properties']['verified'] = True

# Update the properties with the new values
for widget in self.property_widgets:
self._feature['properties'][widget._property_key] = \
widget.value

# updating the information with new data
self.geo_data_layer.geo_dataframe.loc[
Expand Down Expand Up @@ -798,6 +807,7 @@ def on_click_polygon_object(self, event, feature, **kwargs):
# Dynamically create input widgets for each property
self.property_widgets = self.create_property_widgets(
self._feature['properties'])

save_button = widgets.Button(description="Save")
geom_type = self._feature['geometry']['type']
centroid = self.calculate_centroid(
Expand Down Expand Up @@ -829,6 +839,7 @@ def save_changes(_):

original_data = copy.deepcopy(self.geo_data_layer.data)
original_feature = copy.deepcopy(self._feature)

# Update the properties with the new values
for widget in self.property_widgets:
self._feature['properties'][widget._property_key] = \
Expand Down

0 comments on commit 1f91a4f

Please sign in to comment.