Skip to content

Commit ba4cfd5

Browse files
author
Francisco Arrieta
committed
creating variable
1 parent 190433e commit ba4cfd5

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

odmtools/controller/WizardVariableController.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,18 @@ def get_variable(self):
9393

9494
elif self.variable_view.create_variable_radio.GetValue():
9595
# v = self.createdVar
96-
pass
96+
v = self.get_new_variable()
97+
98+
return v
99+
100+
def get_new_variable(self):
101+
v = Variable()
102+
v.code = self.variable_view.variable_code_text_ctrl.GetValue() if self.variable_view.variable_code_text_ctrl.GetValue() <> "" else None
103+
v.name = self.variable_view.variable_name_combo.GetValue() if self.variable_view.variable_name_combo.GetValue() <> "" else None
104+
v.speciation = self.variable_view.speciation_combo.GetValue() if self.variable_view.speciation_combo.GetValue() <> "" else None
105+
v.variable_unit = self.service_manager.get_series_service()
106+
v.no_data_value = self.variable_view.no_data_value_text_ctrl.GetValue() if self.variable_view.no_data_value_text_ctrl.GetValue() <> "" else None
107+
# Need unit name, time support but neither of them are in the form...
97108

98109
return v
99110

0 commit comments

Comments
 (0)