ProcessAlarms();
int SeekCount = 0;
+ int AlarmObjectCount = 0;
bool AlarmActionFound = false;
bool AlarmActionFound = false;
bool AlarmTriggerFound = false;
+ bool AlarmDurationFound = false;
DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount],
&EventAlarmData[SeekCount], false, "ACTION");
// Process the data from TRIGGER.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "TRIGGER");
+ DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], false, "TRIGGER");
if (DataReceived.begin() != DataReceived.end()){
}
NewAlarmData.TriggerData = DataReceived.begin()->second;
+ AlarmTriggerFound = true;
+
+ }
+
+ // Process data from DURATION.
+
+ DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], false, "DURATION");
+
+ if (DataReceived.begin() != DataReceived.end()){
+
+ try {
+ NewAlarmData.DurationTokens = DataReceived.begin()->first.substr(9);
+ }
+
+ catch(const out_of_range &oor){
+ // Do nothing as there is no data.
+ }
+
+ NewAlarmData.DurationData = DataReceived.begin()->second;
+ AlarmDurationFound = true;
+
+ }
+
+ // Process data from REPEAT.
+
+ DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], false, "REPEAT");
+
+ if (DataReceived.begin() != DataReceived.end() && AlarmDurationFound == true){
+
+ try {
+ NewAlarmData.RepeatTokens = DataReceived.begin()->first.substr(7);
+ }
+
+ catch(const out_of_range &oor){
+ // Do nothing as there is no data.
+ }
+
+ NewAlarmData.RepeatData = DataReceived.begin()->second;
+
+ } else {
+
+ NewAlarmData.DurationData.clear();
+ NewAlarmData.DurationTokens.clear();
+
+ }
+
+ // Process data from X-*
+
+ AlarmObjectCount = 0;
+
+ for(vector<string>::iterator xtokeniter = EventAlarmName[SeekCount].begin();
+ xtokeniter != EventAlarmName[SeekCount].end(); ++xtokeniter){
+
+ bool TokenData = false;
+ string PropertyTokens;
+
+ if (xtokeniter->substr(0,2) == "X-" &&
+ xtokeniter->size() > 2){
+
+ NewAlarmData.XTokensData.push_back(EventAlarmData[SeekCount][AlarmObjectCount]);
+ NewAlarmData.XTokensDataTokens.push_back(EventAlarmName[SeekCount][AlarmObjectCount]);
+
+ }
+
+ AlarmObjectCount++;
}
if (NewAlarmData.AlarmType == CALENDARALARM_AUDIO &&
- AlarmActionFound == true){
+ AlarmActionFound == true &&
+ AlarmTriggerFound == true){
CalendarAlarmData.push_back(NewAlarmData);