changeset 386:deced1cacff7 64kByte Logbook

Added velocity in divemode, BIG stopwatch in Gauge mode
author heinrichsweikamp
date Sat, 18 Jun 2011 20:17:39 +0200
parents af703be9ead2
children 106b95a33244
files code_part1/OSTC_code_asm_part1/customview.asm code_part1/OSTC_code_asm_part1/divemode.asm code_part1/OSTC_code_asm_part1/english_text.asm code_part1/OSTC_code_asm_part1/french_text.asm code_part1/OSTC_code_asm_part1/german_text.asm code_part1/OSTC_code_asm_part1/pled_outputs.asm code_part1/OSTC_code_asm_part1/spanish_text.asm
diffstat 7 files changed, 86 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/customview.asm	Sat Jun 18 17:52:52 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/customview.asm	Sat Jun 18 20:17:39 2011 +0200
@@ -85,9 +85,16 @@
 	goto	PLED_total_average_show2	; Update the figures only
 	
 customview_1sec_stopwatch:
+	btfsc	gauge_mode					; In Gauge mode?
+	bra		customview_1sec_stopwatch_gauge; Yes
+
 	bsf		menu3_active                ; Set Flag
 	goto	PLED_stopwatch_show2        ; Update figures only
 
+customview_1sec_stopwatch_gauge:
+	bsf		menu3_active                ; Set Flag
+	goto	PLED_stopwatch_show_gauge  	; Update figures + Description
+
 customview_1sec_marker:                 ; Do nothing extra
 	bsf		menu3_active                ; Set Flag
 customview_1sec_clock:                  ; Do nothing extra
@@ -198,11 +205,22 @@
 	decfsz		WREG,F					; WREG=1?	
 	bra			customview_toggle		; No, use next Customview
 
+	btfsc		gauge_mode				; In Gauge mode?
+	bra			customview_init_stopwatch_gauge	; Yes
+
 	call	PLED_stopwatch_show			; Init Stopwatch display
 	bsf		menu3_active                ; Set Flag
 	bra		customview_toggle_exit	
 
+customview_init_stopwatch_gauge:
+	call	PLED_stopwatch_show_gauge	; Init Stopwatch display
+	bsf		menu3_active                ; Set Flag
+	bra		customview_toggle_exit	
+
 customview_init_marker:					; Init Marker
+	btfsc		gauge_mode				; In Gauge mode?
+	call		PLED_clear_divemode_menu; Yes, clear BIG stopwatch
+
 	GETCUSTOM8	d'50'					; Show Marker? (=1 in WREG)
 	decfsz		WREG,F					; WREG=1?	
 	bra			customview_toggle		; No, use next Customview
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Sat Jun 18 17:52:52 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Sat Jun 18 20:17:39 2011 +0200
@@ -75,6 +75,7 @@
 
 	bsf		twosecupdate					; Routines used in the "other second"
 	call	calc_average_depth				; calculate average depth
+	call	calc_velocity					; calculate vertical velocity and display if > threshold (every two seconds)
 	
 	bra		diveloop_loop1x					; Common Tasks
 
--- a/code_part1/OSTC_code_asm_part1/english_text.asm	Sat Jun 18 17:52:52 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/english_text.asm	Sat Jun 18 20:17:39 2011 +0200
@@ -396,4 +396,6 @@
 ;Dive interval
     TCODE    .20,   .35,     "Interval:"                 ;307 Interval:
     TCODE    .0,    .0,      "Now"                       ;308 Now
+	TCODE	 .108,	.112,	 "Average"			 		 ;309 Average
+	TCODE	 .94,	.54,	 "Stopwatch"		 		 ;310 Stopwatch (BIG Stopwatch in Gauge mode)
 ;=============================================================================
--- a/code_part1/OSTC_code_asm_part1/french_text.asm	Sat Jun 18 17:52:52 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/french_text.asm	Sat Jun 18 20:17:39 2011 +0200
@@ -397,4 +397,6 @@
 ;Dive interval
     TCODE    .20,   .35,     "Intervalle: "              ;307 Interval:
     TCODE    .0,    .0,      "Maintenant"                ;308 Dive now
+	TCODE	 .108,	.112,	 "Moyenne"			 		 ;309 Average
+	TCODE	 .116,	.54,	 "Chrono"		 		 	 ;310 Stopwatch (BIG Stopwatch in Gauge mode)
 ;=============================================================================
--- a/code_part1/OSTC_code_asm_part1/german_text.asm	Sat Jun 18 17:52:52 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/german_text.asm	Sat Jun 18 20:17:39 2011 +0200
@@ -397,4 +397,6 @@
 ;Dive interval
     TCODE    .20,   .35,     "Interval:"                 ;307 Interval:
     TCODE    .0,    .0,      "Jetzt"                     ;308 Now
+	TCODE	 .109,	.113,	 "D-Tiefe"	 	 		 	 ;309 Average
+	TCODE	 .109,	.54,	 "Stopuhr"		 		 	 ;310 Stopwatch (BIG Stopwatch in Gauge mode)
 ;=============================================================================
--- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Sat Jun 18 17:52:52 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Sat Jun 18 20:17:39 2011 +0200
@@ -1564,7 +1564,7 @@
 
 	movlw	.039
 	cpfslt	hi
