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>
This commit is contained in:
746
GeViSoft_Flutter_Implementation_Status.md
Normal file
746
GeViSoft_Flutter_Implementation_Status.md
Normal file
@@ -0,0 +1,746 @@
|
||||
# GeViSoft SDK vs Flutter App - Implementation Status & Test Plan
|
||||
|
||||
**Analysis Date:** 2026-01-12
|
||||
**SDK Documentation Version:** 2012_1.7
|
||||
**Flutter App:** geutebruck_app
|
||||
|
||||
---
|
||||
|
||||
## Executive Summary
|
||||
|
||||
The Flutter application implements **action mapping configuration** for GeViSoft integration but does **not yet execute real-time operations**. It provides a management interface for creating, storing, and syncing action mappings between input events and output actions, but lacks the live connection layer to GeViServer for actual command execution.
|
||||
|
||||
### Coverage Summary
|
||||
|
||||
| Category | SDK Functions | Flutter Status | Gap |
|
||||
|----------|---------------|----------------|-----|
|
||||
| **Connection Management** | 5 functions | ❌ Not Implemented | Critical Gap |
|
||||
| **Action Mappings (Config)** | N/A | ✅ Fully Implemented | Exceeds SDK |
|
||||
| **Action Execution (Runtime)** | 20+ actions | ❌ Not Implemented | Critical Gap |
|
||||
| **Video Control** | 8 functions | ❌ Not Implemented | High Priority |
|
||||
| **Digital I/O** | 5 functions | ❌ Not Implemented | High Priority |
|
||||
| **State Queries** | 10+ queries | ❌ Not Implemented | High Priority |
|
||||
| **Database Queries** | 8 functions | ❌ Not Implemented | Medium Priority |
|
||||
| **Event Management** | 6 functions | 🟡 Partial (config only) | Medium Priority |
|
||||
| **Alarm Handling** | 6 functions | 🟡 Partial (config only) | Medium Priority |
|
||||
| **Timer Control** | 2 functions | ❌ Not Implemented | Medium Priority |
|
||||
| **GeViScope Integration** | 4 functions | 🟡 Partial (config only) | Medium Priority |
|
||||
| **Message Parsing** | 3 methods | ❌ Not Implemented | Low Priority |
|
||||
| **Callback Handling** | 4 patterns | ❌ Not Implemented | Low Priority |
|
||||
|
||||
**Legend:**
|
||||
- ✅ Fully Implemented
|
||||
- 🟡 Partially Implemented (configuration only, no execution)
|
||||
- ❌ Not Implemented
|
||||
|
||||
---
|
||||
|
||||
## Detailed Feature Mapping
|
||||
|
||||
### 1. CONNECTION MANAGEMENT
|
||||
|
||||
#### SDK Functions (GeViProcAPI / GeViAPIClient)
|
||||
|
||||
| Function | SDK Location | Flutter Status | Notes |
|
||||
|----------|--------------|----------------|-------|
|
||||
| `GeViAPI_Database_Connect()` | Chunks 6-7, Pages 51-70 | ❌ **Missing** | Critical - no GeViServer connection |
|
||||
| `GeViAPI_Database_Disconnect()` | Chunk 8, Pages 71-80 | ❌ **Missing** | No disconnect logic |
|
||||
| `GeViAPI_Database_Ping()` | Chunk 7, Pages 61-70 | ❌ **Missing** | No connection monitoring |
|
||||
| Connection Monitoring Thread | Chunk 7, Pages 61-70 | ❌ **Missing** | No auto-reconnect |
|
||||
| Password Encryption | Chunk 7, Pages 61-70 | ❌ **Missing** | Token auth only (different system) |
|
||||
|
||||
#### Flutter Implementation
|
||||
|
||||
**What Exists:**
|
||||
- ✅ HTTP client with Bearer token authentication (`DioClient`)
|
||||
- ✅ Token storage and refresh logic (`TokenManager`, `SecureStorageManager`)
|
||||
- ✅ Authentication BLoC for login/logout
|
||||
- ✅ Server configuration storage (host, port, alias)
|
||||
|
||||
**What's Missing:**
|
||||
- ❌ Direct GeViProcAPI.dll integration
|
||||
- ❌ GeViServer socket/COM connection
|
||||
- ❌ Database handle management
|
||||
- ❌ Ping-based health checks
|
||||
- ❌ Auto-reconnection on network loss
|
||||
|
||||
**Impact:** **CRITICAL** - Cannot execute any real-time GeViSoft operations
|
||||
|
||||
---
|
||||
|
||||
### 2. ACTION EXECUTION (Runtime)
|
||||
|
||||
#### SDK Actions
|
||||
|
||||
| Action | SDK Location | Flutter Status | Notes |
|
||||
|--------|--------------|----------------|-------|
|
||||
| **Video Control** ||||
|
||||
| `CrossSwitch(input, output, mode)` | Chunks 2-3, Pages 11-30 | ❌ **Missing** | No video routing |
|
||||
| `ClearOutput(output)` | Chunk 3, Pages 21-30 | ❌ **Missing** | No output clearing |
|
||||
| Video matrix operations | Multiple chunks | ❌ **Missing** | No matrix control |
|
||||
| **Digital I/O** ||||
|
||||
| `CloseContact(contactID)` | Chunks 3-4, Pages 21-40 | ❌ **Missing** | No I/O control |
|
||||
| `OpenContact(contactID)` | Chunks 3-4, Pages 21-40 | ❌ **Missing** | No I/O control |
|
||||
| `InputContact(contactID, state)` | Chunks 4-5, Pages 31-50 | ❌ **Missing** | No input monitoring |
|
||||
| **Timer Control** ||||
|
||||
| `StartTimer(timerID, name)` | Chunk 4, Pages 31-40 | ❌ **Missing** | No timer execution |
|
||||
| `StopTimer(timerID, name)` | Chunk 4, Pages 31-40 | ❌ **Missing** | No timer control |
|
||||
| **Event Control** ||||
|
||||
| Event start/stop/kill | Chunks 4-5, Pages 31-50 | ❌ **Missing** | No event execution |
|
||||
| Event retriggering | Chunk 4, Pages 31-40 | ❌ **Missing** | No live events |
|
||||
| **Alarm Control** ||||
|
||||
| Alarm start/acknowledge/quit | Chunk 5, Pages 41-50 | ❌ **Missing** | No alarm execution |
|
||||
| **GeViScope Actions** ||||
|
||||
| `GscAct_CustomAction` | Chunks 8, 10, Pages 71-100 | ❌ **Missing** | No GSC communication |
|
||||
| GeViScope message passing | Chunks 8, 10, Pages 71-100 | ❌ **Missing** | No GSC bridge |
|
||||
|
||||
#### Flutter Implementation
|
||||
|
||||
**What Exists:**
|
||||
- ✅ Action mapping data models (`ActionMapping`, `ActionOutput`)
|
||||
- ✅ Action template catalog (action names + parameters)
|
||||
- ✅ Action parameter configuration UI
|
||||
- ✅ Storage of action mappings (what should happen)
|
||||
- ✅ Input/output action pairing
|
||||
|
||||
**What's Missing:**
|
||||
- ❌ `SendMessage()` / `SendAction()` methods
|
||||
- ❌ Binary message construction
|
||||
- ❌ ASCII to binary conversion
|
||||
- ❌ Message sending to GeViServer
|
||||
- ❌ Action execution engine
|
||||
- ❌ Event-driven action triggering
|
||||
|
||||
**Impact:** **CRITICAL** - App is configuration-only, no live control
|
||||
|
||||
---
|
||||
|
||||
### 3. STATE QUERIES
|
||||
|
||||
#### SDK Queries
|
||||
|
||||
| Query | SDK Location | Flutter Status | Notes |
|
||||
|-------|--------------|----------------|-------|
|
||||
| `CSQGetFirstVideoInput` | Chunk 8, Pages 71-80 | ❌ **Missing** | No video input enumeration |
|
||||
| `CSQGetNextVideoInput` | Chunk 8, Pages 71-80 | ❌ **Missing** | No iteration |
|
||||
| `CSQGetFirstVideoOutput` | Referenced | ❌ **Missing** | No output enumeration |
|
||||
| `CSQGetNextVideoOutput` | Referenced | ❌ **Missing** | No iteration |
|
||||
| Digital I/O enumeration | Referenced | ❌ **Missing** | No contact listing |
|
||||
| Timer state queries | Referenced | ❌ **Missing** | No timer info |
|
||||
| Event state queries | Referenced | ❌ **Missing** | No event status |
|
||||
| Alarm state queries | Referenced | ❌ **Missing** | No alarm status |
|
||||
| `SendStateQuery(query, timeout)` | Chunk 8, Pages 71-80 | ❌ **Missing** | No query mechanism |
|
||||
| `CStateAnswer` processing | Chunk 8, Pages 71-80 | ❌ **Missing** | No answer handling |
|
||||
|
||||
#### Flutter Implementation
|
||||
|
||||
**What Exists:**
|
||||
- ✅ HTTP GET endpoints for server lists
|
||||
- ✅ Action template catalog fetching
|
||||
- ✅ Server cache for offline access
|
||||
|
||||
**What's Missing:**
|
||||
- ❌ Real-time state query infrastructure
|
||||
- ❌ `SendQuery()` method
|
||||
- ❌ Query timeout handling (`INFINITE`, custom ms)
|
||||
- ❌ Answer parsing and iteration
|
||||
- ❌ Channel enumeration loops
|
||||
- ❌ Live system state monitoring
|
||||
|
||||
**Impact:** **HIGH** - Cannot discover or monitor GeViSoft resources
|
||||
|
||||
---
|
||||
|
||||
### 4. DATABASE QUERIES
|
||||
|
||||
#### SDK Query Functions
|
||||
|
||||
| Function | SDK Location | Flutter Status | Notes |
|
||||
|----------|--------------|----------------|-------|
|
||||
| `CDBQCreateActionQuery` | Chunk 9, Pages 81-90 | ❌ **Missing** | No DB query handle |
|
||||
| `CDBQGetLast` | Chunk 9, Pages 81-90 | ❌ **Missing** | No record fetching |
|
||||
| `CDBQGetNext` / `GetPrev` | Chunk 9, Pages 81-90 | ❌ **Missing** | No navigation |
|
||||
| `CDBQGetFirst` | Referenced | ❌ **Missing** | No first record |
|
||||
| **Filtering** ||||
|
||||
| `CDBFTypeName` (action type) | Chunk 9, Pages 81-90 | ❌ **Missing** | No type filtering |
|
||||
| `CDBFPK_GrtEqu` (PK >=) | Chunk 9, Pages 81-90 | ❌ **Missing** | No range filtering |
|
||||
| `CDBFPK_LowEqu` (PK <=) | Chunk 9, Pages 81-90 | ❌ **Missing** | No range filtering |
|
||||
| Multi-filter composition | Chunk 9, Pages 81-90 | ❌ **Missing** | No complex queries |
|
||||
|
||||
#### Flutter Implementation
|
||||
|
||||
**What Exists:**
|
||||
- ✅ REST API endpoints for action mappings
|
||||
- ✅ Search functionality (by name/description)
|
||||
- ✅ Local Hive filtering (`where`, `filter`)
|
||||
- ✅ Sort by date/name
|
||||
|
||||
**What's Missing:**
|
||||
- ❌ GeViSoft database connection
|
||||
- ❌ Historical action log access
|
||||
- ❌ Query handle management
|
||||
- ❌ Ring buffer navigation
|
||||
- ❌ Primary key based filtering
|
||||
- ❌ Action type filtering
|
||||
- ❌ Time-range queries
|
||||
|
||||
**Impact:** **MEDIUM** - Cannot access historical GeViSoft data
|
||||
|
||||
---
|
||||
|
||||
### 5. MESSAGE HANDLING
|
||||
|
||||
#### SDK Message Methods
|
||||
|
||||
| Method | SDK Location | Flutter Status | Notes |
|
||||
|--------|--------------|----------------|-------|
|
||||
| **Creation** ||||
|
||||
| Direct constructor (`new CActCrossSwitch(...)`) | Chunk 7, Pages 61-70 | ❌ **Missing** | No message construction |
|
||||
| `ReadASCIIMessage(string)` | Chunk 7, Pages 61-70 | ❌ **Missing** | No ASCII parsing |
|
||||
| `ReadBinMessage(buffer)` | Chunk 8, Pages 71-80 | ❌ **Missing** | No binary parsing |
|
||||
| **Conversion** ||||
|
||||
| Binary to ASCII | Chunk 7, Pages 61-70 | ❌ **Missing** | No format conversion |
|
||||
| ASCII to Binary | Chunk 7, Pages 61-70 | ❌ **Missing** | No serialization |
|
||||
| **Sending** ||||
|
||||
| `SendMessage(message)` | Chunks 8, 10, Pages 71-100 | ❌ **Missing** | No send method |
|
||||
| `SendAction(action)` (C#) | Chunk 10, Pages 91-100 | ❌ **Missing** | No action dispatch |
|
||||
| String-based sending | Chunk 10, Pages 91-100 | ❌ **Missing** | No shorthand |
|
||||
|
||||
#### Flutter Implementation
|
||||
|
||||
**What Exists:**
|
||||
- ✅ JSON serialization (`toJson`, `fromJson`)
|
||||
- ✅ HTTP request/response handling
|
||||
- ✅ Snake_case ↔ camelCase conversion
|
||||
- ✅ Data model classes
|
||||
|
||||
**What's Missing:**
|
||||
- ❌ `CGeViMessage` class equivalent
|
||||
- ❌ ASCII message format parsing
|
||||
- ❌ Binary protocol support
|
||||
- ❌ Message type registry
|
||||
- ❌ Action constructors
|
||||
- ❌ Parameter validation
|
||||
|
||||
**Impact:** **MEDIUM** - Cannot communicate with GeViServer protocol
|
||||
|
||||
---
|
||||
|
||||
### 6. CALLBACK & NOTIFICATIONS
|
||||
|
||||
#### SDK Callback Patterns
|
||||
|
||||
| Pattern | SDK Location | Flutter Status | Notes |
|
||||
|---------|--------------|----------------|-------|
|
||||
| `DatabaseNotification` callback | Chunk 8, Pages 71-80 | ❌ **Missing** | No server events |
|
||||
| `TServerNotification` enum | Chunk 8, Pages 71-80 | ❌ **Missing** | No notification types |
|
||||
| `NFServer_NewMessage` | Chunk 8, Pages 71-80 | ❌ **Missing** | No message events |
|
||||
| `NFServer_Disconnected` | Chunk 8, Pages 71-80 | ❌ **Missing** | No disconnect events |
|
||||
| `NFServer_GoingShutdown` | Chunk 8, Pages 71-80 | ❌ **Missing** | No shutdown events |
|
||||
| **C# Event Handlers** ||||
|
||||
| Event registration | Chunk 10, Pages 91-100 | ❌ **Missing** | No event system |
|
||||
| `ReceivedCrossSwitch` event | Chunk 10, Pages 91-100 | ❌ **Missing** | No action events |
|
||||
| `GscActionDispatcher` | Chunk 11, Pages 101-110 | ❌ **Missing** | No GSC dispatching |
|
||||
|
||||
#### Flutter Implementation
|
||||
|
||||
**What Exists:**
|
||||
- ✅ BLoC event streams (app-level events)
|
||||
- ✅ HTTP response callbacks
|
||||
- ✅ Error handling with `Either<Failure, Success>`
|
||||
- ✅ State change notifications
|
||||
|
||||
**What's Missing:**
|
||||
- ❌ GeViServer event subscription
|
||||
- ❌ Real-time message listeners
|
||||
- ❌ Action-specific event handlers
|
||||
- ❌ GeViScope event dispatching
|
||||
- ❌ Server notification handling
|
||||
- ❌ WebSocket/streaming support
|
||||
|
||||
**Impact:** **MEDIUM** - Cannot respond to GeViServer events
|
||||
|
||||
---
|
||||
|
||||
### 7. EVENT & ALARM CONFIGURATION
|
||||
|
||||
#### SDK Configuration Functions
|
||||
|
||||
| Feature | SDK Location | Flutter Status | Notes |
|
||||
|---------|--------------|----------------|-------|
|
||||
| **Event Configuration** ||||
|
||||
| Event create/update/delete | GeViSet UI, Chunks 4-5 | 🟡 **Partial** | Can configure mappings |
|
||||
| Event triggers (StartBy) | Chunks 4-5, Pages 31-50 | 🟡 **Partial** | Stored in InputAction |
|
||||
| Event actions (OnStart/OnStop) | Chunks 4-5, Pages 31-50 | 🟡 **Partial** | Stored in OutputActions |
|
||||
| Auto-stop configuration | Chunk 4, Pages 31-40 | ❌ **Missing** | No timeout support |
|
||||
| Retriggerable flag | Chunk 4, Pages 31-40 | ❌ **Missing** | No retrigger logic |
|
||||
| **Alarm Configuration** ||||
|
||||
| Alarm create/update/delete | GeViSet UI, Chunk 5 | 🟡 **Partial** | Can store mappings |
|
||||
| Alarm triggers | Chunk 5, Pages 41-50 | 🟡 **Partial** | Stored in InputAction |
|
||||
| Acknowledge/quit actions | Chunk 5, Pages 41-50 | ❌ **Missing** | No workflow support |
|
||||
| Monitor group assignment | Chunk 5, Pages 41-50 | ❌ **Missing** | No monitor groups |
|
||||
| Priority levels | Chunk 5, Pages 41-50 | ❌ **Missing** | No priority field |
|
||||
| Camera assignment | Chunk 5, Pages 41-50 | ❌ **Missing** | No camera lists |
|
||||
|
||||
#### Flutter Implementation
|
||||
|
||||
**What Exists:**
|
||||
- ✅ Action mapping CRUD (create, read, update, delete)
|
||||
- ✅ Input action configuration (trigger events)
|
||||
- ✅ Output actions list (multiple actions per trigger)
|
||||
- ✅ Action parameters storage
|
||||
- ✅ GeViScope instance scoping
|
||||
- ✅ Enabled/disabled flags
|
||||
- ✅ Execution count tracking
|
||||
- ✅ Last executed timestamp
|
||||
|
||||
**What's Missing:**
|
||||
- ❌ Runtime event engine
|
||||
- ❌ Event lifecycle management (start/stop/kill)
|
||||
- ❌ Auto-stop timers
|
||||
- ❌ Retriggering logic
|
||||
- ❌ Alarm state machine (waiting → acknowledged → quit)
|
||||
- ❌ Monitor group configuration
|
||||
- ❌ Priority-based alarm displacement
|
||||
- ❌ Camera routing on alarm
|
||||
|
||||
**Impact:** **MEDIUM** - Configuration exists, but no execution framework
|
||||
|
||||
---
|
||||
|
||||
### 8. TIMER OPERATIONS
|
||||
|
||||
#### SDK Functions
|
||||
|
||||
| Function | SDK Location | Flutter Status | Notes |
|
||||
|----------|--------------|----------------|-------|
|
||||
| `StartTimer(timerID, name)` | Chunk 4, Pages 31-40 | ❌ **Missing** | No timer start |
|
||||
| `StopTimer(timerID, name)` | Chunk 4, Pages 31-40 | ❌ **Missing** | No timer stop |
|
||||
| Timer configuration | GeViSet, Chunk 4, Pages 31-40 | ❌ **Missing** | No timer setup |
|
||||
| Periodical timers | Chunk 4, Pages 31-40 | ❌ **Missing** | No periodic execution |
|
||||
| Embedded tick timers | Chunk 4, Pages 31-40 | ❌ **Missing** | No dual-tick support |
|
||||
| Timer-triggered actions | Chunk 4, Pages 31-40 | ❌ **Missing** | No action binding |
|
||||
|
||||
#### Flutter Implementation
|
||||
|
||||
**What Exists:**
|
||||
- ✅ Dart `Timer` class (for app-level timers)
|
||||
- ✅ Scheduled notifications (not GeViSoft related)
|
||||
|
||||
**What's Missing:**
|
||||
- ❌ GeViSoft timer entity management
|
||||
- ❌ Timer ID registry
|
||||
- ❌ Timer name lookup
|
||||
- ❌ Main tick / embedded tick configuration
|
||||
- ❌ Timer event handlers
|
||||
- ❌ Timer state tracking
|
||||
|
||||
**Impact:** **LOW** - Advanced automation feature
|
||||
|
||||
---
|
||||
|
||||
### 9. GEVISCOPE INTEGRATION
|
||||
|
||||
#### SDK GeViScope Functions
|
||||
|
||||
| Function | SDK Location | Flutter Status | Notes |
|
||||
|----------|--------------|----------------|-------|
|
||||
| `CActGscAction` wrapper | Chunk 8, Pages 71-80 | ❌ **Missing** | No GSC message wrapper |
|
||||
| `GscAct_CreateCustomAction` | Chunk 8, Pages 71-80 | ❌ **Missing** | No GSC action creation |
|
||||
| GeViScope server alias | Chunks 2, 8, Pages 11-80 | 🟡 **Partial** | Alias stored in mappings |
|
||||
| Send to GeViScope | Chunks 8, 10, Pages 71-100 | ❌ **Missing** | No GSC send |
|
||||
| Receive from GeViScope | Chunk 11, Pages 101-110 | ❌ **Missing** | No GSC receive |
|
||||
| `GscActionDispatcher` | Chunk 11, Pages 101-110 | ❌ **Missing** | No GSC dispatcher |
|
||||
|
||||
#### Flutter Implementation
|
||||
|
||||
**What Exists:**
|
||||
- ✅ GeViScope server list (`gscServers`)
|
||||
- ✅ GeViScope-specific action categories (prefixed with "GSC:")
|
||||
- ✅ `geviscopeInstanceScope` field in action mappings
|
||||
- ✅ Server alias storage
|
||||
- ✅ GSC server cache
|
||||
|
||||
**What's Missing:**
|
||||
- ❌ GeViScope SDK connection
|
||||
- ❌ GSC action message format
|
||||
- ❌ Bidirectional GeViScope communication
|
||||
- ❌ GSC event dispatching
|
||||
- ❌ Embedded action extraction
|
||||
- ❌ GeViScope server targeting
|
||||
|
||||
**Impact:** **MEDIUM** - GeViScope integration planned but not executed
|
||||
|
||||
---
|
||||
|
||||
## Implementation Priorities
|
||||
|
||||
### P0 - Critical (Foundation)
|
||||
|
||||
**Must implement to enable any GeViSoft functionality:**
|
||||
|
||||
1. **GeViServer Connection Layer**
|
||||
- [ ] Integrate GeViProcAPI.dll (native binding)
|
||||
- [ ] Implement `Database_Connect()` / `Database_Disconnect()`
|
||||
- [ ] Database handle management
|
||||
- [ ] Connection state tracking
|
||||
- [ ] Error handling for connection failures
|
||||
|
||||
2. **Basic Message Construction**
|
||||
- [ ] `CGeViMessage` base class
|
||||
- [ ] Action subclasses (`CActCrossSwitch`, etc.)
|
||||
- [ ] ASCII message parser
|
||||
- [ ] Binary message serialization
|
||||
|
||||
3. **Send Message Infrastructure**
|
||||
- [ ] `SendMessage(message)` method
|
||||
- [ ] Message queue
|
||||
- [ ] Response timeout handling
|
||||
|
||||
---
|
||||
|
||||
### P1 - High (Core Functionality)
|
||||
|
||||
**Enable primary use cases:**
|
||||
|
||||
4. **Video Control Actions**
|
||||
- [ ] `CrossSwitch` implementation
|
||||
- [ ] `ClearOutput` implementation
|
||||
- [ ] Video input/output enumeration
|
||||
- [ ] Live video routing UI
|
||||
|
||||
5. **Digital I/O Actions**
|
||||
- [ ] `CloseContact` / `OpenContact`
|
||||
- [ ] `InputContact` monitoring
|
||||
- [ ] Digital I/O enumeration
|
||||
- [ ] Real-time I/O status display
|
||||
|
||||
6. **State Query System**
|
||||
- [ ] `SendStateQuery(query, timeout)`
|
||||
- [ ] `CStateAnswer` processing
|
||||
- [ ] First/Next iteration pattern
|
||||
- [ ] Active/enabled filtering
|
||||
|
||||
7. **Connection Monitoring**
|
||||
- [ ] Ping-based health checks
|
||||
- [ ] Auto-reconnect on failure
|
||||
- [ ] Connection status UI
|
||||
|
||||
---
|
||||
|
||||
### P2 - Medium (Automation)
|
||||
|
||||
**Enable advanced scenarios:**
|
||||
|
||||
8. **Event Execution Engine**
|
||||
- [ ] Event lifecycle (start/stop/kill)
|
||||
- [ ] Trigger evaluation
|
||||
- [ ] Action execution on events
|
||||
- [ ] Auto-stop timers
|
||||
- [ ] Retriggering logic
|
||||
|
||||
9. **Alarm Handling**
|
||||
- [ ] Alarm state machine
|
||||
- [ ] Acknowledge workflow
|
||||
- [ ] Quit workflow
|
||||
- [ ] Monitor group routing
|
||||
- [ ] Priority-based display
|
||||
|
||||
10. **Timer Operations**
|
||||
- [ ] Timer start/stop
|
||||
- [ ] Periodic execution
|
||||
- [ ] Embedded tick support
|
||||
- [ ] Timer-triggered actions
|
||||
|
||||
11. **Database Queries**
|
||||
- [ ] Query handle management
|
||||
- [ ] Record navigation (GetLast/GetNext/GetPrev)
|
||||
- [ ] Action type filtering
|
||||
- [ ] Primary key range filtering
|
||||
|
||||
---
|
||||
|
||||
### P3 - Low (Advanced Integration)
|
||||
|
||||
**Nice-to-have features:**
|
||||
|
||||
12. **GeViScope Integration**
|
||||
- [ ] `CActGscAction` wrapper
|
||||
- [ ] GSC message sending
|
||||
- [ ] GSC message receiving
|
||||
- [ ] `GscActionDispatcher`
|
||||
- [ ] Embedded action parsing
|
||||
|
||||
13. **Callback & Notifications**
|
||||
- [ ] `DatabaseNotification` callback
|
||||
- [ ] Server notification handling
|
||||
- [ ] Event-based action dispatching
|
||||
- [ ] WebSocket support (if applicable)
|
||||
|
||||
14. **Message Conversion**
|
||||
- [ ] Binary to ASCII conversion
|
||||
- [ ] ASCII to Binary conversion
|
||||
- [ ] Message debugging tools
|
||||
|
||||
---
|
||||
|
||||
## Test Plan
|
||||
|
||||
### Test Execution Strategy
|
||||
|
||||
1. **Setup Test Environment**
|
||||
- Install GeViSoft SDK
|
||||
- Start GeViServer (console mode)
|
||||
- Configure GeViIO client (virtual VX3)
|
||||
- Use GeViAPITestClient for verification
|
||||
|
||||
2. **Implement Flutter Integration**
|
||||
- Add native platform channels (MethodChannel for GeViProcAPI.dll)
|
||||
- Build connection layer
|
||||
- Implement action classes
|
||||
- Add send/receive logic
|
||||
|
||||
3. **Test Each Category Systematically**
|
||||
- Follow test cases from SDK documentation summary
|
||||
- Compare Flutter app behavior vs GeViAPITestClient
|
||||
- Log all actions and responses
|
||||
- Verify state changes
|
||||
|
||||
---
|
||||
|
||||
### Phase-by-Phase Test Plan
|
||||
|
||||
#### **Phase 1: Foundation (P0 - Critical)**
|
||||
|
||||
**Test Cases:**
|
||||
|
||||
**TC-001: GeViServer Connection**
|
||||
- **Pre-condition:** GeViServer running on localhost
|
||||
- **Steps:**
|
||||
1. Flutter app calls `Database_Connect("localhost", "admin", "password")`
|
||||
2. Verify connection handle returned
|
||||
3. Check connection status indicator
|
||||
- **Expected:** Connection successful, handle != null
|
||||
- **Flutter Implementation:** Create `GeViServerService` with native channel
|
||||
|
||||
**TC-002: Connection Monitoring**
|
||||
- **Pre-condition:** Connected to GeViServer
|
||||
- **Steps:**
|
||||
1. Start monitoring thread
|
||||
2. Send ping every 10 seconds
|
||||
3. Disconnect network cable
|
||||
4. Wait for auto-reconnect
|
||||
- **Expected:** App detects disconnect, attempts reconnect
|
||||
- **Flutter Implementation:** Background `Timer.periodic` with ping/reconnect logic
|
||||
|
||||
**TC-003: Send CrossSwitch Action**
|
||||
- **Pre-condition:** Connected to GeViServer
|
||||
- **Steps:**
|
||||
1. Create `CActCrossSwitch(7, 3, 0)` message
|
||||
2. Call `SendMessage(message)`
|
||||
3. Verify in GeViAPITestClient
|
||||
- **Expected:** Video input 7 routed to output 3
|
||||
- **Flutter Implementation:** `ActionService.sendCrossSwitch(7, 3, SwitchMode.normal)`
|
||||
|
||||
---
|
||||
|
||||
#### **Phase 2: Video Control (P1 - High)**
|
||||
|
||||
**Test Cases:**
|
||||
|
||||
**TC-004: Enumerate Video Inputs**
|
||||
- **Steps:**
|
||||
1. Send `CSQGetFirstVideoInput(true, true)`
|
||||
2. Loop with `CSQGetNextVideoInput` until null
|
||||
3. Display list in Flutter UI
|
||||
- **Expected:** All configured video inputs listed
|
||||
- **Flutter Implementation:** `VideoService.getAllVideoInputs()` → `List<VideoChannel>`
|
||||
|
||||
**TC-005: Clear Video Output**
|
||||
- **Pre-condition:** Video routed to output 3
|
||||
- **Steps:**
|
||||
1. Send `ClearOutput(3)`
|
||||
2. Verify output shows no video
|
||||
- **Expected:** Output cleared successfully
|
||||
- **Flutter Implementation:** `VideoService.clearOutput(3)`
|
||||
|
||||
**TC-006: Video Routing UI**
|
||||
- **Steps:**
|
||||
1. Display video inputs dropdown
|
||||
2. Display video outputs dropdown
|
||||
3. Add "Route" button
|
||||
4. On tap, send `CrossSwitch`
|
||||
- **Expected:** UI-driven video routing works
|
||||
- **Flutter Implementation:** New screen `VideoRoutingScreen`
|
||||
|
||||
---
|
||||
|
||||
#### **Phase 3: Digital I/O (P1 - High)**
|
||||
|
||||
**Test Cases:**
|
||||
|
||||
**TC-007: Close Digital Output**
|
||||
- **Steps:**
|
||||
1. Send `CloseContact(1)`
|
||||
2. Check physical contact state
|
||||
- **Expected:** Digital output 1 closed
|
||||
- **Flutter Implementation:** `DigitalIOService.closeContact(1)`
|
||||
|
||||
**TC-008: Monitor Digital Input**
|
||||
- **Steps:**
|
||||
1. Register callback for `InputContact` events
|
||||
2. Toggle physical input 3
|
||||
3. Verify callback triggered
|
||||
- **Expected:** App receives `InputContact(3, true/false)` events
|
||||
- **Flutter Implementation:** Event stream `DigitalIOService.inputContactStream`
|
||||
|
||||
---
|
||||
|
||||
#### **Phase 4: Event & Alarm Execution (P2 - Medium)**
|
||||
|
||||
**Test Cases:**
|
||||
|
||||
**TC-009: Execute Event from Mapping**
|
||||
- **Pre-condition:** Event mapping configured (InputContact(3) → CrossSwitch(3, 2))
|
||||
- **Steps:**
|
||||
1. Close digital input 3
|
||||
2. Verify CrossSwitch action executed
|
||||
3. Verify video routed
|
||||
- **Expected:** Event triggers output action
|
||||
- **Flutter Implementation:** `EventEngine.processInputEvent()`
|
||||
|
||||
**TC-010: Parking Lot Alarm (Full Scenario)**
|
||||
- **Configuration:** From SDK documentation example
|
||||
- **Steps:**
|
||||
1. Close input 1 (vehicle detected) → Alarm starts
|
||||
2. Close input 2 (acknowledge) → Barrier opens
|
||||
3. Close input 3 (quit) → Barrier closes
|
||||
- **Expected:** Complete alarm workflow
|
||||
- **Flutter Implementation:** `AlarmService.executeAlarmWorkflow()`
|
||||
|
||||
---
|
||||
|
||||
#### **Phase 5: Database Queries (P3 - Low)**
|
||||
|
||||
**Test Cases:**
|
||||
|
||||
**TC-011: Retrieve Last 10 Actions**
|
||||
- **Steps:**
|
||||
1. Create `CDBQCreateActionQuery`
|
||||
2. Get query handle
|
||||
3. Send `CDBQGetLast` 10 times
|
||||
4. Display in UI
|
||||
- **Expected:** List of 10 most recent actions
|
||||
- **Flutter Implementation:** `DatabaseService.getRecentActions(10)`
|
||||
|
||||
**TC-012: Filter CustomActions**
|
||||
- **Steps:**
|
||||
1. Create query with `CDBFTypeName("CustomAction")`
|
||||
2. Iterate results
|
||||
3. Verify all are CustomAction type
|
||||
- **Expected:** Only CustomAction records returned
|
||||
- **Flutter Implementation:** `DatabaseService.filterActions(type: "CustomAction")`
|
||||
|
||||
---
|
||||
|
||||
### Test Automation Plan
|
||||
|
||||
**Unit Tests:**
|
||||
- Message construction (action classes)
|
||||
- ASCII/binary conversion
|
||||
- Parameter validation
|
||||
- Connection state machine
|
||||
|
||||
**Integration Tests:**
|
||||
- GeViServer connection flow
|
||||
- Send/receive action cycle
|
||||
- Query iteration loops
|
||||
- Event trigger → action execution
|
||||
|
||||
**UI Tests:**
|
||||
- Video routing screen
|
||||
- Digital I/O control panel
|
||||
- Event/alarm management screens
|
||||
- Connection status indicator
|
||||
|
||||
---
|
||||
|
||||
## Recommendations
|
||||
|
||||
### Immediate Actions (Next 1-2 Weeks)
|
||||
|
||||
1. **Native Binding Setup**
|
||||
- Create Flutter platform channel for GeViProcAPI.dll
|
||||
- Implement basic connect/disconnect/send
|
||||
- Test on Windows (GeViProcAPI is Windows-only)
|
||||
|
||||
2. **Message Layer**
|
||||
- Create Dart equivalents of `CGeViMessage` classes
|
||||
- Implement ASCII message parser
|
||||
- Add binary serialization (if needed)
|
||||
|
||||
3. **Action Execution Service**
|
||||
- Create `ActionExecutionService` singleton
|
||||
- Implement `sendAction(ActionMessage)` method
|
||||
- Add response handling
|
||||
|
||||
4. **Connection Management**
|
||||
- Build `GeViServerConnectionBloc`
|
||||
- Add connection status stream
|
||||
- Implement auto-reconnect logic
|
||||
|
||||
### Medium-Term Goals (1-3 Months)
|
||||
|
||||
5. **Core Actions**
|
||||
- Implement video control actions
|
||||
- Implement digital I/O actions
|
||||
- Add state query methods
|
||||
|
||||
6. **Event Engine**
|
||||
- Build event trigger evaluation system
|
||||
- Implement action execution on events
|
||||
- Add timer support
|
||||
|
||||
7. **UI Updates**
|
||||
- Add live video routing screen
|
||||
- Add digital I/O control panel
|
||||
- Add connection status dashboard
|
||||
|
||||
### Long-Term Vision (3-6 Months)
|
||||
|
||||
8. **Advanced Integration**
|
||||
- GeViScope bidirectional communication
|
||||
- Database query interface
|
||||
- Alarm workflow management
|
||||
|
||||
9. **Testing & Validation**
|
||||
- Execute full test plan (45 test cases)
|
||||
- Performance optimization
|
||||
- Error handling refinement
|
||||
|
||||
10. **Documentation**
|
||||
- API reference for Flutter → GeViSoft bridge
|
||||
- Integration guide for developers
|
||||
- Example projects
|
||||
|
||||
---
|
||||
|
||||
## Conclusion
|
||||
|
||||
The Flutter application has a **solid foundation for action mapping configuration** but requires significant work to implement **real-time GeViSoft integration**. The critical gap is the connection layer to GeViServer and the action execution engine.
|
||||
|
||||
**Estimated Implementation Effort:**
|
||||
- **P0 (Foundation):** 2-3 weeks
|
||||
- **P1 (Core Functionality):** 4-6 weeks
|
||||
- **P2 (Automation):** 3-4 weeks
|
||||
- **P3 (Advanced):** 2-3 weeks
|
||||
|
||||
**Total:** 11-16 weeks (3-4 months) for full SDK feature parity
|
||||
|
||||
**Recommended Approach:**
|
||||
1. Start with P0 (foundation) to enable any live communication
|
||||
2. Implement P1 (video + I/O) for immediate value
|
||||
3. Iterate on P2 (events/alarms) based on user feedback
|
||||
4. Add P3 (GeViScope, database) as advanced features
|
||||
|
||||
Once the connection layer is implemented, the existing action mapping infrastructure can be leveraged to execute configured actions in real-time, completing the full GeViSoft integration.
|
||||
Reference in New Issue
Block a user