Commit 419ec0ad authored by Claes Sjofors's avatar Claes Sjofors

Xtt Video management server added with support for Aimetis thin client

parent 3769625e
...@@ -140,6 +140,7 @@ ...@@ -140,6 +140,7 @@
# define cPrio_remh (cPrio_base + 5) # define cPrio_remh (cPrio_base + 5)
# define cPrio_remotelogg (cPrio_base + 5) # define cPrio_remotelogg (cPrio_base + 5)
# define cPrio_sim (cPrio_base + 5) # define cPrio_sim (cPrio_base + 5)
# define cPrio_videomgm (cPrio_base + 5)
#endif #endif
static pwr_tBoolean checkSect (pwr_tStatus*, ini_sContext*, int, int); static pwr_tBoolean checkSect (pwr_tStatus*, ini_sContext*, int, int);
...@@ -2131,6 +2132,9 @@ ini_ProcTable ( ...@@ -2131,6 +2132,9 @@ ini_ProcTable (
pp = ini_ProcInsert(sts, cp, "pwr_powerlink", "pwr_powerlink_%d", 0, 1, "rt_powerlink", cPrio_powerlink, 0, pwr_cClass_EplHandler, "", 0); pp = ini_ProcInsert(sts, cp, "pwr_powerlink", "pwr_powerlink_%d", 0, 1, "rt_powerlink", cPrio_powerlink, 0, pwr_cClass_EplHandler, "", 0);
pp->proc.flags.b.system = 1; pp->proc.flags.b.system = 1;
pp = ini_ProcInsert(sts, cp, "pwr_videomgm", "pwr_videomgm_%d", 0, 1, "rt_videomgm", cPrio_videomgm, 0, pwr_cClass_VideoMgmServer, "", 0);
pp->proc.flags.b.system = 1;
pp = ini_ProcInsert(sts, cp, "pwr_sim", "pwr_sim_%d", 0, 1, "rt_sim", cPrio_sim, 0, pwr_cClass_SimulateConfig, "", 0); pp = ini_ProcInsert(sts, cp, "pwr_sim", "pwr_sim_%d", 0, 1, "rt_sim", cPrio_sim, 0, pwr_cClass_SimulateConfig, "", 0);
pp->proc.flags.b.system = 1; pp->proc.flags.b.system = 1;
#endif #endif
......
...@@ -125,6 +125,7 @@ typedef enum { ...@@ -125,6 +125,7 @@ typedef enum {
errh_eAnix_sevhistmon = 23, errh_eAnix_sevhistmon = 23,
errh_eAnix_sim = 24, errh_eAnix_sim = 24,
errh_eAnix_powerlink = 25, errh_eAnix_powerlink = 25,
errh_eAnix_videomgm = 26,
errh_eAnix_plc1 = 41, errh_eAnix_plc1 = 41,
errh_eAnix_plc2 = 42, errh_eAnix_plc2 = 42,
errh_eAnix_plc3 = 43, errh_eAnix_plc3 = 43,
......
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2016 SSAB EMEA AB.
!
! This file is part of Proview.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with Proview. If not, see <http://www.gnu.org/licenses/>
!
! Linking Proview statically or dynamically with other modules is
! making a combined work based on Proview. Thus, the terms and
! conditions of the GNU General Public License cover the whole
! combination.
!
! In addition, as a special exception, the copyright holders of
! Proview give you permission to, from the build function in the
! Proview Configurator, combine Proview with modules generated by the
! Proview PLC Editor to a PLC program, regardless of the license
! terms of these modules. You may copy and distribute the resulting
! combined work under the terms of your choice, provided that every
! copy of the combined work is accompanied by a complete copy of
! the source code of Proview (the version used to produce the
! combined work), being distributed under the terms of the GNU
! General Public License plus this exception.
!
.facility VMGM,323 /prefix = VMGM__ !
success <Successful completion> /succ
noreply <No reply from video system> /error
1 errh 1 ERRH
2 pwrs 2 PWRS
3 pwrb 3 PWRB
4 pwr 4 PWR
12 utl 12 UTL
13 pool 13 POOL
14 mvol 14 MVOL
15 gdb 15 GDB
16 san 16 SAN
17 qcom 17 QCOM
18 qdb 18 QDB
19 sync 19 SYNC
20 que 20 QUE
21 lst 22 TIMER
22 timer 23 THREAD
23 thread 24 PROC
24 proc 25 SEV
25 sev 26 SIM
26 sim 50 HD
50 hd 100 CDH
100 cdh 101 NDC
101 ndc 101 TIME
102 errno 102 ERRNO
103 ccm 103 CCM
104 user 104 USER
105 dcli 105 DCLI
106 nav 106 NAV
107 dbs 106 TREE
108 lng 107 DBS
110 gdh 108 LNG
111 hash 110 GDH
130 plc 111 HASH
140 io 112 NET
141 pb 130 PLC
142 mb 140 IO
143 iom 141 PB
180 ini 142 MB
190 mh 143 IOM
191 ph 180 INI
192 smon 190 MH
210 ds 191 PH
211 csup 192 SMON
220 ldh 210 DS
230 pro 211 CSUP
240 goen 220 LDH
250 gre 221 WSX
260 vldh 240 GOEN
270 gsx 250 GRE
280 foe 260 VLDH
290 rou 270 GSX
299 ate 280 FOE
300 tra 290 ROU
301 cmd 300 ATE
302 vsel 300 TRA
303 distr 301 CMD
304 lfu 302 VSEL
305 flow 303 DISTR
306 ge 303 PKG
307 xnav 304 LFU
308 wnav 305 FLOW
309 watt 306 GE
310 rtt 307 XNAV
311 tlog 308 WNAV
312 nmps 309 WATT
313 glow 310 RTT
314 cnv 311 TLOG
315 rtc 312 NMPS
316 wda 313 GLOW
317 xatt 314 CNV
320 login 315 RTC
321 syi 316 WDA
322 wow 317 XATT
320 LOGIN
320 SUTL
321 SYI
322 WOW
323 VMGM
531 REM
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2016 SSAB EMEA AB.
!
! This file is part of Proview.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with Proview. If not, see <http://www.gnu.org/licenses/>
!
! Linking Proview statically or dynamically with other modules is
! making a combined work based on Proview. Thus, the terms and
! conditions of the GNU General Public License cover the whole
! combination.
!
! In addition, as a special exception, the copyright holders of
! Proview give you permission to, from the build function in the
! Proview Configurator, combine Proview with modules generated by the
! Proview PLC Editor to a PLC program, regardless of the license
! terms of these modules. You may copy and distribute the resulting
! combined work under the terms of your choice, provided that every
! copy of the combined work is accompanied by a complete copy of
! the source code of Proview (the version used to produce the
! combined work), being distributed under the terms of the GNU
! General Public License plus this exception.
!
! pwrb_c_videomgmserver.wb_load -- Defines the class VideoMgmServer.
!
SObject pwrb:Class
!/**
! @Group NodeConfiguration
! @Summary Video management control server
! Configuration object for the Video management control server.
!
!*/
Object VideoMgmServer $ClassDef 685
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "VideoMgmServer"
EndBody
!/**
! Optional description.
!*/
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Scantime.
!*/
Object Scantime $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! List of XttVideoMgm objects.
!*/
Object VideoMgmObjects $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 10
EndBody
EndObject
EndObject
Object Template VideoMgmServer
Body RtBody
Attr Scantime = 0.5
EndBody
EndObject
EndObject
EndSObject
This diff is collapsed.
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
ifndef link_rule_mk
link_rule_mk := 1
link = $(ldxx) $(elinkflags) $(domap) -o $(export_exe) \
$(export_obj) \
$(pwre_conf_libdir) $(pwre_conf_libpwrxtt) $(pwre_conf_libpwrrt) $(pwre_conf_lib)
endif
This diff is collapsed.
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2016 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef xtt_videomgm_h
#define xtt_videomgm_h
/* xtt_videomgm.h -- Video management system */
#include <iostream>
#include <fstream>
#include <vector>
#include "pwr_baseclasses.h"
using namespace std;
class VideoMgmCell {
public:
VideoMgmCell() {
strcpy(id,"");
strcpy(cameraid,"");
}
VideoMgmCell( const VideoMgmCell& x) {
strncpy( id, x.id, sizeof(id));
strncpy( cameraid, x.cameraid, sizeof(cameraid));
}
char id[80];
char cameraid[80];
};
class VideoMgmPanel {
public:
VideoMgmPanel() : width(0), height(0) {
strcpy(id,"");
strcpy(name,"");
}
VideoMgmPanel( const VideoMgmPanel& x) : width(x.width), height(x.height), cell(x.cell) {
strncpy( id, x.id, sizeof(id));
strncpy( name, x.name, sizeof(name));
}
char id[80];
char name[80];
int width;
int height;
vector<VideoMgmCell> cell;
};
class VideoMgmCamera {
public:
VideoMgmCamera() {
strcpy(id,"");
strcpy(name,"");
strcpy(model,"");
strcpy(username,"");
strcpy(password,"");
}
VideoMgmCamera( const VideoMgmCamera& x) {
strncpy( id, x.id, sizeof(id));
strncpy( name, x.name, sizeof(name));
strncpy( model, x.model, sizeof(model));
strncpy( username, x.username, sizeof(username));
strncpy( password, x.password, sizeof(password));
}
char id[80];
char name[80];
char model[80];
char username[80];
char password[80];
};
class XttVideoMgm {
public:
int m_camera_cnt;
float m_scantime;
pwr_sClass_XttVideoMgm *m_op;
pwr_tDlid m_dlid;
pwr_tBoolean m_panel_select_old[20];
pwr_tBoolean m_camera_select_old[40];
pwr_tInt32 m_cell_camera_idx_old[20];
pwr_tInt32 m_current_panel_old;
pwr_tInt32 m_current_camera_old;
vector<VideoMgmPanel> m_panel;
vector<VideoMgmCamera> m_camera;
XttVideoMgm() : m_camera_cnt(0), m_scantime(0.5), m_op(0) {}
int cinit();
void cscan();
void configure_layout();
virtual int init() {return 0;}
virtual int authorize( char *user, char *password) {return 0;}
virtual int get_panels() {return 0;}
virtual int get_cameras() {return 0;}
virtual int get_camera_image( int idx, const char *jpgfile) {return 0;}
virtual int assign_camera( int panel_idx, int cell_idx, int camera_idx) {return 0;}
virtual int set_camera_fullscreen( int camera_idx) {return 0;}
virtual int display_panel( int panel_idx) {return 0;}
virtual int create_panel( char *name) {return 0;}
virtual int delete_panel( char *name) {return 0;}
};
class XttVideoMgmAimetis : public XttVideoMgm {
public:
char m_fix;
char m_auth_token[80];
char m_addr[80];
pwr_tTime m_last_auth;
XttVideoMgmAimetis( char *addr) : m_fix(0) {
strncpy( m_addr, addr, sizeof(m_addr));
strcpy( m_auth_token, "");
memset( &m_panel_select_old, 0, sizeof(m_panel_select_old));
memset( &m_camera_select_old, 0, sizeof(m_camera_select_old));
}
int init();
int authorize( char *user, char *password);
int check_session();
int get_panels();
int get_cameras();
int get_camera_image( int idx, const char *jpgfile);
int assign_camera( int panel_idx, int cell_idx, int camera_idx);
int set_camera_fullscreen( int camera_idx);
int display_panel( int panel_idx);
int create_panel( char *name);
int delete_panel( char *name);
};
class Json {
public:
static int get_attribute_value( ifstream& fp, const char *attribute, char *value, int size);
};
class VideoMgmServer {
public:
float m_scantime;
vector<XttVideoMgm*>m_mgmvect;
VideoMgmServer() : m_scantime(0.5) {}
void open();
void scan();
void close();
float scantime() {return m_scantime;}
};
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment