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 @@
# define cPrio_remh (cPrio_base + 5)
# define cPrio_remotelogg (cPrio_base + 5)
# define cPrio_sim (cPrio_base + 5)
# define cPrio_videomgm (cPrio_base + 5)
#endif
static pwr_tBoolean checkSect (pwr_tStatus*, ini_sContext*, int, int);
......@@ -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->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->proc.flags.b.system = 1;
#endif
......
......@@ -125,6 +125,7 @@ typedef enum {
errh_eAnix_sevhistmon = 23,
errh_eAnix_sim = 24,
errh_eAnix_powerlink = 25,
errh_eAnix_videomgm = 26,
errh_eAnix_plc1 = 41,
errh_eAnix_plc2 = 42,
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
2 pwrs
3 pwrb
4 pwr
12 utl
13 pool
14 mvol
15 gdb
16 san
17 qcom
18 qdb
19 sync
20 que
21 lst
22 timer
23 thread
24 proc
25 sev
26 sim
50 hd
100 cdh
101 ndc
102 errno
103 ccm
104 user
105 dcli
106 nav
107 dbs
108 lng
110 gdh
111 hash
130 plc
140 io
141 pb
142 mb
143 iom
180 ini
190 mh
191 ph
192 smon
210 ds
211 csup
220 ldh
230 pro
240 goen
250 gre
260 vldh
270 gsx
280 foe
290 rou
299 ate
300 tra
301 cmd
302 vsel
303 distr
304 lfu
305 flow
306 ge
307 xnav
308 wnav
309 watt
310 rtt
311 tlog
312 nmps
313 glow
314 cnv
315 rtc
316 wda
317 xatt
320 login
321 syi
322 wow
1 ERRH
2 PWRS
3 PWRB
4 PWR
12 UTL
13 POOL
14 MVOL
15 GDB
16 SAN
17 QCOM
18 QDB
19 SYNC
20 QUE
22 TIMER
23 THREAD
24 PROC
25 SEV
26 SIM
50 HD
100 CDH
101 NDC
101 TIME
102 ERRNO
103 CCM
104 USER
105 DCLI
106 NAV
106 TREE
107 DBS
108 LNG
110 GDH
111 HASH
112 NET
130 PLC
140 IO
141 PB
142 MB
143 IOM
180 INI
190 MH
191 PH
192 SMON
210 DS
211 CSUP
220 LDH
221 WSX
240 GOEN
250 GRE
260 VLDH
270 GSX
280 FOE
290 ROU
300 ATE
300 TRA
301 CMD
302 VSEL
303 DISTR
303 PKG
304 LFU
305 FLOW
306 GE
307 XNAV
308 WNAV
309 WATT
310 RTT
311 TLOG
312 NMPS
313 GLOW
314 CNV
315 RTC
316 WDA
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