| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // ====================================================================== | ||
| 2 | // \title TypeDemo.cpp | ||
| 3 | // \author mstarch | ||
| 4 | // \brief cpp file for TypeDemo component implementation class | ||
| 5 | // ====================================================================== | ||
| 6 | |||
| 7 | #include <Fw/FPrimeBasicTypes.hpp> | ||
| 8 | #include <Ref/TypeDemo/TypeDemo.hpp> | ||
| 9 | #include <limits> | ||
| 10 | |||
| 11 | namespace Ref { | ||
| 12 | |||
| 13 | // ---------------------------------------------------------------------- | ||
| 14 | // Construction, initialization, and destruction | ||
| 15 | // ---------------------------------------------------------------------- | ||
| 16 | |||
| 17 | 1 | TypeDemo ::TypeDemo(const char* const compName) : TypeDemoComponentBase(compName) {} | |
| 18 | |||
| 19 | // ---------------------------------------------------------------------- | ||
| 20 | // Command handler implementations | ||
| 21 | // ---------------------------------------------------------------------- | ||
| 22 | |||
| 23 | ✗ | void TypeDemo ::CHOICE_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq, const Ref::Choice& choice) { | |
| 24 | ✗ | this->tlmWrite_ChoiceCh(choice); | |
| 25 | ✗ | this->log_ACTIVITY_HI_ChoiceEv(choice); | |
| 26 | ✗ | this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK); | |
| 27 | ✗ | } | |
| 28 | |||
| 29 | 1 | void TypeDemo ::CHOICES_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq, const Ref::ManyChoices& choices) { | |
| 30 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
|
1 | this->tlmWrite_ChoicesCh(choices); |
| 31 | 1 | this->log_ACTIVITY_HI_ChoicesEv(choices); | |
| 32 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
|
1 | this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK); |
| 33 | 1 | } | |
| 34 | |||
| 35 | ✗ | void TypeDemo ::CHOICES_WITH_FRIENDS_cmdHandler(const FwOpcodeType opCode, | |
| 36 | const U32 cmdSeq, | ||
| 37 | U8 repeat, | ||
| 38 | const Ref::ManyChoices& choices, | ||
| 39 | U8 repeat_max) { | ||
| 40 | ✗ | for (U32 i = 0; (i < repeat) && (i < std::numeric_limits<U8>::max()) && (i < repeat_max); i++) { | |
| 41 | ✗ | this->tlmWrite_ChoicesCh(choices); | |
| 42 | } | ||
| 43 | ✗ | this->log_ACTIVITY_HI_ChoicesEv(choices); | |
| 44 | ✗ | this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK); | |
| 45 | ✗ | } | |
| 46 | |||
| 47 | ✗ | void TypeDemo ::EXTRA_CHOICES_cmdHandler(const FwOpcodeType opCode, | |
| 48 | const U32 cmdSeq, | ||
| 49 | const Ref::TooManyChoices& choices) { | ||
| 50 | ✗ | this->tlmWrite_ExtraChoicesCh(choices); | |
| 51 | ✗ | this->log_ACTIVITY_HI_ExtraChoicesEv(choices); | |
| 52 | ✗ | this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK); | |
| 53 | ✗ | } | |
| 54 | |||
| 55 | ✗ | void TypeDemo ::EXTRA_CHOICES_WITH_FRIENDS_cmdHandler(const FwOpcodeType opCode, | |
| 56 | const U32 cmdSeq, | ||
| 57 | U8 repeat, | ||
| 58 | const Ref::TooManyChoices& choices, | ||
| 59 | U8 repeat_max) { | ||
| 60 | ✗ | for (U32 i = 0; (i < repeat) && (i < std::numeric_limits<U8>::max()) && (i < repeat_max); i++) { | |
| 61 | ✗ | this->tlmWrite_ExtraChoicesCh(choices); | |
| 62 | } | ||
| 63 | ✗ | this->log_ACTIVITY_HI_ExtraChoicesEv(choices); | |
| 64 | ✗ | this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK); | |
| 65 | ✗ | } | |
| 66 | |||
| 67 | 1 | void TypeDemo ::CHOICE_PAIR_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq, const Ref::ChoicePair& choices) { | |
| 68 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
|
1 | this->tlmWrite_ChoicePairCh(choices); |
| 69 | 1 | this->log_ACTIVITY_HI_ChoicePairEv(choices); | |
| 70 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
|
1 | this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK); |
| 71 | 1 | } | |
| 72 | |||
| 73 | ✗ | void TypeDemo ::CHOICE_PAIR_WITH_FRIENDS_cmdHandler(const FwOpcodeType opCode, | |
| 74 | const U32 cmdSeq, | ||
| 75 | U8 repeat, | ||
| 76 | const Ref::ChoicePair& choices, | ||
| 77 | U8 repeat_max) { | ||
| 78 | ✗ | for (U32 i = 0; (i < repeat) && (i < std::numeric_limits<U8>::max()) && (i < repeat_max); i++) { | |
| 79 | ✗ | this->tlmWrite_ChoicePairCh(choices); | |
| 80 | } | ||
| 81 | ✗ | this->log_ACTIVITY_HI_ChoicePairEv(choices); | |
| 82 | ✗ | this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK); | |
| 83 | ✗ | } | |
| 84 | |||
| 85 | 1 | void TypeDemo ::GLUTTON_OF_CHOICE_cmdHandler(const FwOpcodeType opCode, | |
| 86 | const U32 cmdSeq, | ||
| 87 | const Ref::ChoiceSlurry& choices) { | ||
| 88 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
|
1 | this->tlmWrite_ChoiceSlurryCh(choices); |
| 89 | 1 | this->log_ACTIVITY_HI_ChoiceSlurryEv(choices); | |
| 90 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
|
1 | this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK); |
| 91 | 1 | } | |
| 92 | |||
| 93 | ✗ | void TypeDemo ::GLUTTON_OF_CHOICE_WITH_FRIENDS_cmdHandler(const FwOpcodeType opCode, | |
| 94 | const U32 cmdSeq, | ||
| 95 | U8 repeat, | ||
| 96 | const Ref::ChoiceSlurry& choices, | ||
| 97 | U8 repeat_max) { | ||
| 98 | ✗ | for (U32 i = 0; (i < repeat) && (i < std::numeric_limits<U8>::max()) && (i < repeat_max); i++) { | |
| 99 | ✗ | this->tlmWrite_ChoiceSlurryCh(choices); | |
| 100 | } | ||
| 101 | ✗ | this->log_ACTIVITY_HI_ChoiceSlurryEv(choices); | |
| 102 | ✗ | this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK); | |
| 103 | ✗ | } | |
| 104 | |||
| 105 | ✗ | void TypeDemo ::DUMP_TYPED_PARAMETERS_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq) { | |
| 106 | ✗ | Fw::ParamValid validity; | |
| 107 | |||
| 108 | ✗ | Ref::Choice choice = this->paramGet_CHOICE_PRM(validity); | |
| 109 | ✗ | this->log_ACTIVITY_HI_ChoicePrmEv(choice, validity); | |
| 110 | |||
| 111 | ✗ | Ref::ManyChoices choices = this->paramGet_CHOICES_PRM(validity); | |
| 112 | ✗ | this->log_ACTIVITY_HI_ChoicesPrmEv(choices, validity); | |
| 113 | |||
| 114 | ✗ | Ref::TooManyChoices tooManyChoices = Ref::TooManyChoices(this->paramGet_EXTRA_CHOICES_PRM(validity)); | |
| 115 | ✗ | this->log_ACTIVITY_HI_ExtraChoicesPrmEv(tooManyChoices, validity); | |
| 116 | |||
| 117 | ✗ | Ref::ChoicePair choicePair = this->paramGet_CHOICE_PAIR_PRM(validity); | |
| 118 | ✗ | this->log_ACTIVITY_HI_ChoicePairPrmEv(choicePair, validity); | |
| 119 | |||
| 120 | ✗ | Ref::ChoiceSlurry choiceSlurry = this->paramGet_GLUTTON_OF_CHOICE_PRM(validity); | |
| 121 | ✗ | this->log_ACTIVITY_HI_ChoiceSlurryPrmEv(choiceSlurry, validity); | |
| 122 | |||
| 123 | ✗ | this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK); | |
| 124 | ✗ | } | |
| 125 | |||
| 126 | ✗ | void TypeDemo ::DUMP_FLOATS_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq) { | |
| 127 | ✗ | Ref::FloatSet invalid; | |
| 128 | ✗ | invalid[0] = std::numeric_limits<float>::infinity(); | |
| 129 | ✗ | invalid[1] = -1 * std::numeric_limits<float>::infinity(); | |
| 130 | ✗ | invalid[2] = (std::numeric_limits<float>::has_quiet_NaN) ? std::numeric_limits<float>::quiet_NaN() : 0.0f; | |
| 131 | ✗ | this->log_ACTIVITY_HI_FloatEv(invalid[0], invalid[1], invalid[2], invalid); | |
| 132 | ✗ | this->tlmWrite_Float1Ch(invalid[0]); | |
| 133 | ✗ | this->tlmWrite_Float2Ch(invalid[1]); | |
| 134 | ✗ | this->tlmWrite_Float3Ch(invalid[2]); | |
| 135 | ✗ | this->tlmWrite_FloatSet(invalid); | |
| 136 | ✗ | this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK); | |
| 137 | ✗ | } | |
| 138 | |||
| 139 | ✗ | void TypeDemo ::SEND_SCALARS_cmdHandler(const FwOpcodeType opCode, | |
| 140 | const U32 cmdSeq, | ||
| 141 | const Ref::ScalarStruct& scalar_input) { | ||
| 142 | ✗ | this->log_ACTIVITY_HI_ScalarStructEv(scalar_input); | |
| 143 | ✗ | this->tlmWrite_ScalarStructCh(scalar_input); | |
| 144 | ✗ | this->tlmWrite_ScalarU8Ch(scalar_input.get_u8()); | |
| 145 | ✗ | this->tlmWrite_ScalarU16Ch(scalar_input.get_u16()); | |
| 146 | ✗ | this->tlmWrite_ScalarU32Ch(scalar_input.get_u32()); | |
| 147 | ✗ | this->tlmWrite_ScalarU64Ch(scalar_input.get_u64()); | |
| 148 | ✗ | this->tlmWrite_ScalarI8Ch(scalar_input.get_i8()); | |
| 149 | ✗ | this->tlmWrite_ScalarI16Ch(scalar_input.get_i16()); | |
| 150 | ✗ | this->tlmWrite_ScalarI32Ch(scalar_input.get_i32()); | |
| 151 | ✗ | this->tlmWrite_ScalarI64Ch(scalar_input.get_i64()); | |
| 152 | ✗ | this->tlmWrite_ScalarF32Ch(scalar_input.get_f32()); | |
| 153 | ✗ | this->tlmWrite_ScalarF64Ch(scalar_input.get_f64()); | |
| 154 | ✗ | this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK); | |
| 155 | ✗ | } | |
| 156 | |||
| 157 | } // end namespace Ref | ||
| 158 |