- Add GeViScope Bridge (C# .NET 8.0) on port 7720 - Full SDK wrapper for camera control, PTZ, actions/events - 17 REST API endpoints for GeViScope server interaction - Support for MCS (Media Channel Simulator) with 16 test channels - Real-time action/event streaming via PLC callbacks - Add GeViServer Bridge (C# .NET 8.0) on port 7710 - Integration with GeViSoft orchestration layer - Input/output control and event management - Update Python API with new routers - /api/geviscope/* - Proxy to GeViScope Bridge - /api/geviserver/* - Proxy to GeViServer Bridge - /api/excel/* - Excel import functionality - Add Flutter app GeViScope integration - GeViScopeRemoteDataSource with 17 API methods - GeViScopeBloc for state management - GeViScopeScreen with PTZ controls - App drawer navigation to GeViScope - Add SDK documentation (extracted from PDFs) - GeViScope SDK docs (7 parts + action reference) - GeViSoft SDK docs (12 chunks) - Add .mcp.json for Claude Code MCP server config Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
231 lines
9.5 KiB
Plaintext
231 lines
9.5 KiB
Plaintext
|
||
================================================================================
|
||
PAGE 81
|
||
================================================================================
|
||
|
||
someform,e.g.applyingthesamefiltersettosubsequent queries. Tosignalthedatabase
|
||
enginethatyourqueriesareassociated, youpassauniquequeryhandlewiththem.The
|
||
queryhandleistheresultyoureceivefromaCDBQCreateActionQuery orCDBQCrea -
|
||
teAlarmQuery .Thereforethesequeriesarethefirstyousendwheninteracting withthedata-
|
||
base.
|
||
C++Example forgetting aquery handle:
|
||
//CreateanewActionQuery
|
||
CDataBaseQuery* geviquery =newCDBQCreateActionQuery (0);
|
||
//SendtheActionQuerytotheserver
|
||
CDataBaseAnswer* dbanswer =m_APIClient- >SendDatabaseQuery (geviquery, INFI-
|
||
NITE);
|
||
geviquery- >DeleteObject ();
|
||
if(dbanswer- >m_AnswerCode ==dbac_QueryHandle)
|
||
{
|
||
//Extract thequeryhandlefromtheanswer
|
||
CDBAQueryHandle* handle=reinterpret_ cast<CDBAQueryHandle*> (dbanswer);
|
||
}
|
||
|
||
================================================================================
|
||
PAGE 82
|
||
================================================================================
|
||
|
||
Iterating overDatabase Records
|
||
Youcansendagroupofassociated databasequeriesafterhavingobtainedthequeryhandle.
|
||
PleasenotethattheGeViSoftarchitecture alwaysreturnsonesingleanswerforeveryquery.
|
||
Asaconsequence, youmightneedtoissueseveraldatabasequeriesconsecutively toget
|
||
yourdesiredpiecesofinformation.
|
||
Thiscanbeillustrated byanexampledatabasequery.Imagineyouwanttoretrievethetwo
|
||
latestactionsinsidethedatabase:
|
||
Example: Retrieving ofthetwolatest actions inside thedata-
|
||
base
|
||
Pseudo code
|
||
1.CreateanewCDBQCreateActionQuery
|
||
2.SendthequerytoGeViServer andretrievethehandlefromtheanswer
|
||
3.CreateanewCDBQGetLast querywiththehandleastheargument
|
||
4.Sendthequeryandfetchthelatestactionasananswer
|
||
5.Extractthelatestaction’sprimarykeyfromtheanswer
|
||
6.CreateanewCDBQGetPrev querywiththehandleandthelatestaction’sprimarykeyas
|
||
anargument
|
||
7.Sendthequeryandfetchthesecondlatestactionasananswer
|
||
C++:
|
||
|
||
================================================================================
|
||
PAGE 83
|
||
================================================================================
|
||
|
||
//Declare aqueryhandle
|
||
CDBAQueryHandle* handle;
|
||
__int64primaryKey;
|
||
//CreateanewActionQuery
|
||
CDataBaseQuery* geviquery =newCDBQCreateActionQuery (0);
|
||
//SendtheActionQuerytotheserver
|
||
CDataBaseAnswer* dbanswer =m_APIClient- >SendDatabaseQuery (geviquery, INFI-
|
||
NITE);
|
||
geviquery- >DeleteObject ();
|
||
if(dbanswer- >m_AnswerCode ==dbac_QueryHandle)
|
||
{
|
||
//Extract thequeryhandefromtheanswer
|
||
handle=reinterpret_ cast<CDBAQueryHandle*> (dbanswer);
|
||
}
|
||
//Createadatabase queryforthelatestactionentry
|
||
CDataBaseQuery* getEntry =newCDBQGetLast (handle- >m_Handle);
|
||
//SendthequerytotheGeViServer
|
||
dbanswer =m_APIClient- >SendDatabaseQuery (getEntry, INFINITE);
|
||
getEntry- >DeleteObject ();
|
||
//Checkifanactionentryisinthedatabase
|
||
if(dbanswer- >m_AnswerCode ==dbac_ActionEntry)
|
||
{
|
||
//Dos.th.withtheanswerhere...
|
||
//Gettheprimary keywhichisusedto
|
||
//address therecords internally
|
||
primaryKey =reinterpret_ cast<CDBAActionEntry*> (dbanswer) ->m_PK;
|
||
}//TODO: Adderrorhandling ifnoactionisinthedatabase
|
||
//Create adatabase querytogetthesecondlatestactionentry
|
||
getEntry =newCDBQGetPrev (handle- >m_Handle, primaryKey);
|
||
//SendthequerytotheGeViServer
|
||
dbanswer =m_APIClient- >SendDatabaseQuery (getEntry, INFINITE);
|
||
getEntry- >DeleteObject ();
|
||
|
||
================================================================================
|
||
PAGE 84
|
||
================================================================================
|
||
|
||
//Checkifanactionentryisinthedatabase
|
||
if(dbanswer- >m_AnswerCode ==dbac_ActionEntry)
|
||
{
|
||
//Dos.th.withtheanswerhere...
|
||
}//TODO: Adderrorhandling ifnoactionisinthedatabase
|
||
dbanswer- >DeleteObject ();
|
||
|
||
================================================================================
|
||
PAGE 85
|
||
================================================================================
|
||
|
||
Filtering Database Queries
|
||
GeViSoftsupportsvariousfiltersallowingyoutospecifyyourqueriesinamorepreciseway.
|
||
Forexample,youcannarrowdownyoursearchtocertainactiontypesorsenders.Allthe
|
||
availablefiltersaredeclaredintheDatabaseQueries headerfile.
|
||
TosetthefilteringontheGeViServer, youhavetosendadatabasequeryforeveryfilterele-
|
||
mentafteryouhaveobtainedthequeryhandle.Youcanmonitortheprocessing ofthequeries
|
||
insidetheGeViAPITestClient.
|
||
Hereisascreenshot ofadatabasequerysequence whichsetsafilterfortheactiontype
|
||
nameCrossSwitch .Themessagesettingthefilterishighlighted. Thefilterhasbeendefined
|
||
intheDatabase FiltertaboftheGeViAPITestClient.Afterwards, thefetchoperationwas
|
||
startedfromtheDatabase Viewertab.
|
||
Composing Filtered Queries
|
||
Inthisparagraph youwilllearnhowtocomposesimplefiltersfirstandfinallyextenttheexam-
|
||
plefromabove(IteratingoverDatabase Records)withafilterthatwillonlyreturn
|
||
|
||
================================================================================
|
||
PAGE 86
|
||
================================================================================
|
||
|
||
CustomAction messages withcertainprimarykeys.
|
||
Prerequisite foratestonyoursystemisthatthereareCrossSwitch ,CustomAction ,andsev-
|
||
eralotheractiontypeentriesstoredinsideyourdatabase. Topopulateyourdatabasewith
|
||
these,youcansendthemwiththeGeViAPITestClient.DoingafetchintheDatabase Vie-
|
||
wer’staballowsyoutoverifythattheyarestoredcorrectlyafterwards.
|
||
Example Filters
|
||
ExampleforafilterthatwillonlyreturnCustomActions :
|
||
CDataBaseFilter* myActionNameFilter =
|
||
newCDBFTypeName (handle- >m_Handle, "CustomAction", dbc_LIKE);
|
||
Aftercreatingyourfilters,youcansendthemwithGeViAPIClients SendDatabaseQuery
|
||
method.
|
||
CDataBaseAnswer* dbanswer =
|
||
m_APIClient- >SendDatabaseQuery (myActionNameFilter, INFINITE);
|
||
Makesuretoverifythattheanswercodeisdbac_DBOkandtocalltheDeleteObject method
|
||
foryourfilteraftersendingit.
|
||
Composing complex filters:
|
||
Youcancomposeacomplexfilterbysendingasequence ofmultiplesinglefilterstothedata-
|
||
base.Thesefilterswillthenbetreatedasaconjunction (logicalAND)byGeViServer.
|
||
Hereisanexampleforacomplexfilterthatonlyreturnsactionswithprimarykeysbetween
|
||
500and600.Thisfilterhastobecomposed bysendingtwosimplefilterssequentially:
|
||
CDataBaseFilter* myMinFilter =
|
||
newCDBFPK_GrtEqu(handle- >m_Handle, 500);
|
||
|
||
================================================================================
|
||
PAGE 87
|
||
================================================================================
|
||
|
||
CDataBaseFilter* myMaxFilter =
|
||
newCDBFPK_LowEqu(handle- >m_Handle, 600);
|
||
Complete Example ofaFiltered Database Query
|
||
TheexampleIteratingoverDatabase RecordswillbeextendedtofilterforCustomActions with
|
||
aprimarykeybetween500and600inthisparagraph. Toachievethis,thefiltermessages
|
||
havetobesentdirectlyafterretrievingthedatabasehandle.Thefiltersarecreatedina
|
||
methodcalledsetActionFilter .Thismessageisthencalledafterobtainingthedatabase
|
||
handle.
|
||
Examplefilteringmethod:
|
||
voidsetActionFilter (CDBAQueryHandle* handle)
|
||
{
|
||
//Createavectorwithyourfiltermessages
|
||
std::vector<CDataBaseFilter*> filterList;
|
||
filterList.push_ back( newCDBFPK_GrtEqu(handle- >m_Handle, 500));
|
||
filterList.push_ back( newCDBFPK_LowEqu(handle- >m_Handle, 600));
|
||
filterList.push_ back( newCDBFTypeName (handle- >m_Handle,
|
||
"CustomAction", dbc_LIKE));
|
||
//Sendthefilters
|
||
for(vector<CDataBaseFilter*>::iterator it=
|
||
filterList.begin ();it!=filterList.end ();
|
||
it++)
|
||
{
|
||
CDataBaseAnswer* dbanswer =m_APIClient- >SendDatabaseQuery (*it,INFI-
|
||
NITE);
|
||
if(dbanswer- >m_AnswerCode !=dbac_DBOk)
|
||
{
|
||
//Doerrorhandling here!
|
||
(*it)->DeleteObject ();
|
||
return;
|
||
}
|
||
|
||
================================================================================
|
||
PAGE 88
|
||
================================================================================
|
||
|
||
(*it)->DeleteObject ();
|
||
}
|
||
}
|
||
Nowyoucancallthatmethodinyourexamplefromabove:
|
||
/*
|
||
...
|
||
*/
|
||
CDataBaseAnswer* dbanswer =m_APIClient- >SendDatabaseQuery (
|
||
geviquery, INFINITE);
|
||
geviquery- >DeleteObject ();
|
||
if(dbanswer- >m_AnswerCode ==dbac_QueryHandle)
|
||
{
|
||
//Extract thequeryhandefromtheanswer
|
||
handle=reinterpret_ cast<CDBAQueryHandle*> (dbanswer);
|
||
//SendFilterhere
|
||
setActionFilter (handle);
|
||
}
|
||
/*
|
||
...
|
||
*/
|
||
Asaresult,youshouldseethetwolatestCustomAction recordswithaprimarykeybetween
|
||
500and600.Ifyoudonotgetanyresults,youneedtoadoptthefilteringcriteriatomatchrec-
|
||
ordsinyourdatabase.
|
||
Database queries andfiltering isimplemented intheSDK’sexample Delphi/CPP_
|
||
SimpleDatabaseClient.
|
||
|
||
================================================================================
|
||
PAGE 89
|
||
================================================================================
|
||
|
||
C#and.Netspecifics
|
||
ThischapterdealswiththeGeViSoftSDKs.Netcapabilities andspecifics. Itdescribes the
|
||
architecture ofthewrappersandthespecificsoftheusage.
|
||
Architecture
|
||
TheGeViSoftSDKisdeliveredwitha.Net-Wrapper,allowingyoutodesignapplications in
|
||
C#orother.Netlanguages. TheGeutebrueck.GeViSoftSDKNET.Wrapper.dll encapsulates
|
||
allthenativeGeViProcAPI.dll calls.Additionally, theGscActionsNet.dll fromtheGeV-
|
||
iScopeSDK isneededtoallowforGeViScope interoperability. Thiswrapperencapsulates the
|
||
GscActions.dll whichitselfusestheGscDBI.dll.
|
||
|
||
================================================================================
|
||
PAGE 90
|
||
================================================================================
|
||
|
||
Diagram oftheGeViSoft .Netwrappers
|
||
Configuring yourIDEforGeViSoft .NetProjects
|
||
VisualStudio2008,C#
|
||
1.)Addthe.Netwrapperstoyourproject’sreferences.
|
||
(Youcandothisbyright-clickingonReferences inyourSolution Explorer.Afterpressing Add
|
||
Reference browsetoyour%GEVISOFTSDKPATH% andaddGeViProcAPINET_ 2_0.dll.Ifyou
|
||
plantouseGeViScope ActionsalsoaddGscActionsNET_ 2_0.dll. |