This plugin sample creates a new event and insert it into the system.
More...
#include <InjectEvents.h>
This plugin sample creates a new event and insert it into the system.
Definition at line 12 of file InjectEvents.h.
Inherits CppSamples::Common::Plugin.
CppSamples::Events::InjectEvents::InjectEvents |
( |
const std::string |
description | ) |
|
|
inline |
Definition at line 14 of file InjectEvents.h.
Plugin is the abstract class which can be a menu item and/or a sample. Every sample and menu item mus...
CppSamples::Events::InjectEvents::~InjectEvents |
( |
| ) |
|
|
inline |
Print the given collection of situations on screen
Method for displaying situation details
- Parameters
-
situations | Collection of Situations to be printed. |
- Parameters
-
situations | Situations list to iterate |
Definition at line 93 of file InjectEvents.cpp.
99 cout << setfill(
' ') <<
" INDEX " << setw(60) << left <<
" TYPE" <<
"\n";
100 cout <<
"\n--------------------------------------------------\n";
105 cout << setfill(
' ') <<
"\n\t" << index + 1 <<
"\t" << left << setw(60) << left << situation->
type;
108 cout <<
"\n--------------------------------------------------\n";
111 cout <<
"No situations found!!\n";
Get a collection of situations from the given VideoExpert system.
- Parameters
-
vxSystem | Pointer to the VideoExpert system. |
- Returns
- A collection of situations.
Definition at line 74 of file InjectEvents.cpp.
79 if (result == VxResult::kInsufficientSize) {
virtual VxResult::Value GetSituations(VxCollection< IVxSituation ** > &situationCollection) const =0
Creates a new event and insert it into the system.
Menu function for deleting situation from server
- Parameters
-
vxSystem | Pointer to the VideoExpert system. |
- Parameters
-
Definition at line 25 of file InjectEvents.cpp.
28 cout <<
"\n\n" <<
"Fetching situations from system..Please wait..\n";
33 cout <<
"\n" <<
"Enter the id of the situation to be associated with the event [1-" << situations.
collectionSize <<
"] : ";
34 int situationId = Utility::ReadInt();
37 cout <<
"\n" <<
"Invalid option is given.";
43 cout <<
"\n" <<
"Situation selected to insert is:" << situation->
type <<
"\n";
46 cout <<
"\n" <<
"Enter generator device id: ";
47 string generatorDeviceId = Utility::ReadString();
50 cout <<
"\n" <<
"Enter source device id: ";
51 string sourceDeviceId = Utility::ReadString();
54 cout <<
"\n" <<
"Enter event time(yyyy-mm-dd hh:mm:ss): ";
55 struct tm strtTime = Utility::GetDateAndTimeFromUser();
56 string startTimeInUTC = Utility::ConvertLocalTimetoUTC(strtTime);
62 Utilities::StrCopySafe(newEvent.
sourceDeviceId, sourceDeviceId.c_str());
63 Utilities::StrCopySafe(newEvent.
time, startTimeInUTC.c_str());
67 if (result == VxResult::kOK)
68 cout <<
"\n" <<
"Succesfully injected new event.\n";
70 cout <<
"\n" <<
"Failed to inject event.\n";
char generatorDeviceId[64]
VxSdk::VxCollection< VxSdk::IVxSituation ** > GetSituations(VxSdk::IVxSystem *vxSystem)
Get a collection of situations from the given VideoExpert system.
virtual VxResult::Value InsertEvent(VxNewEvent &newEvent) const =0
void DisplaySituationDetailsOnScreen(VxSdk::VxCollection< VxSdk::IVxSituation ** > situations)
Print the given collection of situations on screen
Creates a new event and insert it into the system.
- Parameters
-
dataModel | Instance of data model. |
Implements CppSamples::Common::Plugin.
Definition at line 10 of file InjectEvents.cpp.
VxSdk::IVxSystem * VxSystem
Represents a VideoXpert system and allows the user to manage the system and devices.
Plugin * GetParent() const
Gets the reference to the parent of this plugin.
void Inject(VxSdk::IVxSystem *vxSystem)
Creates a new event and insert it into the system.
The documentation for this class was generated from the following files: