From 6f78e62580453bf519bfae88e20e9f22188db362 Mon Sep 17 00:00:00 2001
From: Dimitrios Stoupis <dimitris.apple@gmail.com>
Date: Tue, 12 Mar 2019 20:33:42 +0000
Subject: [PATCH] Added vector definitions and some constatns

- The vector header is included and the corresponding vector is defined
- Some definitions were added, as required by the standard, but a
further discussion for the final values is required
---
 .../TimeBasedCommandSchedulingService.hpp     | 36 ++++++++++++++-----
 1 file changed, 27 insertions(+), 9 deletions(-)

diff --git a/inc/Services/TimeBasedCommandSchedulingService.hpp b/inc/Services/TimeBasedCommandSchedulingService.hpp
index 933816a3..d5dceddd 100644
--- a/inc/Services/TimeBasedCommandSchedulingService.hpp
+++ b/inc/Services/TimeBasedCommandSchedulingService.hpp
@@ -2,17 +2,35 @@
 #define ECSS_SERVICES_TIMEBASEDCOMMANDSCHEDULINGSERVICE_HPP
 
 #include <iostream>
+#include <vector>
 #include "Service.hpp"
 #include "Helpers/CRCHelper.hpp"
 #include "ErrorHandler.hpp"
 
+// Define whether groups and/or sub-schedules are in use
+#define GROUPS_ENABLED          0
+#define SUB_SCHEDULES_ENABLED   0
+
+#define MAX_NUMBER_OF_ACTIVITIES    10 // todo: define the maximum number of activities
+#define TIME_MARGIN_FOR_ACTIVATION  60 // todo: define the time margin for the command activation
+
+
 class TimeBasedCommandSchedulingService : public Service {
 public:
 
 
-
 private:
+	bool executionFunctionStatus; // True indicates "enabled" and False "disabled" state
+	uint8_t currentNumberOfActivities = 0; // Keep track of the number of activities
 
+	// Hold the data for the scheduled activity definition
+	struct ScheduledActivity {
+		//Message request; // Hold the received command request
+		uint32_t requestReleaseTime = 0; // Keep the command release time
+		// todo: If we decide to use sub-schedules, the ID of that has to be defined
+		// todo: If groups are used, then the group ID has to be defined here
+	};
+	std::vector<ScheduledActivity> scheduledActivities; // Scheduled activity definitions
 
 
 public:
@@ -40,6 +58,14 @@ public:
 	 */
 	void resetSchedule(Message &request);
 
+	/**
+	 * TC[11,4] insert activities into the time based schedule
+	 *
+	 * @details Add activities into the schedule for future execution
+	 * @param request Provide the received message as a parameter
+	 */
+	void insertActivities(Message &request);
+
 	/**
 	 * TC[11,15] time-shift all scheduled activities
 	 *
@@ -57,14 +83,6 @@ public:
 	 */
 	void detailReportAllActivities(Message &request);
 
-	/**
-	 * TC[11,4] insert activities into the time based schedule
-	 *
-	 * @details Add activities into the schedule for future execution
-	 * @param request Provide the received message as a parameter
-	 */
-	void insertActivities(Message &request);
-
 	/**
 	 * TC[11,5] delete time-based scheduled activities identified by a request identifier
 	 *
-- 
GitLab