This plugin sample serachs for events in the current system. User defined filters are used for searching.
More...
#include <SearchEvents.h>
This plugin sample serachs for events in the current system. User defined filters are used for searching.
Definition at line 12 of file SearchEvents.h.
Inherits CppSamples::Common::Plugin.
CppSamples::Events::SearchEvents::SearchEvents |
( |
const std::string |
description | ) |
|
|
inline |
Definition at line 14 of file SearchEvents.h.
Plugin is the abstract class which can be a menu item and/or a sample. Every sample and menu item mus...
CppSamples::Events::SearchEvents::~SearchEvents |
( |
| ) |
|
|
inline |
void CppSamples::Events::SearchEvents::DoSearchEvents |
( |
VxSdk::IVxSystem * |
vxSystem | ) |
|
|
private |
Serachs for events in the current system. User defined filters are used for searching.
- Parameters
-
vxSystem | Pointer to the VideoExpert system. |
Definition at line 23 of file SearchEvents.cpp.
26 cout <<
"\n\n" <<
"Enter start time for event search (yyyy-mm-dd hh:mm:ss): ";
27 struct tm strtTime = Utility::GetDateAndTimeFromUser();
28 string startTimeInUTC = Utility::ConvertLocalTimetoUTC(strtTime);
31 cout <<
"\n" <<
"Enter end time for event search (yyyy-mm-dd hh:mm:ss): ";
32 struct tm endTime = Utility::GetDateAndTimeFromUser();
33 string endTimeInUTC = Utility::ConvertLocalTimetoUTC(endTime);
36 Utility::ClearScreen();
38 cout <<
"Fetching events from " << startTimeInUTC <<
" to " << endTimeInUTC <<
" (UTC).";
48 cout <<
"\n---------------------------------------------------------------------------------------------\n";
static void PrintEventHeadings()
Print the headings for a table of events.
static void PrintEventRow(VxSdk::IVxEvent *vxEvent)
Print the details of the given event in a line.
VxSdk::VxCollection< VxSdk::IVxEvent ** > Search(VxSdk::IVxSystem *vxSystem, std::string startTime, std::string endTime)
Search for events with the given parameters.
void CppSamples::Events::SearchEvents::PrintEventHeadings |
( |
| ) |
|
|
staticprivate |
Print the headings for a table of events.
Display the headings for a table of events
Definition at line 101 of file SearchEvents.cpp.
102 const int eventTimeWidth = 20;
103 const int eventStringWidth = 32;
104 cout <<
"\n---------------------------------------------------------------------------------------------\n";
105 cout << left << setw(eventTimeWidth) << setfill(
' ') <<
"Time(UTC)";
106 cout << left << setw(eventStringWidth) << setfill(
' ') <<
"Situation Type";
107 cout << left << setw(eventStringWidth) << setfill(
' ') <<
"Source Device";
108 cout <<
"\n---------------------------------------------------------------------------------------------\n";
void CppSamples::Events::SearchEvents::PrintEventRow |
( |
VxSdk::IVxEvent * |
vxEvent | ) |
|
|
staticprivate |
Print the details of the given event in a line.
Display a row of event details
- Parameters
-
vxEvent | Pointer to the event to display |
- Parameters
-
vxEvent | CPPConsole::Event pointer containing the event to display |
Definition at line 89 of file SearchEvents.cpp.
90 const int eventTimeWidth = 20;
91 const int eventStringWidth = 32;
92 cout << left << setw(eventTimeWidth) << setfill(
' ') << Utility::ConvertUTCTimeFormatToString(vxEvent->
time);
93 cout << left << setw(eventStringWidth) << setfill(
' ') << vxEvent->
situationType;
94 cout << left << setw(eventStringWidth) << setfill(
' ') << vxEvent->
sourceDeviceId;
Serachs for events in the current system. User defined filters are used for searching.
- Parameters
-
dataModel | Instance of data model. |
Implements CppSamples::Common::Plugin.
Definition at line 11 of file SearchEvents.cpp.
VxSdk::IVxSystem * VxSystem
Represents a VideoXpert system and allows the user to manage the system and devices.
void DoSearchEvents(VxSdk::IVxSystem *vxSystem)
Serachs for events in the current system. User defined filters are used for searching.
Plugin * GetParent() const
Gets the reference to the parent of this plugin.
Search for events with the given parameters.
- Parameters
-
vxSystem | Pointer to the VideoExpert system. |
startTime | Start time for event. |
endTime | End time for event. |
- Returns
- A collection of event.
Definition at line 57 of file SearchEvents.cpp.
63 filters[0].
key = VxCollectionFilterItem::kSearchStartTime;
64 filters[1].
key = VxCollectionFilterItem::kSearchEndTime;
65 Utilities::StrCopySafe(filters[0].value, startTime.c_str());
66 Utilities::StrCopySafe(filters[1].value, endTime.c_str());
71 if (result == VxResult::kInsufficientSize) {
79 cout <<
"Found " << events.
collectionSize <<
" events. There are too many to display, please narrow your search.";
VxCollectionFilterItem::Value key
virtual VxResult::Value GetEvents(VxCollection< IVxEvent ** > &eventCollection) const =0
VxCollectionFilter * filters
The documentation for this class was generated from the following files: