this should compile
All checks were successful
fsfw/fsfw/pipeline/pr-development This commit looks good
All checks were successful
fsfw/fsfw/pipeline/pr-development This commit looks good
This commit is contained in:
parent
6f0362b956
commit
b32d1da421
@ -1,8 +1,8 @@
|
||||
#include "DummyPowerSwitcher.h"
|
||||
|
||||
DummyPowerSwitcher::DummyPowerSwitcher(size_t numberOfSwitches, size_t numberOfFuses, uint32_t switchDelayMs)
|
||||
: switcherList(numberOfSwitches), fuseList(numberOfFuses), switchDelayMs(switchDelayMs) {
|
||||
}
|
||||
DummyPowerSwitcher::DummyPowerSwitcher(size_t numberOfSwitches, size_t numberOfFuses,
|
||||
uint32_t switchDelayMs)
|
||||
: switcherList(numberOfSwitches), fuseList(numberOfFuses), switchDelayMs(switchDelayMs) {}
|
||||
|
||||
void DummyPowerSwitcher::setInitialSwitcherList(std::vector<ReturnValue_t> switcherList) {
|
||||
this->switcherList = switcherList;
|
||||
@ -20,7 +20,7 @@ ReturnValue_t DummyPowerSwitcher::sendSwitchCommand(power::Switch_t switchNr, Re
|
||||
}
|
||||
|
||||
ReturnValue_t DummyPowerSwitcher::sendFuseOnCommand(uint8_t fuseNr) {
|
||||
if(fuseNr < fuseList.capacity()) {
|
||||
if (fuseNr < fuseList.capacity()) {
|
||||
fuseList[fuseNr] = FUSE_ON;
|
||||
}
|
||||
return RETURN_FAILED;
|
||||
@ -33,10 +33,6 @@ ReturnValue_t DummyPowerSwitcher::getSwitchState(power::Switch_t switchNr) const
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
||||
ReturnValue_t DummyPowerSwitcher::getFuseState(uint8_t fuseNr) const {
|
||||
return RETURN_OK;
|
||||
}
|
||||
ReturnValue_t DummyPowerSwitcher::getFuseState(uint8_t fuseNr) const { return RETURN_OK; }
|
||||
|
||||
uint32_t DummyPowerSwitcher::getSwitchDelayMs(void) const {
|
||||
return 5000;
|
||||
}
|
||||
uint32_t DummyPowerSwitcher::getSwitchDelayMs(void) const { return 5000; }
|
||||
|
@ -1,14 +1,14 @@
|
||||
#ifndef FSFW_SRC_FSFW_POWER_DUMMYPOWERSWITCHER_H_
|
||||
#define FSFW_SRC_FSFW_POWER_DUMMYPOWERSWITCHER_H_
|
||||
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
|
||||
#include "PowerSwitchIF.h"
|
||||
#include "definitions.h"
|
||||
|
||||
#include <vector>
|
||||
#include <cstddef>
|
||||
|
||||
class DummyPowerSwitcher: public PowerSwitchIF {
|
||||
public:
|
||||
class DummyPowerSwitcher : public PowerSwitchIF {
|
||||
public:
|
||||
DummyPowerSwitcher(size_t numberOfSwitches, size_t numberOfFuses, uint32_t switchDelayMs = 5000);
|
||||
|
||||
void setInitialSwitcherList(std::vector<ReturnValue_t> switcherList);
|
||||
@ -20,12 +20,10 @@ public:
|
||||
virtual ReturnValue_t getFuseState(uint8_t fuseNr) const override;
|
||||
virtual uint32_t getSwitchDelayMs(void) const override;
|
||||
|
||||
private:
|
||||
private:
|
||||
std::vector<ReturnValue_t> switcherList;
|
||||
std::vector<ReturnValue_t> fuseList;
|
||||
uint32_t switchDelayMs = 5000;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /* FSFW_SRC_FSFW_POWER_DUMMYPOWERSWITCHER_H_ */
|
||||
|
@ -15,9 +15,8 @@ PowerSensor::PowerSensor(object_id_t objectId, sid_t setId, VariableIds ids, Def
|
||||
limits.currentMin, limits.currentMax, events.currentLow, events.currentHigh),
|
||||
voltageLimit(objectId, MODULE_ID_VOLTAGE, ids.pidVoltage, confirmationCount,
|
||||
limits.voltageMin, limits.voltageMax, events.voltageLow, events.voltageHigh) {
|
||||
auto mqArgs = MqArgs(objectId, static_cast<void*>(this));
|
||||
commandQueue = QueueFactory::instance()->createMessageQueue(
|
||||
3, MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs);
|
||||
commandQueue =
|
||||
QueueFactory::instance()->createMessageQueue(3, MessageQueueMessage::MAX_MESSAGE_SIZE);
|
||||
}
|
||||
|
||||
PowerSensor::~PowerSensor() { QueueFactory::instance()->deleteMessageQueue(commandQueue); }
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef FSFW_POWER_POWERSWITCHIF_H_
|
||||
#define FSFW_POWER_POWERSWITCHIF_H_
|
||||
|
||||
#include "definitions.h"
|
||||
#include "../events/Event.h"
|
||||
#include "../returnvalues/HasReturnvaluesIF.h"
|
||||
#include "definitions.h"
|
||||
/**
|
||||
*
|
||||
* @brief This interface defines a connection to a device that is capable of
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "definitions.h"
|
||||
#include "fsfw/power/PowerSwitcher.h"
|
||||
|
||||
#include "definitions.h"
|
||||
#include "fsfw/objectmanager/ObjectManager.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
|
||||
@ -46,8 +46,8 @@ void PowerSwitcher::commandSwitches(ReturnValue_t onOff) {
|
||||
}
|
||||
|
||||
void PowerSwitcher::turnOn(bool checkCurrentState) {
|
||||
if(checkCurrentState) {
|
||||
if(getStateOfSwitches() == PowerSwitchIF::SWITCH_ON) {
|
||||
if (checkCurrentState) {
|
||||
if (getStateOfSwitches() == PowerSwitchIF::SWITCH_ON) {
|
||||
state = SWITCH_IS_ON;
|
||||
return;
|
||||
}
|
||||
@ -57,8 +57,8 @@ void PowerSwitcher::turnOn(bool checkCurrentState) {
|
||||
}
|
||||
|
||||
void PowerSwitcher::turnOff(bool checkCurrentState) {
|
||||
if(checkCurrentState) {
|
||||
if(getStateOfSwitches() == PowerSwitchIF::SWITCH_OFF) {
|
||||
if (checkCurrentState) {
|
||||
if (getStateOfSwitches() == PowerSwitchIF::SWITCH_OFF) {
|
||||
state = SWITCH_IS_OFF;
|
||||
return;
|
||||
}
|
||||
@ -68,7 +68,7 @@ void PowerSwitcher::turnOff(bool checkCurrentState) {
|
||||
}
|
||||
|
||||
bool PowerSwitcher::active() {
|
||||
if(state == WAIT_OFF or state == WAIT_ON) {
|
||||
if (state == WAIT_OFF or state == WAIT_ON) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -8,6 +8,6 @@ namespace power {
|
||||
using Switch_t = uint8_t;
|
||||
static constexpr Switch_t NO_SWITCH = 0xFF;
|
||||
|
||||
}
|
||||
} // namespace power
|
||||
|
||||
#endif /* FSFW_SRC_FSFW_POWER_DEFINITIONS_H_ */
|
||||
|
@ -1,8 +1,9 @@
|
||||
#include "version.h"
|
||||
#include "fsfw/FSFWVersion.h"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "fsfw/FSFWVersion.h"
|
||||
|
||||
#ifdef major
|
||||
#undef major
|
||||
#endif
|
||||
|
@ -29,7 +29,7 @@ class Version {
|
||||
}
|
||||
|
||||
friend bool operator>(const Version& v1, const Version& v2) {
|
||||
return not (v1 < v2) and not (v1 == v2);
|
||||
return not(v1 < v2) and not(v1 == v2);
|
||||
}
|
||||
|
||||
friend bool operator<=(const Version& v1, const Version& v2) { return ((v1 == v2) or (v1 < v2)); }
|
||||
|
@ -17,15 +17,15 @@ TEST_CASE("Version API Tests", "[TestVersionAPI]") {
|
||||
fsfw::Version v1 = fsfw::Version(1, 1, 1);
|
||||
fsfw::Version v2 = fsfw::Version(1, 1, 1);
|
||||
REQUIRE(v1 == v2);
|
||||
REQUIRE(not (v1 < v2));
|
||||
REQUIRE(not (v1 > v2));
|
||||
REQUIRE(not(v1 < v2));
|
||||
REQUIRE(not(v1 > v2));
|
||||
REQUIRE(v1 <= v2);
|
||||
REQUIRE(v1 >= v2);
|
||||
v1.revision -= 1;
|
||||
REQUIRE(v1 != v2);
|
||||
REQUIRE(not (v1 == v2));
|
||||
REQUIRE(not (v1 > v2));
|
||||
REQUIRE(not (v1 >= v2));
|
||||
REQUIRE(not(v1 == v2));
|
||||
REQUIRE(not(v1 > v2));
|
||||
REQUIRE(not(v1 >= v2));
|
||||
REQUIRE(v1 < v2);
|
||||
REQUIRE(v1 <= v2);
|
||||
v1.revision += 1;
|
||||
@ -33,60 +33,60 @@ TEST_CASE("Version API Tests", "[TestVersionAPI]") {
|
||||
REQUIRE(v1 != v2);
|
||||
REQUIRE(v1 < v2);
|
||||
REQUIRE(v1 <= v2);
|
||||
REQUIRE(not (v1 == v2));
|
||||
REQUIRE(not (v1 > v2));
|
||||
REQUIRE(not (v1 >= v2));
|
||||
REQUIRE(not(v1 == v2));
|
||||
REQUIRE(not(v1 > v2));
|
||||
REQUIRE(not(v1 >= v2));
|
||||
v1.minor += 1;
|
||||
v1.major -= 1;
|
||||
REQUIRE(v1 != v2);
|
||||
REQUIRE(v1 < v2);
|
||||
REQUIRE(v1 <= v2);
|
||||
REQUIRE(not (v1 == v2));
|
||||
REQUIRE(not (v1 > v2));
|
||||
REQUIRE(not (v1 >= v2));
|
||||
REQUIRE(not(v1 == v2));
|
||||
REQUIRE(not(v1 > v2));
|
||||
REQUIRE(not(v1 >= v2));
|
||||
v1.major += 1;
|
||||
REQUIRE(v1 == v2);
|
||||
REQUIRE(v1 <= v2);
|
||||
REQUIRE(v1 >= v2);
|
||||
REQUIRE(not (v1 != v2));
|
||||
REQUIRE(not (v1 > v2));
|
||||
REQUIRE(not (v1 < v2));
|
||||
REQUIRE(not(v1 != v2));
|
||||
REQUIRE(not(v1 > v2));
|
||||
REQUIRE(not(v1 < v2));
|
||||
v1.major += 1;
|
||||
v1.minor -= 1;
|
||||
REQUIRE(v1 != v2);
|
||||
REQUIRE(v1 > v2);
|
||||
REQUIRE(v1 >= v2);
|
||||
REQUIRE(not (v1 == v2));
|
||||
REQUIRE(not (v1 < v2));
|
||||
REQUIRE(not (v1 <= v2));
|
||||
REQUIRE(not(v1 == v2));
|
||||
REQUIRE(not(v1 < v2));
|
||||
REQUIRE(not(v1 <= v2));
|
||||
v1.major -= 1;
|
||||
v1.minor += 2;
|
||||
v1.revision -= 1;
|
||||
REQUIRE(v1 != v2);
|
||||
REQUIRE(v1 > v2);
|
||||
REQUIRE(v1 >= v2);
|
||||
REQUIRE(not (v1 == v2));
|
||||
REQUIRE(not (v1 < v2));
|
||||
REQUIRE(not (v1 <= v2));
|
||||
REQUIRE(not(v1 == v2));
|
||||
REQUIRE(not(v1 < v2));
|
||||
REQUIRE(not(v1 <= v2));
|
||||
v1.minor -= 1;
|
||||
v1.revision += 2;
|
||||
REQUIRE(v1 != v2);
|
||||
REQUIRE(v1 > v2);
|
||||
REQUIRE(v1 >= v2);
|
||||
REQUIRE(not (v1 == v2));
|
||||
REQUIRE(not (v1 < v2));
|
||||
REQUIRE(not (v1 <= v2));
|
||||
REQUIRE(not(v1 == v2));
|
||||
REQUIRE(not(v1 < v2));
|
||||
REQUIRE(not(v1 <= v2));
|
||||
v1.revision -= 1;
|
||||
REQUIRE(v1 == v2);
|
||||
REQUIRE(v1 <= v2);
|
||||
REQUIRE(v1 >= v2);
|
||||
REQUIRE(not (v1 != v2));
|
||||
REQUIRE(not(v1 != v2));
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "v" << fsfw::FSFW_VERSION << std::endl;
|
||||
#endif
|
||||
char verString[10] = {};
|
||||
fsfw::FSFW_VERSION.getVersion(verString, sizeof(verString));
|
||||
#if FSFW_DISABLE_PRINTOUT == 0
|
||||
printf("v%s\n",verString);
|
||||
printf("v%s\n", verString);
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user