TargetManager manual test
Dependencies: TargetManager mbed
TestTargetManager.cpp@11:d07c9f451088, 2017-04-09 (annotated)
- Committer:
- GaiSensei
- Date:
- Sun Apr 09 23:46:10 2017 +0000
- Revision:
- 11:d07c9f451088
- Parent:
- 10:766bb1c03153
Make sure a bumper hit doesn't mess with the ticker
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dupm2216 | 8:b9745dd296c2 | 1 | #include "TestTargetManager.hpp" |
dupm2216 | 8:b9745dd296c2 | 2 | |
dupm2216 | 8:b9745dd296c2 | 3 | #include <cstdio> |
dupm2216 | 8:b9745dd296c2 | 4 | |
GaiSensei | 10:766bb1c03153 | 5 | TestTargetManager::TestTargetManager(std::vector<NerfusTickerInterface*>& target_timeout_tickers) : |
GaiSensei | 10:766bb1c03153 | 6 | target_timeout_tickers(target_timeout_tickers) |
GaiSensei | 10:766bb1c03153 | 7 | { |
GaiSensei | 10:766bb1c03153 | 8 | |
GaiSensei | 10:766bb1c03153 | 9 | } |
GaiSensei | 10:766bb1c03153 | 10 | |
GaiSensei | 10:766bb1c03153 | 11 | void TestTargetManager::execute(const std::vector<uint8_t>& target_info_bytes, int *address) |
dupm2216 | 8:b9745dd296c2 | 12 | { |
dupm2216 | 8:b9745dd296c2 | 13 | |
dupm2216 | 8:b9745dd296c2 | 14 | } |
dupm2216 | 8:b9745dd296c2 | 15 | |
dupm2216 | 8:b9745dd296c2 | 16 | void TestTargetManager::target_hit(int target_number) |
dupm2216 | 8:b9745dd296c2 | 17 | { |
GaiSensei | 11:d07c9f451088 | 18 | target_timeout_tickers[target_number]->stop(); |
GaiSensei | 10:766bb1c03153 | 19 | std::printf("Target #%d hit after %d ms\r\n", target_number, target_timeout_tickers[target_number]->get_time_ms()); |
dupm2216 | 8:b9745dd296c2 | 20 | } |
dupm2216 | 8:b9745dd296c2 | 21 | |
dupm2216 | 8:b9745dd296c2 | 22 | void TestTargetManager::target_missed(int target_number) |
dupm2216 | 8:b9745dd296c2 | 23 | { |
GaiSensei | 10:766bb1c03153 | 24 | std::printf("Target #%d missed after %d ms\r\n", target_number, target_timeout_tickers[target_number]->get_time_ms()); |
dupm2216 | 8:b9745dd296c2 | 25 | } |