Hello,
I am thinking of integrating faceplates into my visualisation server.
A faceplate is a dialog, where a valve etc. can be switched, set to automatic
etc.
It should be possible to open more than one at the same time.
I am thinking how to implement this with pvbrowser. A child or toolbar which the
user can move around and he can close would be nice.
Can this be made with pvbrowser. If yes, what is the best solution?
Regards,
Ernst
In pvbrowser there are only additional modal dialog boxes but no additional
modeless dialog boxes.
But you could add a pvQFrame including other controls in there and hide/show the
pvQFrame as needed.
This could also be done with elements in SVG.
But i think the most easy way to do that is to use a pvPopupMenu
http://pvbrowser.de/pvbrowser/sf/manual/html/group__Dialogs.html#g7b418df9dd393b\
1ad3cc6fee42557989
The PopupMenu will appear next to the mouse position and the user could select
your functions from this menu.
Just evaluate a "clicked" on the valve etc. and show the user such a
pvPopupMenu.
>
> In pvbrowser there are only additional modal dialog boxes but no additional
modeless dialog boxes.
>
> But you could add a pvQFrame including other controls in there and hide/show
the pvQFrame as needed.
> This could also be done with elements in SVG.
That was the solution which came into my mind. But the user cannot move the
frame if it hides something important. I can place the frame on a special place,
but then it is hard to open a second one...
>
> But i think the most easy way to do that is to use a pvPopupMenu
>
Here, it seems not to be possible to use buttons and svg. I want to use both.
> > But i think the most easy way to do that is to use a pvPopupMenu
>
> Here, it seems not to be possible to use buttons and svg.
> I want to use both.
Look within pvsexample mask6_slots.h slotTextEvent.
You see that you have the information which button was clicked.
These messages are only generated for named objects that start with @.
Within pvsexample SVG1 click the green circle in the lower right for example.
You could use the left mouse button for the normal function of the object and
the right button to show the popup menu with the other functions.
I think, there is a misunderstanding.
I want to show SVG and widgets after something is clicked.
And as I understand, the popupmenu can only be defined with a string and cannot
contain SVG etc.
Therefore I would have to use a frame.
A frame cannot be moved around. But there is a widget which can exactly do this:
QDockWidget
I am just looking if the QDockWidget is completely different from QFrame or not.
If it would be very similar, maybe it would be possible to have it in pvbrowser?
It would be possible to make state of the art or even better HMI.
A QDockWidget could be inside (docked) or everywhere at the screen (floating).
BTW: I would only use the left button, because of a touchscreen...
> I think, there is a misunderstanding.
There is a widget called QToolBox which is already in pvbrowser.
http://doc.trolltech.com/4.5/qtoolbox.html
This widget shows tools arranged in tabbed areas.
This might be what you are looking for.
It could also include web pages for example.
But a QToolBox has no means to be moved around like floating QDockWidgets.
> QDockWidget
is a very special widget which is not in the normal graphical widget hirarchy of
the mainwindow. Instead it can be compared to toolbars which are also outside
the widget hirarchy.
PS: This topic seems to be too complicated to discuss here. So let us have a
phone call.
This widget shows tools arranged in tabbed areas.
This might be what you are looking for.
It could also include web pages for example.
But a QToolBox has no means to be moved around like floating QDockWidgets.
> QDockWidget
is a very special widget which is not in the normal graphical widget hirarchy of the mainwindow. Instead it can be compared to toolbars which are also outside the widget hirarchy.
PS: This topic seems to be too complicated to discuss here. So let us have a phone call.
@trevor: ernst is on a business trip. The phone call can't be made before
friday.
@ernst: please call me when you are back
The QDockWidget
http://doc.trolltech.com/4.5/qdockwidget.html
has it's own widget hierarchy.
A solution might be to design the normal mask + the content of the dock widgets
within one design.
You would draw the content of the dock widgets on top of a QFrame for example.
Within the normal mask this QFrame (and all it's children) would be hidet and
the root widget for the dock would be inserted in the QDockWidget.
Thus the QDockWidget could include anything a normal mask can include.
We would only need 1 additional function in our library.
pvAddDockWidget(PARAM *p,const char *title, int dock_id, int root_id, int
floating=1, int allow_left=1, int allow_right=1, int allow_top=1, int
allow_bottom=1);
Where root_id would be the id of a widget on top of the QFrame which is hidden
in the design of the mask.
You can preview dock widgets when you have installed the Qt development package.
See:
http://doc.trolltech.com/4.5/mainwindows-dockwidgets.html
In my opinion dock widgets are relatively complicated for the user especially
when they can be docked. If they are floating only it is easier for the user.
Thus i'm not convinced that support for dock widgets is important for most
scenarios.
Please tell me your opinion.
There is a potential problem in rllib which might crash a program using it:
rlString s1;
rlString s2 = s1; // crash
std::map<int, rlString > theMap;
theMap[1] = s1; // crash
The reason is that rlString is dynamically allocating memory but no copy
constructor and no assignment operator is provided. Thus C++ will make a shallow
copy and the pointer is deleted twice:
rlString::~rlString()
{
delete [] txt;
}
This problem occured in copiing rlSvgAnimator because it has rlString as member
variable.
For anybody needing more informations:
See also http://www.learncpp.com/cpp-tutorial/912-shallow-vs-deep-copying/
> rlString operator=(rlString &s2);
> rlString operator+(rlString &s2);
> will be added.
>
thank you.
The copy constructor is needed, too:
rlString (const rlString &);
The problem occured when using rlSvgAnimator. I changed the following
std::map<std::string, rlSvgAnimator> svgAnimatorMap;
svgAnimatorMap["plant"].setId(az_svg_plant__az_opt_plant__);
to a variant with pointers:
std::map<std::string, rlSvgAnimator * > svgAnimatorMap;
if (!svgAnimatorMap.count("plant") )
svgAnimatorMap["plant"] = new rlSvgAnimator;
svgAnimatorMap["plant"]->setId(az_svg_plant__az_opt_plant__);
The first variant will still not work, because rlSvgAnimator also uses new and
delete without copy constructor and operator=.
Because of the use of the std::map in my example, a copy constructor is called.
Usually it is not wanted to really copy a complex object like rlSvgAnimator.
Therefore an autopointer would be an alternative solution. But I do not know if
the auto pointer of the STL would be sufficient. I am using
boost::shared_pointer.
Hello,
I have many wishes 8-)
I would need not to show user's input in pvInputDialog (for a passphrase)
Now I have introduced a function into my server where the user has to input a
code before he will see any further information. Depending on the code the user
will be recognised and the proper mask is loaded then.
I am using
int pvInputDialog(PARAM *p, int id_return, const char *text, const char
*default_text);
for that.
I guess that QInputDialogue is used internally? Would it be possible to use one
of the following parameters:
QLineEdit::Normal
QLineEdit::NoEcho
QLineEdit::Password
QLineEdit::PasswordEchoOnEdit
--- In pvbrowser@yahoogroups.com, "pvbrowser" <pvbrowser@...> wrote:
>
> This is possible with LineEdit
>
I know, but I wanted to use pvInputDialog.
I am not sure, if I can implement it without problems using LineEdit, because an
other thread might use a different mask.
I think it is possible to use different masks for each threads? I will try...
--- In pvbrowser@yahoogroups.com, "mur_en" <ernst@...> wrote:
> > This is possible with LineEdit
> >
>
> I know, but I wanted to use pvInputDialog.
> I am not sure, if I can implement it without problems using LineEdit, because
an other thread might use a different mask.
> I think it is possible to use different masks for each threads? I will try...
>
It works perfect, thank you Rainer.
Hello,
I discovered your project during my internet search for some free tools for
SCADA development and i find it very interesting. I installed pvbrowser but i
have problems with pvdeveloper: i can't run my server and i can't "make" it
anyhow. The problem seem to be the initial configuration in the batch file. I
followed all the information there but no result. Can anybody help me with a
step-by-step configuration tutorial or something (WINDOWS XP)?
Regards,
Ion
--- In pvbrowser@yahoogroups.com, "boomerion" <boomerion@...> wrote:
>
> Hello,
>
> I discovered your project during my internet search for some free tools for
SCADA development and i find it very interesting. I installed pvbrowser but i
have problems with pvdeveloper: i can't run my server and i can't "make" it
anyhow. The problem seem to be the initial configuration in the batch file. I
followed all the information there but no result. Can anybody help me with a
step-by-step configuration tutorial or something (WINDOWS XP)?
>
> Regards,
> Ion
>
(1)
You must install the Qt development package + MinGW
http://qt.nokia.com/downloads
During installation of Qt you are asked if you want to install MinGW also. The
qmake tool from Qt will be used to create a Makefile for your projects. The Qt
library is only necessary if you want to recompile pvbrowser from source.
(2)
Install pvbrowser
http://pvbrowser.de/pvbrowser/tar/install-pvbrowser.exe
(3)
When pvdevelop is started the first time notepad will pop up.
You can define the environment variables necessary to find MinGW and qmake.
The according file is
pvb/win-mingw/bin/start_pvdevelop.bat
Within this file adjust:
set QTDIR=z:\win\qt
set MINGWDIR=z:\win\mingw
You can define these enviroment variables also in the windows control center.
Then you can start pvdevelop directly.
(4)
pvdevelop should be usable.
click start_pvdevelop.bat.
> pvCreateThread s=1908
This means that a new client has connected and usese socket 1908
> version of pvbrowser client = 4.4.5
This is the version of your client
> initial_mask=
> url=pv://localhost
This is the URL the client used
Up to now everything looks OK.
> but wait a long time , the pvbrowser show but hava a white screen ,print in
> the pvsexample's window:
>
> Thread finished: client does no longer send hello -> terminate thread s=1908
> pvthread_exit
This means that the client did not send any message for a long time.
At least a "hello" message should be send.
But since the server did not receive messages it terminates the connection.
> Then , waiting a long time , the pvbrowser display a error msg for connect
> failed,
It seems the client needed a long time to start the first time.
The "long time" waiting should come from a timeout in the network connection.
> reconncet use url enter key or CTRL+R , it's success quickly.
In this case the client is already running.
It connects to the server and everything is OK.
The problem seems to be that the pvbrowser client needs very long to start on
your system. Thus the server terminates the connection because it does not
receive messages although a client connected.
Try to set
initialhost=pv://localhost
in the Options of pvbrowser to a URL where no pvserver is located.
example:
initialhost=pv://localhost:6000
and start pvbrowser without an initial connection
Then use the URL within pvbrowser to connect.
What happens ?
> I installed the Qt sdk with mingw,
> but how to compile the addone's demo£¿ it's seem need nmake.
You must define the following environment variables.
SET QTDIR=C:\PATH\TO\QT
SET MINGWDIR=C:\PATH\TO\MINGW
In pvbaddon there is a file called login.bat
You can put the above SET commands in there and run
login.bat
All modules within pvbaddon use a project file name.pro
Out of this file qmake will generate a Makefile
%QTDIR%\bin\qmake name.pro -o Makefile
Once you have the makefile you can compile with MinGW
%MINGWDIR%\bin\mingw32-make
I reviewed pvbrowser under windows.
It came out that the client already connects while there are events from the GUI
to process when starting.
Now i first process all events from the GUI that are in the queue before
connecting to the server.
Your problem will be solved by this.
Until next week a new version of pvbrowser will be published.
This version includes the new fetures requested by Ernst Murnleitner, some new
feaures in rllib and the above modification.
I try it, the pvbrowser start only and use the new config file. It's startup slowly yet ,perhaps it's need some time for startup, but I think we should optimize this , make sure the mainwindow show first and show some initialize message .
> but wait a long time , the pvbrowser show but hava a white screen ,print in
> the pvsexample's window:
>
> Thread finished: client does no longer send hello -> terminate thread s=1908
> pvthread_exit
This means that the client did not send any message for a long time.
At least a "hello" message should be send.
But since the server did not receive messages it terminates the connection.
> Then , waiting a long time , the pvbrowser display a error msg for connect
> failed,
It seems the client needed a long time to start the first time.
The "long time" waiting should come from a timeout in the network connection.
> reconncet use url enter key or CTRL+R , it's success quickly.
In this case the client is already running.
It connects to the server and everything is OK.
The problem seems to be that the pvbrowser client needs very long to start on your system. Thus the server terminates the connection because it does not receive messages although a client connected.
Try to set
initialhost=pv://localhost
in the Options of pvbrowser to a URL where no pvserver is located.
example:
initialhost=pv://localhost:6000
and start pvbrowser without an initial connection
Then use the URL within pvbrowser to connect.
I reviewed pvbrowser under windows.
It came out that the client already connects while there are events from the GUI to process when starting.
Now i first process all events from the GUI that are in the queue before connecting to the server.
Your problem will be solved by this.
Until next week a new version of pvbrowser will be published.
This version includes the new fetures requested by Ernst Murnleitner, some new feaures in rllib and the above modification.