Creates a trigger and add it to a selected schedule in the current system.
19 optionSelector.
Heading =
"Select a schedule to add trigger";
22 string name = schedule->
id + string(
"\t") + schedule->
name;
23 optionSelector.
AddItem(name, schedule);
31 string newGuid = Utility::GetNewGuid();
32 Utilities::StrCopySafe(scheduleTrigger.
id, newGuid.c_str());
50 framerateSelector.
Heading =
"Select a type of frame rate";
51 framerateSelector.
AddItem(
"Log", VxRecordingFramerate::kLow);
52 framerateSelector.
AddItem(
"Normal", VxRecordingFramerate::kNormal);
54 scheduleTrigger.
framerate = VxRecordingFramerate::kUnknown;
59 eventSelector.
Heading =
"\nSelect a type of event";
60 eventSelector.AddItem(
"AlarmActive", VxSituationType::kAlarmActive);
61 eventSelector.AddItem(
"AlarmInactive", VxSituationType::kAlarmInactive);
62 eventSelector.AddItem(
"Motion", VxSituationType::kMotion);
63 eventSelector.AddItem(
"NoMotion", VxSituationType::kNoMotion);
64 if (!eventSelector.SelectOption(&scheduleTrigger.
event))
65 scheduleTrigger.
event = VxSituationType::kUnknown;
70 recurrenceSelector.
Heading =
"\nSelect a type of recurrence";
71 recurrenceSelector.AddItem(
"Daily", VxRecurrenceType::kDaily);
72 recurrenceSelector.AddItem(
"Monthly", VxRecurrenceType::kMonthly);
73 recurrenceSelector.AddItem(
"Weekly", VxRecurrenceType::kWeekly);
74 recurrenceSelector.AddItem(
"Yearly", VxRecurrenceType::kYearly);
75 if (!recurrenceSelector.SelectOption(&scheduleTrigger.
recurrence))
76 scheduleTrigger.
recurrence = VxRecurrenceType::kUnknown;
79 cout <<
"\n" <<
"Enter PreTrigger value : ";
80 scheduleTrigger.
preTrigger = Utility::ReadInt();
83 cout <<
"Enter PostTrigger value : ";
87 cout <<
"Enter Timeout Duration : ";
88 scheduleTrigger.
timeout = Utility::ReadInt();
92 if (result == VxResult::kOK)
93 cout <<
"\n" <<
"Schedule added succesfully.\n";
95 cout <<
"\n" <<
"Failed to add schedule.\n";
bool SelectOption(T *result)
Prints a collection of options and chose a user defined one.
static std::string ReadDate(std::string message)
Reads a date from user input in DD-MM-YY format.
VxSdk::IVxSystem * VxSystem
Represents a VideoXpert system and allows the user to manage the system and devices.
virtual VxResult::Value AddScheduleTrigger(VxNewScheduleTrigger &newTrigger) const =0
static void StrCopySafe(char(&dst)[dstSize], const char *src)
VxSdk::VxCollection< VxSdk::IVxSchedule ** > GetSchedules(VxSdk::IVxSystem *vxSystem)
Get a collection of schedules from the given VideoExpert system.
VxSituationType::Value event
VxRecurrenceType::Value recurrence
VxRecordingFramerate::Value framerate
Plugin * GetParent() const
Gets the reference to the parent of this plugin.
static std::string ReadTime(std::string message)
Reads a time from user input
void AddItem(std::string name, T item)
The given name and item will be added to the collection.
This helper class prints a collection of options and chose a user defined option. ...