Giter Site home page Giter Site logo

pvbrowser / pvb Goto Github PK

View Code? Open in Web Editor NEW
267.0 267.0 152.0 173.96 MB

HMI and SCADA

Home Page: http://pvbrowser.org

License: Other

HTML 67.28% C++ 22.01% QMake 0.29% Shell 0.14% CSS 0.12% C 5.01% Lua 0.01% Python 0.66% Tcl 0.04% PHP 0.02% Makefile 0.08% Awk 0.01% Pascal 0.14% Batchfile 0.03% DIGITAL Command Language 0.01% Roff 4.11% Ruby 0.01% NSIS 0.03% SWIG 0.01% PostScript 0.01%

pvb's People

Contributors

pvbrowser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pvb's Issues

problem in rlmodbusclient with negative values

Hi!

I've encounter a problem writting signed integer with function:

writePresetSingleRegister(int slave, int adr, int value)

the problematic line is:

data[2] = value/256; data[3] = value & 0x0ff;

where I think we find a calculation error in value/256 , changing this, perhaps a little bit out of control operation (unsigned char = int/int), with a bit moving operation solve the issue for me.

data[2] = value>>8; data[3] = value & 0x0ff;

So that, I can now correctly write/read signed integers to a PLC.

Also:

  • perhaps we should also check int (32 bits) limits to fit in a 16 bits INT/WORD
  • perhaps we should treat address also in the way: addr>>8 to avoid possible problems? (I'm not sure as address should be always unsigned)
  • perhaps we should build another abstraction layer where writeInt, writeFloat, etc.?

cheers, and thanks for the effort!

pd: tests I did:

----- FOR VALUE: 32643 -----
RLMODBUSCLIENT: old telegram, slave:1 , highaddress:3 lowaddress:232, highvalue:127 lowvalue:131
RLMODBUSCLIENT: new telegram, slave:1 , highaddress:3 lowaddress:232, highvalue:127 lowvalue:131

----- FOR VALUE: -32643 -----
RLMODBUSCLIENT: old telegram, slave:1 , highaddress:3 lowaddress:232, highvalue:129 lowvalue:125
RLMODBUSCLIENT: new telegram, slave:1 , highaddress:3 lowaddress:232, highvalue:128 lowvalue:125

----- FOR VALUE: 255 -----
RLMODBUSCLIENT: old telegram, slave:1 , highaddress:3 lowaddress:232, highvalue:0 lowvalue:255
RLMODBUSCLIENT: new telegram, slave:1 , highaddress:3 lowaddress:232, highvalue:0 lowvalue:255

----- FOR VALUE: -255 -----
RLMODBUSCLIENT: old telegram, slave:1 , highaddress:3 lowaddress:232, highvalue:0 lowvalue:1
RLMODBUSCLIENT: new telegram, slave:1 , highaddress:3 lowaddress:232, highvalue:255 lowvalue:1

only partial text is displayed in the grid drawing

img_20180620_211759_resized_20180620_110808666

@pvbrowser we have developed a pvs application with grid and line drawing. We followed the sample in the open source. It is very handy ! however we met an issue - the text can not be fully displayed. The snapshot is attached in this post.

We are using linux framebuffer mode on tuchscreen device. The font can support Chinese, but even we only draw English words, it still happens.

note only Ubuntu, it is no problem with English words only.

Any suggestions will be really appreciated.

Linux Installaion issues

Please help me with this:

You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
pvbrowser-devel : Depends: qt5-default but it is not installable
Depends: xterm
Depends: ffmpeg
Depends: libavcodec-dev but it is not going to be installed
Depends: libavcodec58
Depends: libqt5multimedia5 but it is not going to be installed
Depends: libqt5help5 but it is not going to be installed
Depends: libqt5webenginecore5 but it is not going to be installed
Depends: libqt5multimediawidgets5 but it is not going to be installed
Depends: libqt5webengine5 but it is not going to be installed
Depends: libqt5webenginewidgets5 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

"Start server" missing many dependencies on fed19

Couldn't find any issue tracking on pvbrowser.org

Working my way through the tutorial, made a lua project, immediately ran into problems with "Action->Start Server" This requires "xterm" to be installed, which I didn't have. I worked around that, but it still never starts any server, it just fails to find a font and sits there. Running "xterm" from the same shell launches a terminal, so that's working at least, and the missing font is then just a warning.

$ pvdevelop 
find
loaded the Generic plugin 
xterm: cannot load font '-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1'

Siemens TCP communication unnecessarily slow

Hello I'm using the rllib as a standalone project. Right now the rlsiemenstcp class is unnecessarily slow on my system (Ubuntu 12.04 64 bits). After some research and benchmarking comparison with libnodave, I've found that the main reason is that rlsiemenstcp does two writes to the socket for each request. There are several ways to avoid the delay use one write (copy header and buffer to one total buffer and send that), use TCP_NODELAY, use non NONBLOCKING or clever use of TCP_CORK. I attach an easy solution using the first option:

int rlSiemensTCP::write_iso(unsigned char *buf, int len)
{
  int i,ret, total_len;
  char stack_buf[512];
  char *total_buf=0;

  if(rlSocket::isConnected() == 0) doConnect();
  if(rlSocket::isConnected() == 0) return -1;
  ih.version  = 3;
  ih.reserved = 0;
  ih.length_high = (len+4) / 256;
  ih.length_low  = (len+4) & 0x0ff;
  if(len <=0) 
  {
    rlDebugPrintf("write_iso:failure to write iso packet negative length -> disconnecting\n");
    rlSocket::disconnect(); 
  }
  total_len = len + sizeof(ih);
  if(total_len > sizeof(stack_buf)) 
  {
      total_buf = new char[len + sizeof(ih)];
  }
  else 
  {
      total_buf = stack_buf;
  }
  memcpy(total_buf, &ih, sizeof(ih));
  memcpy(total_buf+sizeof(ih), buf, len);
  ret = rlSocket::write(total_buf, total_len);
  if(total_len > sizeof(stack_buf))
      delete [] total_buf;
  if(ret < 0)
  { 
    rlDebugPrintf("write_iso:failure to write iso packet -> disconnecting\n");
    rlSocket::disconnect(); 
    return ret; 
  }  

  if(rlDebugPrintfState != 0)
  {
      ::printf("write_iso() len=%d\n", len);
    for(i=0; i<len; i++) ::printf("%02x,",buf[i]);
    ::printf("\n");
  }
  return len;
}

I think TCP_NODELAY would be a better solution since it avoids copying memory, but I haven't implemented it since it will either break expectations from other users of rlSocket, or it will break rlSocket API. I also don't have all the platforms where rllib is being used so I can't test TCP_NODELAY.

By my measurements, grouping those two writes gives me ~6x speedup (from 10s to perform 100 reads on a S71200 to 1.4 seconds) .

Regards,
V. Seguí

pvbrowser compiling error

Compiling the project using build.sh gave the following error:

When USE_VTK:

QVTKWidget.cpp: In constructor ‘QVTKWidget::QVTKWidget(QWidget*)’:
QVTKWidget.cpp:106:23: error: ‘f’ was not declared in this scope
: QWidget(parent, f | Qt::MSWindowsOwnDC), mRenWin(NULL),
^
QVTKWidget.cpp: In member function ‘virtual bool QVTKWidget::event(QEvent*)’:
QVTKWidget.cpp:392:12: error: ‘TRUE’ was not declared in this scope
return TRUE;
^~~~

When Not USE_VTK:

g++ -static-libgcc -Wl,-O1 -Wl,-rpath-link,/usr/lib/x86_64-linux-gnu -o pvbrowser main.o mainwindow.o dlgopt.o opt.o tcputil.o interpreter.o MyWidgets.o MyTextBrowser_v5pc.o mywebenginepage.o QDrawWidget.o QImageWidget.o qwtplotwidget.o dlgtextbrowser.o dlgmybrowser.o pvglwidget.o gldecode.o qrc_pvbrowser.o moc_mainwindow.o moc_dlgopt.o moc_MyWidgets.o moc_MyTextBrowser_v5pc.o moc_mywebenginepage.o moc_qimagewidget.o moc_qdrawwidget.o moc_qwtwidgets.o moc_qwtplotwidget.o moc_dlgtextbrowser.o moc_dlgmybrowser.o moc_pvglwidget.o -ldl ../qwt/lib/libqwt.a -lQt5WebEngineWidgets -lQt5PrintSupport -lQt5UiTools -lQt5Svg -lQt5Widgets -lQt5Multimedia -lQt5WebEngineCore -lQt5Quick -lQt5Gui -lQt5WebChannel -lQt5Qml -lQt5Network -lQt5Positioning -lQt5Xml -lQt5Core -lGL -lpthread
interpreter.o: In function Interpreter::interpretv(char const*)': interpreter.cpp:(.text+0x3f99): undefined reference to pvVtkTclWidget::interpret(char const*, ...)'
interpreter.cpp:(.text+0x3fd1): undefined reference to pvVtkTclWidget::updateGL()' interpreter.cpp:(.text+0x4289): undefined reference to pvVtkTclWidget::interpretFile(char const*)'
interpreter.o: In function Interpreter::interpretQ(char const*)': interpreter.cpp:(.text+0x9765): undefined reference to pvVtkTclWidget::pvVtkTclWidget(QWidget*, char const*, int, int*)'
collect2: error: ld returned 1 exit status
Makefile:265: recipe for target 'pvbrowser' failed

Other information might be helpful:
sys: ubuntu 18.04
VTK 5.10 compiled from source
tcl/tk8.5 installed from apt

Feature request: VTK callback from pvQVtkTclWidget()?

<tl;dr>Does the pvQVtkTclWidget support a user interaction callback to the main program? From the code, I think it does not?</tl;dr>

Full story: pvQVtkTclWidget() is set up and commanded through TCL, without any feedback (afaik), its tricky / impossible (for me at least) to get the interactor feedback to the program.

There might be two main pathways to implement this:

  1. Create a class that inherits from vtkCallbackCommand reimplementing Execute( vtkObject caller, unsigned long evId, void) and setting pointers to a client and/or call data as needed. When the class is implemented, it becomes the callback function.
  2. Create a function with this signature: void f( vtkObject * caller, long unsigned int evId, void* clientData, void* callData) and, where needed, create a vtkCallbackCommand setting its callback to the function we have created.

Yet to my knowledge, neither is available in pvbrowser?

Do you have a suggestion on how to pass back a user interaction with this VTKwidget?
Say, a mouseover or mouseclick in the VTK-space, or even more specific: vtkPointPicker info?
As we do get position and click data in canvas (in C++), and the picking info in TCL (as a picker object) ,but this info on the object interaction -to my knowledge- is not available in C++?

Support for widget name mangling in pvdevelop (partial parser revamp)

Hi,

I have added some basic name mangling to the pvdevelop tree to allow usage of C style identifiers as widget names. The reason for that is that I wanted to reference directly to named abstract run-time properties in order to prototype more rapidly.
The support is however quite basic and will require way more testing. Also, I am unable to cover the lua wrapper side testing for now, so I'd be happy if someone with lua experience would review and assist with testing.

The modifications: https://github.com/hackfin/pvb/tree/netpp_mods

Example usage for mangling to be effective:

When adding a widget, prefix the ObjectName in the Dialog with a '_', for example: _Stream.HandledData. If not prefixed, names will be emit like usual and not mangle characters that might break compilation.

In the process, it turned out to make sense to rewrite the parser, hopefully eliminating some more issues with lost widget properties.

connecting Bachmann MX213 using modbus over TCP

Hi,

Has anyone got experience working with Bachmann MX213 using modbus over TCP? The modbus daemon seems able to read in some value from the register but the return value is -1. I guess the connection between the daemon and the plc is not thru.

Thanks,
Dave

pvdevelop starts command line

when running the command pvdevelop it returns a command line:

####################################################

Develop pvserver for pvbrowser

####################################################
usage: pvdevelop <-action=> <-programming_language=language> <-fake_qmake> <-h> project
example: pvdevelop pvs
example: pvdevelop -action=writeInitialProject pvs
-action=writeInitialProject
-action=insertMask
-action=make
-action=makeModbus
-action=makeSiemensTCP
-action=makePPI
-action=uncommentRLLIB
-action=uncommentModbus
-action=uncommentSiemensTCP
-action=uncommentPPI
-action=writeStartscript
-action=writeDimension::
-action=importUi:
-action=exportUi:
-action=designerUi:
-action=dumpTranslations
-programming_language=<Lua|Python>

I'm expecting a graphical interface. Am I doing something wrong?

problem compiling pvbrowser with the Qt 5.5.0 on Windows

QT official MinGW 4.9.2 does not bring libiberty.a,so can not compile pvbrowser. Is there any way to solve it?
The error msg is:
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory 'D:/SCADA/pvb/win-mingw/pvbrowser'
g++ -mthreads -Wl,-s -Wl,-subsystem,windows -o release\pvbrowser.exe object_scri
pt.pvbrowser.Release -lmingw32 -LD:/Qt/Qt5.5.0/5.5/mingw492_32/lib -lqtmain -ls
hell32 -lws2_32 ../../qwt/lib/libqwt.a D:\Qt\Qt5.5.0\Tools\mingw492_32/lib/libbf
d.a D:\Qt\Qt5.5.0\Tools\mingw492_32/lib/libiberty.a D:\Qt\Qt5.5.0\Tools\mingw492
_32/lib/libmangle.a D:\Qt\Qt5.5.0\Tools\mingw492_32/lib/libopcodes.a -lQt5OpenGL
-lQt5PrintSupport -lQt5UiTools -lQt5WebKitWidgets -lQt5Svg -lQt5Widgets -lQt5Mu
ltimedia -lQt5WebKit -lQt5Gui -lQt5Network -lQt5Xml -lQt5Core
g++: error: D:\Qt\Qt5.5.0\Tools\mingw492_32/lib/libiberty.a: No such file or dir
ectory
Makefile.Release:151: recipe for target 'release\pvbrowser.exe' failed
mingw32-make[1]: *** [release\pvbrowser.exe] Error 1
mingw32-make[1]: Leaving directory 'D:/SCADA/pvb/win-mingw/pvbrowser'
makefile:34: recipe for target 'release' failed
mingw32-make: *** [release] Error 2

question about zigbee :-)

