Skip to content

Commit 9b1c470

Browse files
author
Francisco Arrieta
committed
Small changes to the add point form
1 parent 84bb10e commit 9b1c470

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

odmtools/gui/wizSave.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,10 @@ def on_wizard_finished(self, event):
452452
result = self.record_service.saveAs(Variable, Method, QCL, True)
453453
'''
454454

455+
# Create action
456+
new_result = self.series_service.createResult(var=variable, meth=method, proc=proc_level)
457+
# action = self.series_service.create.createAction(action)
458+
455459
try:
456460
if rbSave:
457461
result = self.record_service.save()

odmtools/odmdata/memory_database.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -196,20 +196,16 @@ def addPoints(self, points):
196196
points = [points]
197197

198198
for point in points:
199-
vals = {"DataValue": point[0], "LocalDateTime": point[1],
200-
"DateTimeUTC": point[2], "UTCOffset": point[3],
201-
"CensorCode": point[4], "QualityCode": point[5],
202-
"TimeAggregationInterval": point[6], "TImeAggregationUnitID": point[7],
203-
"Annotation": point[8], "SiteID": point[9],
204-
"VariableID": point[10], "MethodID": point[11],
205-
"OrganizationID": point[12], "ProcessID": point[13]
199+
vals = {"datavalue": point[0], "valuedatetime": point[1],
200+
"valuedatetimeutcoffset": point[3],
201+
"censorcodecv": point[4], "qualitycodecv": point[5],
202+
"timeaggregationinterval": point[6], "timeaggregationintervalunitsid": point[7]
203+
# todo: Add annotations
206204
}
207205

208206
setSchema(self.mem_service._session_factory.engine)
209207
self.mem_service._session.execute(stmt, vals)
210208

211-
212-
213209
def stopEdit(self):
214210
self.editLoaded = False
215211
self.df = None

odmtools/odmservices/series_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ def createResult(self, var, meth, proc):
561561
#copy old
562562
#change var, meth proc, in df #intend ts, agg stat
563563
Result = None
564+
result = Results()
564565

565566
return self.updateResult(Result)
566567

0 commit comments

Comments
 (0)