comparison Discovery/Src/tMenuSetpoint.c @ 662:1b995079c045 Betatest

PSCR Mode
author heinrichs weikamp
date Tue, 14 Dec 2021 15:36:10 +0100
parents 5f0d3dce5ef4
children 4abfb8a2a435
comparison
equal deleted inserted replaced
661:87bee7cc77b3 662:1b995079c045
51 51
52 textPointer = 0; 52 textPointer = 0;
53 *tab = 130; 53 *tab = 130;
54 *subtext = 0; 54 *subtext = 0;
55 55
56 for(int spId=1;spId<=NUM_GASES;spId++) 56 if((actual_menu_content == MENU_SURFACE) || (stateUsed->diveSettings.diveMode != DIVEMODE_PSCR)) /* do not show setpoints in PSCR mode */
57 { 57 {
58 if(line && (line != spId)) 58 for(int spId=1;spId<=NUM_GASES;spId++)
59 { 59 {
60 first = pSetpointLine[spId].note.ub.first; 60 if(line && (line != spId))
61 if(first == 0) 61 {
62 { 62 first = pSetpointLine[spId].note.ub.first;
63 strcpy(&text[textPointer], 63 if(first == 0)
64 "\t" 64 {
65 "\177" 65 strcpy(&text[textPointer],
66 "*" 66 "\t"
67 "\n\r" 67 "\177"
68 ); 68 "*"
69 textPointer += 5; 69 "\n\r"
70 } 70 );
71 else 71 textPointer += 5;
72 { 72 }
73 strcpy(&text[textPointer],"\n\r"); 73 else
74 textPointer += 2; 74 {
75 } 75 strcpy(&text[textPointer],"\n\r");
76 } 76 textPointer += 2;
77 else 77 }
78 { 78 }
79 setpoint_cbar = pSetpointLine[spId].setpoint_cbar; 79 else
80 depthUp = pSetpointLine[spId].depth_meter; 80 {
81 //active = pSetpointLine[spId].note.ub.active; 81 setpoint_cbar = pSetpointLine[spId].setpoint_cbar;
82 first = pSetpointLine[spId].note.ub.first; 82 depthUp = pSetpointLine[spId].depth_meter;
83 //active = pSetpointLine[spId].note.ub.active;
84 first = pSetpointLine[spId].note.ub.first;
83 85
84 strcpy(&text[textPointer],"\020"); // if(active) always active 86 strcpy(&text[textPointer],"\020"); // if(active) always active
85 textPointer += 1; 87 textPointer += 1;
86 88
87 sp_high = setpoint_cbar / 100; 89 sp_high = setpoint_cbar / 100;
88 90
89 text[textPointer++] = 'S'; 91 text[textPointer++] = 'S';
90 text[textPointer++] = 'P'; 92 text[textPointer++] = 'P';
91 text[textPointer++] = '0' + spId; 93 text[textPointer++] = '0' + spId;
92 text[textPointer++] = '\t'; 94 text[textPointer++] = '\t';
93 95
94 if((first == 0) || (actual_menu_content != MENU_SURFACE)) 96 if((first == 0) || (actual_menu_content != MENU_SURFACE))
95 strcpy(&text[textPointer++],"\177"); 97 strcpy(&text[textPointer++],"\177");
96 98
97 char color = '\031'; 99 char color = '\031';
98 if(depthUp) 100 if(depthUp)
99 color = '\020'; 101 color = '\020';
100 102
101 textPointer += snprintf(&text[textPointer], 57, 103 textPointer += snprintf(&text[textPointer], 57,
102 "* " 104 "* "
103 "%u.%02u" 105 "%u.%02u"
104 "\016\016" 106 "\016\016"
105 " bar" 107 " bar"
106 "\017" 108 "\017"
107 "\034" 109 "\034"
108 " " 110 " "
109 "\016\016" 111 "\016\016"
110 " " 112 " "
111 "\017" 113 "\017"
112 "%c" 114 "%c"
113 "%3u" 115 "%3u"
114 "\016\016" 116 "\016\016"
115 " %c%c" 117 " %c%c"
116 "\017" 118 "\017"
117 "\035" 119 "\035"
118 "\n\r", 120 "\n\r",
119 sp_high, setpoint_cbar - (100 * sp_high), 121 sp_high, setpoint_cbar - (100 * sp_high),
120 color, 122 color,
121 unit_depth_integer(depthUp), 123 unit_depth_integer(depthUp),
122 unit_depth_char1(), 124 unit_depth_char1(),
123 unit_depth_char2() 125 unit_depth_char2()
124 ); 126 );
125 } 127 }
128 }
126 } 129 }
127 if((actual_menu_content != MENU_SURFACE) /*&& (line == 0)*/) 130 if((actual_menu_content != MENU_SURFACE) /*&& (line == 0)*/)
128 { 131 {
129 text[textPointer++] = '\020'; 132 text[textPointer++] = '\020';
130 text[textPointer++] = TXT_2BYTE; 133 text[textPointer++] = TXT_2BYTE;
131 text[textPointer++] = TXT2BYTE_UseSensor; 134 text[textPointer++] = TXT2BYTE_UseSensor;
132 text[textPointer++] = '\n'; 135 text[textPointer++] = '\n';
133 text[textPointer++] = '\r'; 136 text[textPointer++] = '\r';
137
138
139 if(stateUsed->diveSettings.diveMode == DIVEMODE_PSCR)
140 {
141 textPointer += snprintf(&text[textPointer], 20,"\020%c", TXT_SimPpo2);
142 }
134 text[textPointer++] = 0; 143 text[textPointer++] = 0;
135 } 144 }
136 else 145 else
137 { 146 {
138 text[textPointer++] = '\020'; 147 text[textPointer++] = '\020';