Subversion Repositories DashDisplay

Rev

Rev 10 | Rev 14 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10 Rev 13
Line 103... Line 103...
103
int  DisplayCurrent(int dial,int suppress)
103
int  DisplayCurrent(int dial,int suppress)
104
{
104
{
105
        char buff[10];
105
        char buff[10];
106
        int i;
106
        int i;
107
        select_display(dial); // pick the display we are using
107
        select_display(dial); // pick the display we are using
108
        int ItemIndex = dial_pos[dial];
108
        int ItemIndex = dial_pos[dial]/4;
109
        // wrap around count if dial too far to the right
109
        // wrap around count if dial too far to the right
110
        if (ItemIndex >= PLXItems)
110
        if (ItemIndex >= PLXItems)
111
        {
111
        {
112
                dial_pos[dial] = 0;
112
                dial_pos[dial] = 0;
113
                ItemIndex = 0;
113
                ItemIndex = 0;
Line 159... Line 159...
159
                                        || ObservationIndex != OldObservationIndex[dial])
159
                                        || ObservationIndex != OldObservationIndex[dial])
160
                        {
160
                        {
161
                                dial1[dial] = -1;
161
                                dial1[dial] = -1;
162
                                clearDisplay();
162
                                clearDisplay();
163
                                dial_draw_scale(
163
                                dial_draw_scale(
164
                                                DisplayInfo[Observation].Low
164
                                                DisplayInfo[Observation].Low,
165
                                                                / DisplayInfo[Observation].TickScale,
-
 
166
                                                DisplayInfo[Observation].High
165
                                                DisplayInfo[Observation].High,
167
                                                                / DisplayInfo[Observation].TickScale, 12, 1);
166
                                            12, 1,DisplayInfo[Observation].TickScale);
168
                                if (ObservationIndex > 0)
167
                                if (ObservationIndex > 0)
169
                                {
168
                                {
170
                                        len = 5;
169
                                        len = 5;
171
                                        buff[6] = ObservationIndex + '1';
170
                                        buff[6] = ObservationIndex + '1';
172
                                }
171
                                }
Line 202... Line 201...
202
                        min_rdg = ConveriMFDRaw2Data(Observation,
201
                        min_rdg = ConveriMFDRaw2Data(Observation,
203
                                        DisplayInfo[Observation].Units, Min[ItemIndex]);
202
                                        DisplayInfo[Observation].Units, Min[ItemIndex]);
204
                        cur_rdg = ConveriMFDRaw2Data(Observation,
203
                        cur_rdg = ConveriMFDRaw2Data(Observation,
205
                                        DisplayInfo[Observation].Units, DataVal);
204
                                        DisplayInfo[Observation].Units, DataVal);
206
 
205
 
207
                        cur_rdg /= DisplayInfo[Observation].TickScale;
-
 
208
                        int dp_pos;  // where to print the decimal place
206
                        int dp_pos;  // where to print the decimal place
209
                        switch (DisplayInfo[Observation].DP)
207
                        switch (DisplayInfo[Observation].DP)
210
                        {
208
                        {
211
                        case 0:
209
                        case 0:
212
                                int_rdg = (int) (cur_rdg);
210
                                int_rdg = (int) (cur_rdg);
Line 231... Line 229...
231
                        cur_rdg -= DisplayInfo[Observation].Low;
229
                        cur_rdg -= DisplayInfo[Observation].Low;
232
                        cur_rdg = 100 * cur_rdg
230
                        cur_rdg = 100 * cur_rdg
233
                                        / (DisplayInfo[Observation].High
231
                                        / (DisplayInfo[Observation].High
234
                                                        - DisplayInfo[Observation].Low);
232
                                                        - DisplayInfo[Observation].Low);
235
 
233
 
236
                        dial0[dial] = (int) cur_rdg;
234
                        dial0[dial] = (int) cur_rdg  ;
237
 
235
 
238
                        /* old needle un-draw */
236
                        /* old needle un-draw */
239
                        if (dial1[dial] >= 0)
237
                        if (dial1[dial] >= 0)
240
                        {
238
                        {
241
                                dial_draw_needle(dial1[dial]);
239
                                dial_draw_needle(dial1[dial]);
Line 341... Line 339...
341
                clearDisplay();
339
                clearDisplay();
342
                dim(0);
340
                dim(0);
343
                //font_puts(
341
                //font_puts(
344
                //              "Hello world !!\rThis text is a test of the text rendering library in a 5*7 font");
342
                //              "Hello world !!\rThis text is a test of the text rendering library in a 5*7 font");
345
 
343
 
346
                dial_draw_scale(0, 10, 12, 5);
344
                dial_draw_scale(0, 10, 12, 5,1);
347
                char  buffer[] = "Display  ";
345
                char  buffer[] = "Display  ";
348
                buffer[8] = disp+'1';
346
                buffer[8] = disp+'1';
349
                print_large_string(buffer, 20,30, 9);
347
                print_large_string(buffer, 20,30, 9);
350
 
348
 
351
                display();
349
                display();