| 91 | } |
| 92 | |
| 93 | void SysMsgPlugin::update(YAGfx& gfx) |
| 94 | { |
| 95 | bool isScrollingEnabled = false; |
| 96 | uint32_t scrollingCnt = 0U; |
| 97 | bool status = false; |
| 98 | |
| 99 | m_view.update(gfx); |
| 100 | |
| 101 | status = m_view.getScrollInfo(isScrollingEnabled, scrollingCnt); |
| 102 | |
| 103 | /* In initialization phase? */ |
| 104 | if (true == m_isInit) |
| 105 | { |
| 106 | m_timer.stop(); |
| 107 | |
| 108 | /* Is the scroll info ready? */ |
| 109 | if (true == status) |
| 110 | { |
| 111 | /* Start timer if text doesn't scroll and shall not be shown infinite. */ |
| 112 | if ((false == isScrollingEnabled) && |
| 113 | (0U < m_duration)) |
| 114 | { |
| 115 | m_timer.start(m_duration); |
| 116 | } |
| 117 | |
| 118 | m_isInit = false; |
| 119 | } |
| 120 | } |
| 121 | /* Is timer running for non-scrolled text? */ |
| 122 | else if (true == m_timer.isTimerRunning()) |
| 123 | { |
| 124 | if (true == m_timer.isTimeout()) |
| 125 | { |
| 126 | /* If no message is available anymore, the plugin will be disabled. */ |
| 127 | if (false == nextMessage()) |
| 128 | { |
| 129 | disable(); |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | /* Shall scrolling text be shown a specific number of times? */ |
| 134 | else if (0U < m_max) |
| 135 | { |
| 136 | /* Is the scroll info ready? */ |
| 137 | if (true == status) |
| 138 | { |
| 139 | /* Show next message after specific number of times, the text was shown. */ |
| 140 | if (m_max < scrollingCnt) |
| 141 | { |
| 142 | /* If no message is available anymore, the plugin will be disabled. */ |
| 143 | if (false == nextMessage()) |
| 144 | { |
| 145 | disable(); |
| 146 | } |
| 147 | } |
| 148 | } |
| 149 | } |
| 150 | else |
nothing calls this directly
no test coverage detected