comparison src/gaslist.asm @ 534:a7ac5d3fd046

Setpoint Change Depth Fix
author heinrichsweikamp
date Mon, 21 Aug 2017 15:11:06 +0200
parents 72ae62440597
children 9a17b1db095b
comparison
equal deleted inserted replaced
533:dfac393b2199 534:a7ac5d3fd046
151 PUTC " " 151 PUTC " "
152 ; Read switch depth 152 ; Read switch depth
153 movf gaslist_gas,W 153 movf gaslist_gas,W
154 lfsr FSR1,char_I_setpoint_change 154 lfsr FSR1,char_I_setpoint_change
155 movff PLUSW1,lo 155 movff PLUSW1,lo
156 bra gaslist_strcat_5 ; And return... 156
157 bsf ccr_diluent_setup ; inhibit output of "----" for depth
158 call gaslist_strcat_5
159 bcf ccr_diluent_setup
160 return
157 161
158 ;---------------------------------------------------------------------------- 162 ;----------------------------------------------------------------------------
159 ; Append gas description to current string. 163 ; Append gas description to current string.
160 ; Input: PRODL : gas number (0..4) 164 ; Input: PRODL : gas number (0..4)
161 ; FSR2 : Current string position. 165 ; FSR2 : Current string position.
209 213
210 movf gaslist_gas,W ; (0-4 for OC/Bailout, 5-9 for Diluents) 214 movf gaslist_gas,W ; (0-4 for OC/Bailout, 5-9 for Diluents)
211 movf PLUSW1,W 215 movf PLUSW1,W
212 bnz gaslist_strcat_3 216 bnz gaslist_strcat_3
213 call TFT_disabled_color 217 call TFT_disabled_color
214 bra gaslist_strcat_4 ; NEW ; No MOD-check and red color for disabled gases 218 ;bra gaslist_strcat_3 ; NEW ; No MOD-check and red color for disabled gases
215 gaslist_strcat_3: 219 gaslist_strcat_3:
216 rcall gaslist_strcat_gas_0 220 rcall gaslist_strcat_gas_0
217 PUTC " " 221 PUTC " "
218 ; Read switch depth 222 ; Read switch depth
219 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents-5 223 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents-5
224 movf gaslist_gas,W ; (0-4 for OC/Bailout, 5-9 for Diluents) 228 movf gaslist_gas,W ; (0-4 for OC/Bailout, 5-9 for Diluents)
225 movff PLUSW1,lo 229 movff PLUSW1,lo
226 rcall gaslist_calc_mod ; Compute MOD into WREG 230 rcall gaslist_calc_mod ; Compute MOD into WREG
227 cpfsgt lo 231 cpfsgt lo
228 bra gaslist_strcat_5 232 bra gaslist_strcat_5
229 call TFT_warnings_color ; Turn red if bigger
230 bra gaslist_strcat_5 ; skip gaslist_strcat_gas_0 here
231 gaslist_strcat_4:
232 rcall gaslist_strcat_gas_0
233 PUTC " "
234 233
235 ; Dummy code, needs some cleanup somedays... 234 movf gaslist_gas,W ; load gas index
236 ; Read switch depth 235 lfsr FSR1,opt_gas_type ; set-up index read from gas table
237 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents-5 236 movff PLUSW1,gaslist_Type ; get current gas type into lo
238 movlw .4 237 movlw .3 ; compare current gas type with 3 = deco
239 cpfsgt gaslist_gas ; >4? (-> Diluents) 238 cpfseq gaslist_Type ; skip next line if gas is of type deco
240 lfsr FSR1,opt_OC_bail_gas_change ; Setup OC Gases 239 bra gaslist_strcat_5 ; gas is not deco gas
241 240
242 movf gaslist_gas,W ; (0-4 for OC/Bailout, 5-9 for Diluents) 241 call TFT_warnings_color ; Turn red if bigger and gas is a deco gas
243 movff PLUSW1,lo 242 ;bra gaslist_strcat_5 ; skip gaslist_strcat_gas_0 here
244 ;rcall gaslist_calc_mod ; Compute MOD into WREG
245 243
246 gaslist_strcat_5: 244 gaslist_strcat_5:
247 TSTOSS opt_units ; 0=Meters, 1=Feets 245 TSTOSS opt_units ; 0=Meters, 1=Feets
248 bra gaslist_strcat_3_metric 246 bra gaslist_strcat_3_metric
249 ;gaslist_strcat_3_imperial: 247 ;gaslist_strcat_3_imperial:
250 btfsc ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10") 248 btfsc ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10")
251 bra gaslist_imperial_non_travel 249 bra gaslist_imperial_decogas
252 movf gaslist_gas,W 250 movf gaslist_gas,W
253 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG] 251 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG]
254 movff PLUSW1,gaslist_Type 252 movff PLUSW1,gaslist_Type
255 movlw .2 ; 2=Travel 253 movlw .3 ; 0= Diabled, 1 = First, 2=Travel/Normal, 3 = Deco
256 cpfseq gaslist_Type 254 cpfslt gaslist_Type ; skip next line for disabled, first and travel gases
257 bra gaslist_imperial_non_travel ; Non-Travel Gas 255 bra gaslist_imperial_decogas ; Deco gas ? show meters
258 bra gaslist_strcat_depth_travel ; Show "---" instead of "0m"... 256 bra gaslist_strcat_depth_nondeco ; Show "---" instead of "0m"...
259 257
260 gaslist_imperial_non_travel: 258 gaslist_imperial_decogas:
261 movf lo,W 259 movf lo,W
262 mullw .100 ; convert meters to mbar 260 mullw .100 ; convert meters to mbar
263 movff PRODL,lo 261 movff PRODL,lo
264 movff PRODH,hi 262 movff PRODH,hi
265 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet 263 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
268 STRCAT_TEXT tFeets ; "ft" 266 STRCAT_TEXT tFeets ; "ft"
269 return 267 return
270 268
271 gaslist_strcat_3_metric: 269 gaslist_strcat_3_metric:
272 btfsc ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10") 270 btfsc ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10")
273 bra gaslist_metric_non_travel 271 bra gaslist_metric_decogas
274 movf gaslist_gas,W 272 movf gaslist_gas,W
275 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG] 273 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG]
276 movff PLUSW1,gaslist_Type 274 movff PLUSW1,gaslist_Type
277 movlw .2 ; 2=Travel 275 movlw .3 ; 0= Diabled, 1 = First, 2=Travel/Normal, 3 = Deco
278 cpfseq gaslist_Type 276 cpfslt gaslist_Type ; skip next line for disabled, first and travel gases
279 bra gaslist_metric_non_travel ; Non-Travel Gas 277 bra gaslist_metric_decogas ; Deco gas ? show meters
280 gaslist_strcat_depth_travel: ; Show "---" instead of "0m"... 278 gaslist_strcat_depth_nondeco: ; Show "---" instead of "0m"...
281 STRCAT "---" 279 STRCAT "---"
282 return 280 return
283 gaslist_metric_non_travel: 281 gaslist_metric_decogas:
284 output_99 282 output_99
285 STRCAT_TEXT tMeters ; "m" 283 STRCAT_TEXT tMeters ; "m"
286 return 284 return
287 285
288 ;---------------------------------------------------------------------------- 286 ;----------------------------------------------------------------------------