-    bra	depth_greater_99_84mtr
+    bra		depth_greater_99_84mtr
 
 	btfsc	depth_greater_100m			; Was depth>100m during last call
 	call	PLED_clear_depth			; Yes, clear depth area
@@ -1580,7 +1580,7 @@
 	movff	lo,sub_b+0
 	incf	sub_b+0,F
 	movlw	d'0'
-	addwfc	sub_b+1,F		; Add 1mBar offset
+	addwfc	sub_b+1,F				; Add 1mBar offset
 	call	sub16					; sub_c = sub_a - sub_b
 	btfss	neg_flag				; Depth lower then 10m?
 	rcall	depth_less_10mtr		; Yes, add extra space
@@ -1603,7 +1603,7 @@
 
 	bsf		leftbind
 	bsf		ignore_digit4
-	output_16		; Full meters in Big font
+	output_16						; Full meters in Big font
 	bcf		leftbind
 	bra		pled_depth3
 
@@ -1624,14 +1624,14 @@
 	
 	STRCPY  "."
 
-	movlw	HIGH	d'9'
+	movlw	HIGH	d'20'			; Display 0.0m if lower then 20cm
 	movwf	sub_a+1
-	movlw	LOW		d'9'
+	movlw	LOW		d'20'
 	movwf	sub_a+0
 	movff	hi,sub_b+1
 	movff	lo,sub_b+0
 	call	sub16					; sub_c = sub_a - sub_b
-	btfss	neg_flag				; Depth lower then 0.1m?
+	btfss	neg_flag				; Depth lower then 0.3m?
 	bra		pled_depth4				; Yes, display manual Zero
 
 	movlw	d'4'
@@ -2222,6 +2222,57 @@
 	STRCAT_PRINT "m"
 	return
 
+PLED_stopwatch_show_gauge:
+	btfsc	menubit					; Divemode menu active?
+	return							; Yes, return
+	; BIG Stopwatch
+	call	PLED_divemask_color	; Set Color for Divemode mask
+	DISPLAYTEXTH	d'310'			; Stopwatch
+	DISPLAYTEXTH	d'309'			; Average
+	call	PLED_standard_color
+	ostc_debug	'V'		; Sends debug-information to screen if debugmode active
+	WIN_TOP		.80
+	WIN_LEFT	.90
+	WIN_FONT	FT_MEDIUM
+	call	PLED_standard_color
+
+	lfsr	FSR2,letter
+	movff	average_divesecs+0,lo				; Stopwatch
+	movff	average_divesecs+1,hi				; Stopwatch
+	movlw	d'2'
+	subwf	lo,F
+	movlw	d'0'
+	subwfb	hi,F						; Subtract 2 seconds
+	call	convert_time				; converts hi:lo in seconds to mins (hi) and secs (lo)
+	movff	lo,wait_temp
+	movff	hi,lo
+	clrf	hi	
+	movlw	d'0'
+	bcf		leftbind
+	bsf		show_last3
+	output_16_3					;Displays only 0...999
+    PUTC    ':'
+	movff	wait_temp,lo
+	output_99x
+	call	word_processor
+
+	ostc_debug	'U'				; Sends debug-information to screen if debugmode active
+	WIN_TOP		.136
+	WIN_LEFT	.90
+	WIN_FONT	FT_MEDIUM
+	call	PLED_standard_color
+	lfsr	FSR2,letter
+	movff	avr_rel_pressure+0,lo
+	movff	avr_rel_pressure+1,hi
+	call	adjust_depth_with_salinity		; computes salinity setting into lo:hi [mBar]
+	bsf		ignore_digit5					; do not display 1cm depth
+	output_16dp	d'3'
+	bcf		leftbind
+	STRCAT_PRINT "m"
+	WIN_FONT	FT_SMALL				; Reset...
+	return
+
+
 PLED_total_average_show:
 	; Non-Resettable Average
 	call		PLED_divemask_color	; Set Color for Divemode mask
@@ -3088,8 +3139,7 @@
 	return
 
 PLED_const_ppO2_too_hi:
-	movlw	'>'
-	movwf	POSTINC2				; Put ">" from WREG into buffer
+	PUTC	'>'
 	setf	lo						; show ">2.55"
 	clrf	hi						; clear hi
 	call	PLED_warnings_color		; Set Warning color
--- a/code_part1/OSTC_code_asm_part1/spanish_text.asm	Sat Jun 18 17:52:52 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/spanish_text.asm	Sat Jun 18 20:17:39 2011 +0200
@@ -392,8 +392,10 @@
 ;@5 variant
     TCODE    .0,    .0,      "Futuro TTS"                ;305 Future TTS            (=10 chars. Title for @5 customview).
 ;
-    TCODE    .100,  .125,    "Quit Sim"                  ;306 Quit Sim (=8char max. Quit Simulator mode)
+    TCODE    .100,  .125,    "SalirSim"                  ;306 Quit Sim (=8char max. Quit Simulator mode)
 ;Dive interval
     TCODE    .20,   .35,     "Interval:"                 ;307 Interval:
     TCODE    .0,    .0,      "Now"                       ;308 Now
+	TCODE	 .100,	.113,	 "Promedio"			 		 ;309 Average
+	TCODE	 .116,	.54,	 "Crono."		 		 	 ;310 Stopwatch (BIG Stopwatch in Gauge mode)
 ;=============================================================================