-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
524 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,16 @@ | ||
#pragma once | ||
|
||
|
||
#include <Sts1CobcSw/Edu/Types.hpp> | ||
#include <Sts1CobcSw/FramSections/FramLayout.hpp> | ||
#include <Sts1CobcSw/FramSections/FramVector.hpp> | ||
#include <Sts1CobcSw/FramSections/Subsections.hpp> | ||
#include <Sts1CobcSw/ProgramId/ProgramId.hpp> | ||
#include <Sts1CobcSw/Serial/Serial.hpp> | ||
#include <Sts1CobcSw/Utility/TimeTypes.hpp> | ||
|
||
#include <bit> | ||
#include <cstddef> | ||
#include <cstdint> | ||
|
||
|
||
namespace sts1cobcsw | ||
{ | ||
namespace edu | ||
{ | ||
struct ProgramQueueEntry | ||
{ | ||
ProgramId programId = ProgramId(0); | ||
RealTime startTime = RealTime(0); | ||
std::int16_t timeout = 0; | ||
}; | ||
} | ||
|
||
|
||
template<> | ||
inline constexpr std::size_t serialSize<edu::ProgramQueueEntry> = | ||
totalSerialSize<decltype(edu::ProgramQueueEntry::programId), | ||
decltype(edu::ProgramQueueEntry::startTime), | ||
decltype(edu::ProgramQueueEntry::timeout)>; | ||
|
||
|
||
namespace edu | ||
namespace sts1cobcsw::edu | ||
{ | ||
inline constexpr auto nCachedProgramQueueEntries = 10; | ||
extern FramVector<ProgramQueueEntry, | ||
framSections.template Get<"eduProgramQueue">(), | ||
nCachedProgramQueueEntries> | ||
programQueue; | ||
|
||
|
||
template<std::endian endianness> | ||
[[nodiscard]] auto DeserializeFrom(void const * source, ProgramQueueEntry * data) -> void const *; | ||
template<std::endian endianness> | ||
[[nodiscard]] auto SerializeTo(void * destination, ProgramQueueEntry const & data) -> void *; | ||
} | ||
inline constexpr auto programQueue = FramVector<ProgramQueueEntry, | ||
framSections.template Get<"eduProgramQueue">(), | ||
nCachedProgramQueueEntries>{}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,23 @@ | ||
#pragma once | ||
|
||
|
||
#include <Sts1CobcSw/Edu/Types.hpp> | ||
#include <Sts1CobcSw/FramSections/FramLayout.hpp> | ||
#include <Sts1CobcSw/FramSections/FramRingArray.hpp> | ||
#include <Sts1CobcSw/FramSections/Subsections.hpp> | ||
#include <Sts1CobcSw/ProgramId/ProgramId.hpp> | ||
#include <Sts1CobcSw/Serial/Serial.hpp> | ||
#include <Sts1CobcSw/Utility/TimeTypes.hpp> | ||
|
||
#include <bit> | ||
#include <cstddef> | ||
#include <cstdint> | ||
|
||
|
||
namespace sts1cobcsw | ||
{ | ||
namespace edu | ||
{ | ||
enum class ProgramStatus : std::uint8_t | ||
{ | ||
programRunning, | ||
programCouldNotBeStarted, | ||
programExecutionFailed, | ||
programExecutionSucceeded, | ||
resultFileTransfered, | ||
resultFileSentToRf, | ||
ackFromGround, | ||
resultFileDeleted | ||
}; | ||
|
||
|
||
struct ProgramStatusHistoryEntry | ||
{ | ||
ProgramId programId = ProgramId(0); | ||
RealTime startTime = RealTime(0); | ||
ProgramStatus status = ProgramStatus::programRunning; | ||
}; | ||
} | ||
|
||
|
||
template<> | ||
inline constexpr std::size_t serialSize<edu::ProgramStatusHistoryEntry> = | ||
totalSerialSize<decltype(edu::ProgramStatusHistoryEntry::programId), | ||
decltype(edu::ProgramStatusHistoryEntry::startTime), | ||
decltype(edu::ProgramStatusHistoryEntry::status)>; | ||
|
||
|
||
namespace edu | ||
namespace sts1cobcsw::edu | ||
{ | ||
inline constexpr auto nCachedProgramStatusHistoryEntries = 10; | ||
extern FramRingArray<ProgramStatusHistoryEntry, | ||
framSections.template Get<"eduProgramStatusHistory">(), | ||
nCachedProgramStatusHistoryEntries> | ||
programStatusHistory; | ||
inline constexpr auto programStatusHistory = | ||
FramRingArray<ProgramStatusHistoryEntry, | ||
framSections.template Get<"eduProgramStatusHistory">(), | ||
nCachedProgramStatusHistoryEntries>{}; | ||
|
||
|
||
auto UpdateProgramStatusHistory(ProgramId programId, RealTime startTime, ProgramStatus newStatus) | ||
-> void; | ||
|
||
template<std::endian endianness> | ||
[[nodiscard]] auto DeserializeFrom(void const * source, ProgramStatusHistoryEntry * data) | ||
-> void const *; | ||
template<std::endian endianness> | ||
[[nodiscard]] auto SerializeTo(void * destination, ProgramStatusHistoryEntry const & data) | ||
-> void *; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.