Rev 15 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 15 | Rev 16 | ||
|---|---|---|---|
| Line 30... | Line 30... | ||
| 30 | uint8_t y, |
30 | uint8_t y, |
| 31 | uint8_t siz, |
31 | uint8_t siz, |
| 32 | int16_t angle_low, |
32 | int16_t angle_low, |
| 33 | int16_t angle_high); |
33 | int16_t angle_high); |
| 34 | 34 | ||
| 35 | /// @brief Put the dial needle on the display |
35 | /// @brief Put the dial needle on the display |
| 36 | /// @param position values are from 0 .. math.SINE_STEPS |
36 | /// @param position values are from 0 .. math.SINE_STEPS |
| 37 | void draw_needle(int16_t position); |
37 | void draw_needle(int16_t position); |
| 38 | 38 | ||
| 39 | - | ||
| 40 | // draw the scale |
39 | /// @brief draw the scale |
| 41 | /// \param low low end of range |
40 | /// \param low low end of range |
| 42 | /// \param high high end of range |
41 | /// \param high high end of range |
| 43 | /// \param width length of long marker |
42 | /// \param width length of long marker |
| 44 | /// \param num_step number of ticks |
43 | /// \param num_step number of ticks |
| 45 | /// \param scale |
44 | /// \param scale |
| 46 | void draw_scale(int16_t low, int16_t high, uint8_t width, uint8_t num_step, int16_t scale); |
45 | void draw_scale(int16_t low, int16_t high, uint8_t width, uint8_t num_step, int16_t scale); |
| 47 | 46 | ||
| 48 | /// print min/max limits |
47 | /// @brief print min/max limits |
| 49 | void draw_limits(); |
48 | virtual void draw_limits(){}; |
| - | 49 | ||
| - | 50 | /// @brief Draw value on display |
|
| - | 51 | /// @param val integer value to show with fake decimal point |
|
| - | 52 | /// @param dp decimal point code |
|
| - | 53 | virtual void draw_value(int val, int dp){}; |
|
| - | 54 | ||
| - | 55 | /// @brief Set units string on display |
|
| - | 56 | /// @param str Constant string to refer to |
|
| - | 57 | void set_units(char const *str){m_unitStr = str; }; |
|
| - | 58 | ||
| - | 59 | protected: |
|
| - | 60 | ||
| - | 61 | void draw_value_items(int val, int dpCode, int wid, int x , int y ); |
|
| - | 62 | ||
| 50 | 63 | ||
| 51 | private: |
- | |
| 52 | display_t &m_display; |
64 | display_t &m_display; |
| 53 | uint8_t const m_xo; ///< Position of origin |
65 | uint8_t const m_xo; ///< Position of origin |
| 54 | uint8_t const m_yo; ///< Position of origin |
66 | uint8_t const m_yo; ///< Position of origin |
| 55 | uint8_t const m_siz; ///< Display size |
67 | uint8_t const m_siz; ///< Display size |
| 56 | int16_t const m_angleLow; ///< Angle for lowest value |
68 | int16_t const m_angleLow; ///< Angle for lowest value |
| 57 | int16_t const m_angleRange; ///< Angle range from lowest to highest value |
69 | int16_t const m_angleRange; ///< Angle range from lowest to highest value |
| 58 | int16_t m_low; ///< lower scale limit |
70 | int16_t m_low; ///< lower scale limit |
| 59 | int16_t m_high; ///< upper scale limit |
71 | int16_t m_high; ///< upper scale limit |
| - | 72 | char const * m_unitStr; ///< Units_string |
|
| 60 | }; |
73 | }; |
| - | 74 | ||
| - | 75 | ////////////////////////////////////////////////// |
|
| - | 76 | /// A display using the whole graphics area, 180 degree sweep |
|
| - | 77 | class displayFullDial_t : public displayDial_t |
|
| - | 78 | { |
|
| - | 79 | public: |
|
| - | 80 | /// @brief Constructor for full-screen display |
|
| - | 81 | /// @param display The display it is being shown on |
|
| - | 82 | displayFullDial_t(display_t &display); |
|
| - | 83 | ||
| - | 84 | /// @brief draw axes limits |
|
| - | 85 | virtual void draw_limits() final; |
|
| - | 86 | ||
| - | 87 | /// @brief Draw value on display |
|
| - | 88 | /// @param val integer value to show with fake decimal point |
|
| - | 89 | /// @param dp decimal point code |
|
| - | 90 | virtual void draw_value(int val, int dp) final; |
|
| - | 91 | ||
| - | 92 | ||
| - | 93 | }; |
|
| - | 94 | ||
| - | 95 | ////////////////////////////////////////////////// |
|
| - | 96 | /// A display using left hand side of graphics area, 90 degree quadrant |
|
| - | 97 | class displayLeftQuadrantDial_t : public displayDial_t |
|
| - | 98 | { |
|
| - | 99 | public: |
|
| - | 100 | /// @brief Constructor for left quadrant display |
|
| - | 101 | /// @param display The display it is being shown on |
|
| - | 102 | displayLeftQuadrantDial_t(display_t &display); |
|
| - | 103 | ||
| - | 104 | /// @brief draw axes limits |
|
| - | 105 | virtual void draw_limits() final; |
|
| - | 106 | ||
| - | 107 | /// @brief Draw value on display |
|
| - | 108 | /// @param val integer value to show with fake decimal point |
|
| - | 109 | /// @param dp decimal point code |
|
| - | 110 | virtual void draw_value(int val, int dp) final; |
|
| - | 111 | ||
| - | 112 | ||
| - | 113 | }; |
|
| - | 114 | ||
| - | 115 | ////////////////////////////////////////////////// |
|
| - | 116 | /// A display using right hand side of graphics area, 90 degree quadrant |
|
| - | 117 | class displayRightQuadrantDial_t : public displayDial_t |
|
| - | 118 | { |
|
| - | 119 | public: |
|
| - | 120 | /// @brief Constructor for right quadrant display |
|
| - | 121 | /// @param display The display it is being shown on |
|
| - | 122 | displayRightQuadrantDial_t(display_t &display); |
|
| - | 123 | /// @brief draw axes limits |
|
| - | 124 | virtual void draw_limits() final; |
|
| - | 125 | ||
| - | 126 | /// @brief Draw value on display |
|
| - | 127 | /// @param val integer value to show with fake decimal point |
|
| - | 128 | /// @param dp decimal point code |
|
| - | 129 | virtual void draw_value(int val, int dp) final; |
|
| - | 130 | ||
| - | 131 | ||
| - | 132 | }; |
|
| 61 | 133 | ||