Rev 9 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9 | Rev 13 | ||
---|---|---|---|
Line 51... | Line 51... | ||
51 | dial_size (uint8_t size) |
51 | dial_size (uint8_t size) |
52 | { |
52 | { |
53 | siz = size; |
53 | siz = size; |
54 | } |
54 | } |
55 | 55 | ||
56 | void |
- | |
57 | dial_draw_scale (uint8_t low, uint8_t high, uint8_t width, uint8_t num_step) |
56 | void dial_draw_scale (int16_t low, int16_t high, uint8_t width, uint8_t num_step,int16_t scale) |
58 | { |
57 | { |
59 | int sz; |
58 | int sz; |
60 | int ang; |
59 | int ang; |
- | 60 | int sc_low = low/scale; |
|
- | 61 | int sc_high = high/scale; |
|
61 | int step = 256 * a1 * 2 / (4 * (high - low)); |
62 | int step = 256 * a1 * 2 / (4 * (sc_high - sc_low)); |
62 | int t; |
63 | int t; |
63 | ang = -a1 * 256; |
64 | ang = -a1 * 256; |
64 | for (t = low * 4; t <= high * 4; t++) |
65 | for (t = sc_low * 4; t <= sc_high * 4; t++) |
65 | { |
66 | { |
66 | int si = ap_sin (ang / 256); |
67 | int si = ap_sin (ang / 256); |
67 | int co = ap_cos (ang / 256); |
68 | int co = ap_cos (ang / 256); |
68 | 69 | ||
69 | int len; |
70 | int len; |
Line 85... | Line 86... | ||
85 | AP_SCALE((siz-len)*si) + xo, |
86 | AP_SCALE((siz-len)*si) + xo, |
86 | yo - AP_SCALE((siz - len) * co), 1); |
87 | yo - AP_SCALE((siz - len) * co), 1); |
87 | ang += step; |
88 | ang += step; |
88 | } |
89 | } |
89 | 90 | ||
90 | font_gotoxy (0, 7); |
- | |
91 | font_digits(2,10,low); |
91 | font_sig_digits (0,7,0,low); |
92 | font_gotoxy (19, 7); |
- | |
93 | font_digits(2,10,high); |
92 | font_sig_digits(20,7,1,high); |
94 | } |
93 | } |
95 | 94 | ||
96 | void |
95 | void |
97 | dial_origin (uint8_t x, uint8_t y) |
96 | dial_origin (uint8_t x, uint8_t y) |
98 | { |
97 | { |