Hi community,

Has anyone tried to use pvbrowser with zigbee devices? as for example an arduino x-bee?
It could be possible to have a shared mailbox with our SCADA?

Sorry if I am asking something completly crazy (I've not an informatics profile) , but it could be nice to have small devices distributed easy to connect with as modbus for example.

BOTTON location problem in touchscreen

We tested a simple pvs application with the pvb on a touchscreen tablet, with tslib and linux buffer frame mode.

We noticed a problem. In a mask with multiple buttons, when we touch button A, then button B, then button A... The event ID received in the pvs is often the previous button pressed, rather than current pressed button.

We have a theory about it but not confirmed yet: the PVB may only update the mouse position on MOUSE_OVER and MOUSE_RELEASE event, but on touchscreen there is no MOUSE_OVER event, so when touch down a button, the mouse position used is actually for previous pressed button.

We have very little knowledge about QT and PVB internals. Can anyone give some advices and clues here? much appreciated!

About parsing diffirent PLC's protocol

Dear Author:
Is your project support to parse the protocol of diffirent PLC(such as AB, Simens, Panosonic)?
Up to now, i just see the protocols that support Modbus, SiemensTCP from the source. Am i right?
Please correct me if i am wrong. Thank you!

problem with pvbrowser packaged .deb

Hi!

I've been trying out your binaries of the web for a while, and I've found the Xenial Qt4 version doesn't work. it depends of obsolete libqt4-webkit and it doesn't exist anymore.

changing it dependency to libqtwebkit4 does the trick.

I tell you here, because I don't know the correct communication channel, and so, also, perhaps can help someone reading.

cheers, and thanks for the project!

using QT inside pvb app

Hi!

Is it possible to use QT inside a pvb app?
I mean, one disadvantage of QT is the need of calling QT app and gui for using elements as QPaint. But I have no idea with the pvserver structure how to get it.

Has anyone tried this?

Thanks!

pvbrowser memory and CPU consumption

hi!

In a medium size program, I feel it running slower in time.

My pvserver is keeping low in resources, but pvbrowser is continuously increasing it's consumption of both CPU and RAM.

Is there something to be aware when programming an app?

I took care of using pvDownloadFile only once at program starting for getting all application artwork.

And I think my program has no memory leaks. (I suppose I'd see this memory leaks in server not in pvbrowser client, isn't it?)

Program is not finished so is not still public :-/ if source code is important I'll have to speed up all the process.

thanks!

problem compiling pvbrowser with the python binding

Hello pvbrowser community

Pvbrowser compile and works perfectly under my system, but I have not succes making rllib standalone working with python.

I've tried the build_python_interface script with this errors:

g++ -c -m64 -pipe -O2 -D_REENTRANT -Wall -W -fPIC -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtSql -I/usr/include/qt4 -I/usr/include/python2.7 g++: fatal error: no input files compilation terminated. make: **\* [qtdatabase.o] Error 4 g++ -c -m64 -pipe -O2 -D_REENTRANT -Wall -W -fPIC -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtSql -I/usr/include/qt4 -I/usr/include/python2.7 g++: fatal error: no input files compilation terminated. make: **\* [language_binding_rllib_wrap_python.o] Error 4 cp: no se puede efectuar `stat' sobre «lib_pv.so»: No existe el archivo o el directorio cp: no se puede efectuar`stat' sobre «lib_rllib.so»: No existe el archivo o el directorio g++ -c -m64 -pipe -O2 -D_REENTRANT -Wall -W -fPIC -DUSE_INETD -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtSql -I/usr/include/qt4 -I/usr/include/python2.7 g++: fatal error: no input files compilation terminated. make: **\* [qtdatabase.o] Error 4 g++ -c -m64 -pipe -O2 -D_REENTRANT -Wall -W -fPIC -DUSE_INETD -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtSql -I/usr/include/qt4 -I/usr/include/python2.7 g++: fatal error: no input files compilation terminated. make: **\* [language_binding_rllib_wrap_python.o] Error 4 cp: no se puede efectuar `stat' sobre «lib_pv.so»: No existe el archivo o el directorio cp: no se puede efectuar`stat' sobre «lib_rllib.so»: No existe el archivo o el directorio

compiling pvbrowser gives me the same errors.
my system specifications are a bare Ubuntu 14.04 64 bits

If I try this piece of code:

import sys, os pvslib_path = '/opt/pvb/language_bindings/python/mt' sys.path.insert(0, pvslib_path) import rllib

I get this error:

File "./main.py", line 48, in import MtoDBc_data File "/home/prointegra/Documentos/desarrollo/respositorios_git_dev/MtoDB_/MtoDBc_data.py", line 11, in import rllib File "/opt/pvb/language_bindings/python/mt/rllib.py", line 26, in _rllib = swig_import_helper() File "/opt/pvb/language_bindings/python/mt/rllib.py", line 22, in swig_import_helper _mod = imp.load_module('_rllib', fp, pathname, description) ImportError: dynamic module does not define init function (init_rllib)

thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.