subsystem update
This commit is contained in:
parent
3c316218f7
commit
7eeba71619
@ -1,10 +1,12 @@
|
|||||||
|
#include "Subsystem.h"
|
||||||
|
|
||||||
#include "../health/HealthMessage.h"
|
#include "../health/HealthMessage.h"
|
||||||
#include "../objectmanager/ObjectManagerIF.h"
|
#include "../objectmanager/ObjectManagerIF.h"
|
||||||
#include "../serialize/SerialArrayListAdapter.h"
|
#include "../serialize/SerialArrayListAdapter.h"
|
||||||
#include "../serialize/SerialFixedArrayListAdapter.h"
|
#include "../serialize/SerialFixedArrayListAdapter.h"
|
||||||
#include "../serialize/SerializeElement.h"
|
#include "../serialize/SerializeElement.h"
|
||||||
#include "../serialize/SerialLinkedListAdapter.h"
|
#include "../serialize/SerialLinkedListAdapter.h"
|
||||||
#include "Subsystem.h"
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
Subsystem::Subsystem(object_id_t setObjectId, object_id_t parent,
|
Subsystem::Subsystem(object_id_t setObjectId, object_id_t parent,
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
#include "../serviceinterface/ServiceInterfaceStream.h"
|
|
||||||
#include "../serviceinterface/ServiceInterfaceStream.h"
|
|
||||||
#include "SubsystemBase.h"
|
#include "SubsystemBase.h"
|
||||||
|
|
||||||
|
#include "../serviceinterface/ServiceInterfaceStream.h"
|
||||||
#include "../ipc/QueueFactory.h"
|
#include "../ipc/QueueFactory.h"
|
||||||
|
|
||||||
SubsystemBase::SubsystemBase(object_id_t setObjectId, object_id_t parent,
|
SubsystemBase::SubsystemBase(object_id_t setObjectId, object_id_t parent,
|
||||||
Mode_t initialMode, uint16_t commandQueueDepth) :
|
Mode_t initialMode, uint16_t commandQueueDepth) :
|
||||||
SystemObject(setObjectId), mode(initialMode), submode(SUBMODE_NONE), childrenChangedMode(
|
SystemObject(setObjectId), mode(initialMode), submode(SUBMODE_NONE),
|
||||||
false), commandsOutstanding(0), commandQueue(NULL), healthHelper(this,
|
childrenChangedMode(false), commandsOutstanding(0), commandQueue(NULL),
|
||||||
setObjectId), modeHelper(this), parentId(parent) {
|
healthHelper(this, setObjectId), modeHelper(this), parentId(parent) {
|
||||||
commandQueue = QueueFactory::instance()->createMessageQueue(commandQueueDepth,
|
commandQueue = QueueFactory::instance()->createMessageQueue(commandQueueDepth,
|
||||||
CommandMessage::MAX_MESSAGE_SIZE);
|
CommandMessage::MAX_MESSAGE_SIZE);
|
||||||
}
|
}
|
||||||
|
@ -1,22 +1,19 @@
|
|||||||
#ifndef MODEDEFINITIONS_H_
|
#ifndef FSFW_SUBSYSTEM_MODES_MODEDEFINITIONS_H_
|
||||||
#define MODEDEFINITIONS_H_
|
#define FSFW_SUBSYSTEM_MODES_MODEDEFINITIONS_H_
|
||||||
|
|
||||||
#include "../../modes/HasModesIF.h"
|
#include "../../modes/HasModesIF.h"
|
||||||
#include "../../objectmanager/SystemObjectIF.h"
|
#include "../../objectmanager/SystemObjectIF.h"
|
||||||
#include "../../serialize/SerializeIF.h"
|
#include "../../serialize/SerializeIF.h"
|
||||||
#include "../../serialize/SerialLinkedListAdapter.h"
|
#include "../../serialize/SerialLinkedListAdapter.h"
|
||||||
|
|
||||||
class ModeListEntry: public SerializeIF, public LinkedElement<ModeListEntry> {
|
class ModeListEntry: public SerializeIF, public LinkedElement<ModeListEntry> {
|
||||||
public:
|
public:
|
||||||
ModeListEntry() :
|
ModeListEntry(): LinkedElement<ModeListEntry>(this) {}
|
||||||
LinkedElement<ModeListEntry>(this), value1(0), value2(0), value3(0), value4(
|
|
||||||
0) {
|
|
||||||
|
|
||||||
}
|
uint32_t value1 = 0;
|
||||||
|
uint32_t value2 = 0;
|
||||||
uint32_t value1;
|
uint8_t value3 = 0;
|
||||||
uint32_t value2;
|
uint8_t value4 = 0;
|
||||||
uint8_t value3;
|
|
||||||
uint8_t value4;
|
|
||||||
|
|
||||||
virtual ReturnValue_t serialize(uint8_t** buffer, size_t* size,
|
virtual ReturnValue_t serialize(uint8_t** buffer, size_t* size,
|
||||||
size_t maxSize, Endianness streamEndianness) const {
|
size_t maxSize, Endianness streamEndianness) const {
|
||||||
@ -149,4 +146,4 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //MODEDEFINITIONS_H_
|
#endif /* FSFW_SUBSYSTEM_MODES_MODEDEFINITIONS_H_ */
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
#include "../../objectmanager/ObjectManagerIF.h"
|
#include "ModeSequenceMessage.h"
|
||||||
#include "../../objectmanager/ObjectManagerIF.h"
|
|
||||||
#include "../../objectmanager/ObjectManagerIF.h"
|
#include "../../objectmanager/ObjectManagerIF.h"
|
||||||
#include "../../storagemanager/StorageManagerIF.h"
|
#include "../../storagemanager/StorageManagerIF.h"
|
||||||
#include "ModeSequenceMessage.h"
|
|
||||||
|
|
||||||
void ModeSequenceMessage::setModeSequenceMessage(CommandMessage* message,
|
void ModeSequenceMessage::setModeSequenceMessage(CommandMessage* message,
|
||||||
Command_t command, Mode_t sequence, store_address_t storeAddress) {
|
Command_t command, Mode_t sequence, store_address_t storeAddress) {
|
||||||
@ -11,25 +10,12 @@ void ModeSequenceMessage::setModeSequenceMessage(CommandMessage* message,
|
|||||||
message->setParameter2(sequence);
|
message->setParameter2(sequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void ModeSequenceMessage::setModeSequenceMessage(CommandMessage* message,
|
|
||||||
// Command_t command, ModeTableId_t table, store_address_t storeAddress) {
|
|
||||||
// message->setCommand(command);
|
|
||||||
// message->setParameter(storeAddress.raw);
|
|
||||||
// message->setParameter2(table);
|
|
||||||
//}
|
|
||||||
|
|
||||||
void ModeSequenceMessage::setModeSequenceMessage(CommandMessage* message,
|
void ModeSequenceMessage::setModeSequenceMessage(CommandMessage* message,
|
||||||
Command_t command, Mode_t sequence) {
|
Command_t command, Mode_t sequence) {
|
||||||
message->setCommand(command);
|
message->setCommand(command);
|
||||||
message->setParameter2(sequence);
|
message->setParameter2(sequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void ModeSequenceMessage::setModeSequenceMessage(CommandMessage* message,
|
|
||||||
// Command_t command, ModeTableId_t table) {
|
|
||||||
// message->setCommand(command);
|
|
||||||
// message->setParameter2(table);
|
|
||||||
//}
|
|
||||||
|
|
||||||
void ModeSequenceMessage::setModeSequenceMessage(CommandMessage* message,
|
void ModeSequenceMessage::setModeSequenceMessage(CommandMessage* message,
|
||||||
Command_t command, store_address_t storeAddress) {
|
Command_t command, store_address_t storeAddress) {
|
||||||
message->setCommand(command);
|
message->setCommand(command);
|
||||||
@ -63,9 +49,10 @@ void ModeSequenceMessage::clear(CommandMessage *message) {
|
|||||||
case SEQUENCE_LIST:
|
case SEQUENCE_LIST:
|
||||||
case TABLE_LIST:
|
case TABLE_LIST:
|
||||||
case TABLE:
|
case TABLE:
|
||||||
case SEQUENCE:{
|
case SEQUENCE: {
|
||||||
StorageManagerIF *ipcStore = objectManager->get<StorageManagerIF>(objects::IPC_STORE);
|
StorageManagerIF *ipcStore = objectManager->get<StorageManagerIF>(
|
||||||
if (ipcStore != NULL){
|
objects::IPC_STORE);
|
||||||
|
if (ipcStore != nullptr){
|
||||||
ipcStore->deleteData(ModeSequenceMessage::getStoreAddress(message));
|
ipcStore->deleteData(ModeSequenceMessage::getStoreAddress(message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
#ifndef MODESEQUENCEMESSAGE_H_
|
#ifndef FSFW_SUBSYSTEM_MODES_MODESEQUENCEMESSAGE_H_
|
||||||
#define MODESEQUENCEMESSAGE_H_
|
#define FSFW_SUBSYSTEM_MODES_MODESEQUENCEMESSAGE_H_
|
||||||
|
|
||||||
|
#include "ModeDefinitions.h"
|
||||||
|
|
||||||
#include "../../ipc/CommandMessage.h"
|
#include "../../ipc/CommandMessage.h"
|
||||||
#include "../../storagemanager/StorageManagerIF.h"
|
#include "../../storagemanager/StorageManagerIF.h"
|
||||||
#include "ModeDefinitions.h"
|
|
||||||
|
|
||||||
class ModeSequenceMessage {
|
class ModeSequenceMessage {
|
||||||
public:
|
public:
|
||||||
@ -45,4 +47,4 @@ private:
|
|||||||
ModeSequenceMessage();
|
ModeSequenceMessage();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* MODESEQUENCEMESSAGE_H_ */
|
#endif /* FSFW_SUBSYSTEM_MODES_MODESEQUENCEMESSAGE_H_ */
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include "ModeStore.h"
|
#include "ModeStore.h"
|
||||||
|
|
||||||
#ifdef USE_MODESTORE
|
// todo: I think some parts are deprecated. If this is used, the define
|
||||||
|
// USE_MODESTORE could be part of the new FSFWConfig.h file.
|
||||||
|
#if FSFW_USE_MODESTORE == 1
|
||||||
|
|
||||||
ModeStore::ModeStore(object_id_t objectId, uint32_t slots) :
|
ModeStore::ModeStore(object_id_t objectId, uint32_t slots) :
|
||||||
SystemObject(objectId), store(slots), emptySlot(store.front()) {
|
SystemObject(objectId), store(slots), emptySlot(store.front()) {
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
#ifndef MODESTORE_H_
|
#ifndef MODESTORE_H_
|
||||||
#define MODESTORE_H_
|
#define MODESTORE_H_
|
||||||
|
|
||||||
#ifdef USE_MODESTORE
|
#include <FSFWConfig.h>
|
||||||
|
|
||||||
|
#if FSFW_USE_MODESTORE == 1
|
||||||
|
|
||||||
#include "../../container/ArrayList.h"
|
#include "../../container/ArrayList.h"
|
||||||
#include "../../container/SinglyLinkedList.h"
|
#include "../../container/SinglyLinkedList.h"
|
||||||
#include "../../objectmanager/SystemObject.h"
|
#include "../../objectmanager/SystemObject.h"
|
||||||
#include "ModeStoreIF.h"
|
#include "../../subsystem/modes/ModeStoreIF.h"
|
||||||
|
|
||||||
class ModeStore: public ModeStoreIF, public SystemObject {
|
class ModeStore: public ModeStoreIF, public SystemObject {
|
||||||
public:
|
public:
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
#ifndef MODESTOREIF_H_
|
#ifndef MODESTOREIF_H_
|
||||||
#define MODESTOREIF_H_
|
#define MODESTOREIF_H_
|
||||||
|
|
||||||
#ifdef USE_MODESTORE
|
#include <FSFWConfig.h>
|
||||||
|
|
||||||
|
#if FSFW_USE_MODESTORE == 1
|
||||||
|
|
||||||
#include "../../container/ArrayList.h"
|
#include "../../container/ArrayList.h"
|
||||||
#include "../../container/SinglyLinkedList.h"
|
#include "../../container/SinglyLinkedList.h"
|
||||||
#include "../../returnvalues/HasReturnvaluesIF.h"
|
#include "../../returnvalues/HasReturnvaluesIF.h"
|
||||||
#include "ModeDefinitions.h"
|
#include "../../subsystem/modes/ModeDefinitions.h"
|
||||||
|
|
||||||
class ModeStoreIF {
|
class ModeStoreIF {
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user