This HOWTO is obsolete. You can do everything using "pvbuilder" now. Only read on when you want more detailed info.
copy main.cpp your_dir/main.cpp copy pvapp.h your_dir/pvapp.h copy pvsdemo.pro your_dir/your_server.pro (Linux/Unix) copy pvsdemo.dsp your_dir/your_server.dsp (Windows)
designer
cd your_dir ui2pvc mymask.ui mymask.cpp
/***************************************************************************
pvapp.h - description
-------------------
begin : Sun Nov 12 2000
copyright : (C) 2000 by Rainer Lehrig
email : lehrig@t-online.de
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
* I make one exception to the above statement: *
* You can use this software for commercial purposes *
* if you purchase a license *
* You will not be allowed to make changes to the software *
* *
***************************************************************************/
#ifndef _PVAPP_H_
#define _PVAPP_H_
#include "processviewserver.h"
int show_mymask(PARAM *p);
#endif
/***************************************************************************
main.cpp - description
-------------------
begin : Son Nov 12 09:43:38 CET 2000
copyright : (C) 2000 by Rainer Lehrig
email : lehrig@t-online.de
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
* I make one exception to the above statement: *
* You can use this software for commercial purposes *
* if you purchase a license *
* You will not be allowed to make changes to the software *
* *
***************************************************************************/
#include "pvapp.h"
int pvMain(PARAM *p)
{
int ret;
pvResize(p,0,1280,1024);
ret = 1;
while(1)
{
switch(ret)
{
case 1:
ret = show_mymask(p);
break;
default:
return 0;
}
}
}
#ifdef USE_INETD
int main(int ac, char **av)
{
PARAM p;
pvInit(ac,av,&p);
/* here you may interpret ac,av and set p->user to your data */
pvMain(&p);
return 0;
}
#else // multi threaded server
int main(int ac, char **av)
{
PARAM p;
int s;
pvInit(ac,av,&p);
/* here you may interpret ac,av and set p->user to your data */
while(1)
{
s = pvAccept(&p);
if(s != -1) pvCreateThread(&p,s);
else break;
}
return 0;
}
#endif
######################################################################
# Rainer Lehrig Tue May 28 12:24:03 2002
######################################################################
TEMPLATE = app
CONFIG = warn_on release
# Input
HEADERS += pvapp.h
SOURCES += main.cpp \
mymask.cpp
LIBS += /usr/lib/libpvsmt.so /usr/lib/libpthread.so
qmake your_server.pro -o Makefile make
your_server -port=5050 -sleep=500 -cd=/working/directory Use port = 5050 Cycle Time = 500 milliseconds Working Directory = /working/directory
your_server 5050/tcp # ProcessViewServer your_server
your_server stream tcp nowait root /usr/sbin/tcpd /your/directory/your_server -sleep=200 -cd=/your/directory
$ type your_server_setup.com
$ ucx set service your_server /file=your_disk:[your.directory]your_server_startup.com -
/user=myself -
/protocol=tcp -
/port=5050 -
/process=your_server -
/limit=100
$ ucx enable service your_server
$ ucx show service your_server /full
$ type your_server_startup.com $ set default your_disk:[your.directory] $ your_server :== $ your_disk:[your.directory]your_server.exe $ define/user_mode sys$output nla0: $ your_server -sleep=200
#!/bin/bash designer $1.ui ui2pvc $1.ui $1.cpp makeAnd define an alias in your ~/.bashrc like:
alias pvdesign='~/shell/pvdesign.sh'Then you can simply type:
pvdesign mymaskand everything will be updated automatically
#!/bin/bash # # Create a new ProcessViewServer # cp /usr/share/doc/packages/ProcessView/pvsdemo/pvapp.h . cp /usr/share/doc/packages/ProcessView/pvsdemo/main.cpp . cp /usr/share/doc/packages/ProcessView/pvsdemo/pvsdemo.pro pvs.pro kwrite pvapp.h kwrite main.cpp kwrite pvs.pro qmake pvs.pro -o Makefile