@@ -29,62 +29,47 @@ def __init__(self, titrator):
2929 self ._amplitude = 0.0
3030 self ._period_in_seconds = 0
3131
32- def get_heat (self , default ):
33- """
34- Get the heat setting from EEPROM
35- """
36- if self ._heat is None :
37- return default
38- return self ._heat
39-
40- def set_heat (self , value ):
32+ def get_amplitude (self ):
4133 """
42- Set the heat setting in EEPROM
34+ Get the amplitude for the pH function.
4335 """
44- self ._heat = value
36+ return self ._amplitude
4537
4638 def get_base_thermal_target (self ):
4739 """
4840 Get the base thermal target
4941 """
5042 return self ._base_thermal_target
5143
52- def set_base_thermal_target (self , value ):
53- """
54- Set the base thermal target
55- """
56- self ._base_thermal_target = value
57-
5844 def get_current_thermal_target (self ):
5945 """
6046 Get the current thermal target
6147 """
6248 return self ._current_thermal_target
6349
64- def set_current_thermal_target (self , value ):
50+ def get_heat (self , default ):
6551 """
66- Set the current thermal target
52+ Get the heat setting from EEPROM
6753 """
68- self ._current_thermal_target = value
54+ if self ._heat is None :
55+ return default
56+ return self ._heat
6957
70- def get_thermal_function_type (self ):
58+ def get_period_in_seconds (self ):
7159 """
72- Get the current thermal function type .
60+ Get the period in seconds for the pH function .
7361 """
74- return self ._thermal_function_type
62+ return self ._period_in_seconds
7563
76- def set_thermal_function_type (self , function_type ):
64+ def get_ramp_time_end (self ):
7765 """
78- Set the current thermal function type .
66+ Get the ramp time end in seconds .
7967 """
80- if function_type in (
81- ThermalControl .FLAT_TYPE ,
82- ThermalControl .RAMP_TYPE ,
83- ThermalControl .SINE_TYPE ,
84- ):
85- self ._thermal_function_type = function_type
86- else :
87- raise ValueError ("Invalid thermal function type" )
68+ return (
69+ self ._ramp_time_end_seconds
70+ if self ._thermal_function_type != ThermalControl .FLAT_TYPE
71+ else 0
72+ )
8873
8974 def get_ramp_time_start (self ):
9075 """
@@ -96,15 +81,35 @@ def get_ramp_time_start(self):
9681 else 0
9782 )
9883
99- def get_ramp_time_end (self ):
84+ def get_thermal_function_type (self ):
10085 """
101- Get the ramp time end in seconds .
86+ Get the current thermal function type .
10287 """
103- return (
104- self ._ramp_time_end_seconds
105- if self ._thermal_function_type != ThermalControl .FLAT_TYPE
106- else 0
107- )
88+ return self ._thermal_function_type
89+
90+ def set_amplitude (self , amplitude ):
91+ """
92+ Set the amplitude for the pH function.
93+ """
94+ self ._amplitude = amplitude
95+
96+ def set_base_thermal_target (self , value ):
97+ """
98+ Set the base thermal target
99+ """
100+ self ._base_thermal_target = value
101+
102+ def set_current_thermal_target (self , value ):
103+ """
104+ Set the current thermal target
105+ """
106+ self ._current_thermal_target = value
107+
108+ def set_heat (self , value ):
109+ """
110+ Set the heat setting in EEPROM
111+ """
112+ self ._heat = value
108113
109114 def set_ramp_duration_hours (self , new_ph_ramp_duration ):
110115 """
@@ -133,24 +138,6 @@ def set_ramp_duration_hours(self, new_ph_ramp_duration):
133138 self ._thermal_function_type = ThermalControl .FLAT_TYPE
134139 print ("Set ramp time to 0" )
135140
136- def get_amplitude (self ):
137- """
138- Get the amplitude for the pH function.
139- """
140- return self ._amplitude
141-
142- def set_amplitude (self , amplitude ):
143- """
144- Set the amplitude for the pH function.
145- """
146- self ._amplitude = amplitude
147-
148- def get_period_in_seconds (self ):
149- """
150- Get the period in seconds for the pH function.
151- """
152- return self ._period_in_seconds
153-
154141 def set_sine_amplitude_and_hours (self , amplitude , period_in_hours ):
155142 """
156143 Set the amplitude and period (in hours) for the sine wave pH function.
@@ -161,3 +148,16 @@ def set_sine_amplitude_and_hours(self, amplitude, period_in_hours):
161148 self ._thermal_function_type = ThermalControl .SINE_TYPE
162149 else :
163150 raise ValueError ("Amp and period !> than 0." )
151+
152+ def set_thermal_function_type (self , function_type ):
153+ """
154+ Set the current thermal function type.
155+ """
156+ if function_type in (
157+ ThermalControl .FLAT_TYPE ,
158+ ThermalControl .RAMP_TYPE ,
159+ ThermalControl .SINE_TYPE ,
160+ ):
161+ self ._thermal_function_type = function_type
162+ else :
163+ raise ValueError ("Invalid thermal function type" )
0 commit comments