Files
geutebruck/GeViSoft_SDK_Docs/chunk_009_pages_81-90.txt
Administrator a92b909539 feat: GeViScope SDK integration with C# Bridge and Flutter app
- 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>
2026-01-19 08:14:17 +01:00

231 lines
9.5 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

================================================================================
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.Extractthelatestactionsprimarykeyfromtheanswer
6.CreateanewCDBQGetPrev querywiththehandleandthelatestactionsprimarykeyas
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-
werstaballowsyoutoverifythattheyarestoredcorrectlyafterwards.
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 intheSDKsexample 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.Netwrapperstoyourprojectsreferences.
(Youcandothisbyright-clickingonReferences inyourSolution Explorer.Afterpressing Add
Reference browsetoyour%GEVISOFTSDKPATH% andaddGeViProcAPINET_ 2_0.dll.Ifyou
plantouseGeViScope ActionsalsoaddGscActionsNET_ 2_0.dll.