comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 27:29341afd2060

NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded NEW: CF43: Depth [mBar] for color-code display NEW: CF44: CNS [%] for color-code display NEW: CF45: GF [%] for color-code display NEW: CF46: ppO2 [cBar] for color-code display NEW: CF47: Velocity [m/min] for color-code display
author heinrichsweikamp
date Sat, 15 May 2010 17:58:55 +0200
parents 8d7af04e0f85
children c6cab044a338
comparison
equal deleted inserted replaced
26:8d7af04e0f85 27:29341afd2060
46 tstfsz WREG ; =0? 46 tstfsz WREG ; =0?
47 bra PLED_warnings_color2 47 bra PLED_warnings_color2
48 movlw color_warnings ; Reset Color 48 movlw color_warnings ; Reset Color
49 PLED_warnings_color2: 49 PLED_warnings_color2:
50 call PLED_set_color 50 call PLED_set_color
51 return
52
53 PLED_color_code macro color_code_temp
54 movlw color_code_temp
55 call PLED_color_code1
56 endm
57
58 PLED_color_code1: ; Color-codes the output, if required
59 movwf debug_temp
60 dcfsnz debug_temp,F
61 bra PLED_color_code_depth ; CF43 [mBar], 16Bit
62 dcfsnz debug_temp,F
63 bra PLED_color_code_cns ; CF44 [%]
64 dcfsnz debug_temp,F
65 bra PLED_color_code_gf ; CF45 [%]
66 dcfsnz debug_temp,F
67 bra PLED_color_code_ppo2 ; CF46 [cBar]
68 dcfsnz debug_temp,F
69 bra PLED_color_code_velocity ; CF47 [m/min]
70
71 PLED_color_code_depth:
72 movff hi,hi_temp
73 movff lo,lo_temp
74 movff rel_pressure+1,hi
75 movff rel_pressure+0,lo
76 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar]
77 movff lo,sub_a+0
78 movff hi,sub_a+1
79 GETCUSTOM15 d'43' ; Depth warn [mBar]
80 movff lo,sub_b+0
81 movff hi,sub_b+1
82 call sub16 ; sub_c = sub_a - sub_b
83 btfss neg_flag
84 bra PLED_color_code_depth2; Set to warning color
85 call PLED_standard_color
86 movff hi_temp,hi
87 movff lo_temp,lo ; Restore hi, lo
88 return
89 PLED_color_code_depth2:
90 call PLED_warnings_color
91 movff hi_temp,hi
92 movff lo_temp,lo ; Restore hi, lo
93 return
94
95 PLED_color_code_cns:
96 movff char_O_CNS_fraction,lo
97 GETCUSTOM8 d'44' ; CNS Warn [%]
98 subwf lo,W
99 btfsc STATUS,C
100 bra PLED_color_code_cns2 ; Set to warning color
101 call PLED_standard_color
102 return
103 PLED_color_code_cns2:
104 call PLED_warnings_color
105 return
106
107 PLED_color_code_gf:
108 movff char_O_gradient_factor,lo ; gradient factor
109 GETCUSTOM8 d'45' ; GF Warn [%]
110 subwf lo,W
111 btfsc STATUS,C
112 bra PLED_color_code_gf2 ; Set to warning color
113 call PLED_standard_color
114 return
115 PLED_color_code_gf2:
116 call PLED_warnings_color
117 return
118
119 PLED_color_code_ppo2:
120 movff xC+0,sub_a+0
121 movff xC+1,sub_a+1
122 GETCUSTOM8 d'46' ; ppO2 warn [cBar]
123 mullw d'100'
124 movff PRODL,sub_b+0
125 movff PRODH,sub_b+1
126 call sub16 ; sub_c = sub_a - sub_b
127 btfss neg_flag
128 bra PLED_color_code_ppo22; Set to warning color
129 call PLED_standard_color
130 return
131 PLED_color_code_ppo22:
132 call PLED_warnings_color
133 return
134
135 PLED_color_code_velocity:
136 movff divA+0,lo
137 GETCUSTOM8 d'47' ; Velocity warn [m/min]
138 subwf lo,W
139 btfsc STATUS,C
140 bra PLED_color_code_velocity2 ; Set to warning color
141 call PLED_standard_color
142 return
143 PLED_color_code_velocity2:
144 call PLED_warnings_color
51 return 145 return
52 146
53 ostc_debug macro debug_temp 147 ostc_debug macro debug_temp
54 movlw debug_temp 148 movlw debug_temp
55 call ostc_debug1 149 call ostc_debug1
328 ostc_debug 'w' ; Sends debug-information to screen if debugmode active 422 ostc_debug 'w' ; Sends debug-information to screen if debugmode active
329 ;GF 423 ;GF
330 WIN_TOP .145 424 WIN_TOP .145
331 WIN_LEFT .0 425 WIN_LEFT .0
332 WIN_FONT FT_SMALL 426 WIN_FONT FT_SMALL
333 call PLED_standard_color 427 PLED_color_code warn_gf ; Color-code Output
334 lfsr FSR2,letter 428 lfsr FSR2,letter
335 movlw 'G' 429 movlw 'G'
336 movwf POSTINC2 430 movwf POSTINC2
337 movlw 'F' 431 movlw 'F'
338 movwf POSTINC2 432 movwf POSTINC2
343 movlw '%' 437 movlw '%'
344 movwf POSTINC2 438 movwf POSTINC2
345 movlw ' ' 439 movlw ' '
346 movwf POSTINC2 440 movwf POSTINC2
347 call word_processor 441 call word_processor
442 call PLED_standard_color
348 return 443 return
349 444
350 PLED_simulator_data: 445 PLED_simulator_data:
351 WIN_TOP .65 446 WIN_TOP .65
352 WIN_LEFT .105 447 WIN_LEFT .105
389 484
390 ostc_debug 'v' ; Sends debug-information to screen if debugmode active 485 ostc_debug 'v' ; Sends debug-information to screen if debugmode active
391 WIN_TOP .90 486 WIN_TOP .90
392 WIN_LEFT .0 487 WIN_LEFT .0
393 WIN_FONT FT_SMALL 488 WIN_FONT FT_SMALL
394 call PLED_standard_color 489 PLED_color_code warn_velocity ; Color code output
395 lfsr FSR2,letter 490 lfsr FSR2,letter
396 movlw '-' 491 movlw '-'
397 btfsc neg_flag 492 btfsc neg_flag
398 movlw '+' 493 movlw '+'
399 movwf POSTINC2 494 movwf POSTINC2
400 movff divA+0,lo 495 movff divA+0,lo
401 output_99 496 output_99
402 OUTPUTTEXT d'83' ; m/min 497 OUTPUTTEXT d'83' ; m/min
403 call word_processor 498 call word_processor
499 call PLED_standard_color
404 bsf pled_velocity_display 500 bsf pled_velocity_display
405 return 501 return
406 502
407 PLED_display_velocity_clear: 503 PLED_display_velocity_clear:
408 movlw d'8' 504 movlw d'8'
778 PLED_show_ppO2: ; Show ppO2 874 PLED_show_ppO2: ; Show ppO2
779 ostc_debug 't' ; Sends debug-information to screen if debugmode active 875 ostc_debug 't' ; Sends debug-information to screen if debugmode active
780 WIN_TOP .120 876 WIN_TOP .120
781 WIN_LEFT .0 877 WIN_LEFT .0
782 WIN_FONT FT_SMALL 878 WIN_FONT FT_SMALL
783 call PLED_standard_color 879 PLED_color_code warn_ppo2 ; Color-code output
784 880
785 lfsr FSR2,letter 881 lfsr FSR2,letter
786 movlw 'p' 882 movlw 'p'
787 movwf POSTINC2 883 movwf POSTINC2
788 movlw 'p' 884 movlw 'p'
799 output_16dp d'1' 895 output_16dp d'1'
800 bcf ignore_digit4 896 bcf ignore_digit4
801 movlw ' ' 897 movlw ' '
802 movwf POSTINC2 898 movwf POSTINC2
803 call word_processor 899 call word_processor
900 call PLED_standard_color
804 return 901 return
805 902
806 PLED_show_ppO2_clear: ; Clear ppO2 903 PLED_show_ppO2_clear: ; Clear ppO2
807 movlw d'10' 904 movlw d'10'
808 movwf temp1 905 movwf temp1
1464 1561
1465 WIN_TOP .24 1562 WIN_TOP .24
1466 WIN_LEFT .0 1563 WIN_LEFT .0
1467 WIN_FONT FT_LARGE 1564 WIN_FONT FT_LARGE
1468 WIN_INVERT .0 ; Init new Wordprocessor 1565 WIN_INVERT .0 ; Init new Wordprocessor
1469 call PLED_standard_color 1566 PLED_color_code warn_depth ; Color-code the output
1470
1471 1567
1472 movlw HIGH d'99' 1568 movlw HIGH d'99'
1473 movwf sub_a+1 1569 movwf sub_a+1
1474 movlw LOW d'99' 1570 movlw LOW d'99'
1475 movwf sub_a+0 1571 movwf sub_a+0
1493 bcf ignore_digit4 1589 bcf ignore_digit4
1494 1590
1495 WIN_FONT FT_MEDIUM 1591 WIN_FONT FT_MEDIUM
1496 WIN_TOP .50 1592 WIN_TOP .50
1497 WIN_LEFT .40 1593 WIN_LEFT .40
1498 call PLED_standard_color 1594 PLED_color_code warn_depth ; Color-code the output
1499
1500 1595
1501 movff rel_pressure+1,hi 1596 movff rel_pressure+1,hi
1502 movff rel_pressure+0,lo 1597 movff rel_pressure+0,lo
1503 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] 1598 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar]
1504 lfsr FSR2,letter 1599 lfsr FSR2,letter
1540 lfsr FSR2,letter 1635 lfsr FSR2,letter
1541 WIN_TOP .24 1636 WIN_TOP .24
1542 WIN_LEFT .0 1637 WIN_LEFT .0
1543 WIN_FONT FT_LARGE 1638 WIN_FONT FT_LARGE
1544 WIN_INVERT .0 ; Init new Wordprocessor 1639 WIN_INVERT .0 ; Init new Wordprocessor
1545 call PLED_standard_color 1640 PLED_color_code warn_depth ; Color-code the output
1546 1641
1547 bsf ignore_digit4 1642 bsf ignore_digit4
1548 bsf leftbind 1643 bsf leftbind
1549 output_16 1644 output_16
1550 bcf leftbind 1645 bcf leftbind
2959 3054
2960 WIN_TOP .168 3055 WIN_TOP .168
2961 WIN_LEFT .65 3056 WIN_LEFT .65
2962 WIN_FONT FT_SMALL 3057 WIN_FONT FT_SMALL
2963 WIN_INVERT .0 ; Init new Wordprocessor 3058 WIN_INVERT .0 ; Init new Wordprocessor
2964 call PLED_standard_color
2965 3059
2966 lfsr FSR2,letter 3060 lfsr FSR2,letter
2967 movff char_I_const_ppO2,lo 3061 movff char_I_const_ppO2,lo
2968 3062
2969 tstfsz lo ; In Bailout mode (char_I_const_ppO2=0)? 3063 tstfsz lo ; In Bailout mode (char_I_const_ppO2=0)?
2970 bra PLED_const_ppO2_value2 ; No, display Setpoint 3064 bra PLED_const_ppO2_value2 ; No, display Setpoint
2971 3065
2972 ; Yes, Display "Bail" 3066 ; Yes, Display "Bail"
3067 call PLED_standard_color
2973 OUTPUTTEXTH d'263' ;"Bail" 3068 OUTPUTTEXTH d'263' ;"Bail"
2974 call word_processor 3069 call word_processor
2975 return 3070 return
2976 3071
2977 PLED_const_ppO2_value2: ; Display SetPoint 3072 PLED_const_ppO2_value2: ; Display SetPoint
3036 3131
3037 ; Setpoint in possible limits 3132 ; Setpoint in possible limits
3038 movff ppO2_setpoint_store,char_I_const_ppO2 ; Restore Setpoint 3133 movff ppO2_setpoint_store,char_I_const_ppO2 ; Restore Setpoint
3039 3134
3040 PLED_const_ppO2_value1a: 3135 PLED_const_ppO2_value1a:
3136 PLED_color_code warn_ppo2 ; Color-code output
3041 movff char_I_const_ppO2,lo 3137 movff char_I_const_ppO2,lo
3042 clrf hi 3138 clrf hi
3043 bsf leftbind 3139 bsf leftbind
3044 output_16dp d'3' 3140 output_16dp d'3'
3045 bcf leftbind 3141 bcf leftbind
3046 call word_processor 3142 call word_processor
3143 call PLED_standard_color
3047 return 3144 return
3048 3145
3049 PLED_show_leading_tissue: 3146 PLED_show_leading_tissue:
3050 call deco_main_calc_desaturation_time ; calculate desaturation time 3147 call deco_main_calc_desaturation_time ; calculate desaturation time
3051 movlb b'00000001' ; select ram bank 1 3148 movlb b'00000001' ; select ram bank 1
3141 ostc_debug 'k' ; Sends debug-information to screen if debugmode active 3238 ostc_debug 'k' ; Sends debug-information to screen if debugmode active
3142 3239
3143 WIN_TOP .090 3240 WIN_TOP .090
3144 WIN_LEFT .0 3241 WIN_LEFT .0
3145 WIN_FONT FT_SMALL 3242 WIN_FONT FT_SMALL
3146 call PLED_standard_color 3243 PLED_color_code warn_cns ; Color-code CNS output
3147
3148 3244
3149 lfsr FSR2,letter 3245 lfsr FSR2,letter
3150 movlw 'C' 3246 movlw 'C'
3151 movwf POSTINC2 3247 movwf POSTINC2
3152 movlw 'N' 3248 movlw 'N'