Difference between revisions of "Example"
(Blanked the page) |
|||
Line 1: | Line 1: | ||
− | + | <div class="mw-content-ltr" dir="ltr" lang="en"> | |
+ | <p>Proview Designer's Guide Chapter 13</p> | ||
+ | <p><strong>Open Proview</strong></p> | ||
+ | <ul> | ||
+ | <li> Ctrl+E </li> | ||
+ | <li> MB1 $Hier </li> | ||
+ | <li> MB2 right panel </li> | ||
+ | <li> right key on Oxx $Hier </li> | ||
+ | <li> ObjectName application </li> | ||
+ | <li> MB1 ProjectReg </li> | ||
+ | <li> MB2 in application $Hier </li> | ||
+ | <li> right key on Oxx $ProjectReg </li> | ||
+ | <li> ObjectName cpp </li> | ||
+ | <li> Ctrl+E </li> | ||
+ | <li> Yes </li> | ||
+ | <li> Yes </li> | ||
+ | <li> MB3 cpp Open Project... </li> | ||
+ | <li> Next </li> | ||
+ | <li> Next </li> | ||
+ | <li> No </li> | ||
+ | <li> Next </li> | ||
+ | <li> Next </li> | ||
+ | <li> Next </li> | ||
+ | <li> Next </li> | ||
+ | <li> Yes </li> | ||
+ | </ul> | ||
+ | <p><strong>Configure RootVolume</strong></p> | ||
+ | <ul> | ||
+ | <li> Next </li> | ||
+ | <li> Next </li> | ||
+ | <li> Next </li> | ||
+ | </ul> | ||
+ | <ul> | ||
+ | <li> MB1 Plant -> $PlantHier </li> | ||
+ | <li> MB2 right panel </li> | ||
+ | <li> right key on Oxx $PlantHier </li> | ||
+ | <li> ObjectName plant </li> | ||
+ | <li> MB1 AllClases -> pwrb -> XyCurve </li> | ||
+ | <li> MB2 in plant $PlantHier </li> | ||
+ | <li> right key on Oxx XyCurve </li> | ||
+ | <li> ObjectName curve </li> | ||
+ | <li> Ctrl+E </li> | ||
+ | <li> Yes </li> | ||
+ | </ul> | ||
+ | <p><em><strong>/usr/local/pwrp/cpp/src/appl/ra_myappl.cpp</strong></em></p> | ||
+ | <table border="0"> | ||
+ | <tbody> | ||
+ | <tr> | ||
+ | <td> | ||
+ | <p>#include <math.h><br />#include "pwr.h"<br />#include "pwr_baseclasses.hpp"<br />#include "rt_gdh.h"<br /><br /><br />class ra_myappl {<br /> pwr_Class_XyCurve *curve_ptr;<br /> pwr_tRefId dlid;<br />public:<br /> ra_myappl() {}<br /> void init();<br /> void scan();<br /> void close();<br />};<br /><br />void ra_myappl::init()<br />{<br /> pwr_tStatus sts;<br /> pwr_tOName name = "plant-curve";<br /> <br /> // Connect to database<br /> sts = gdh_Init( "ra_myappl");<br /> if ( EVEN(sts)) exit(0);<br /><br /> // Direct link to curve object<br /> sts = gdh_RefObjectInfo( name, (void **)&curve_ptr, &dlid, sizeof(*curve_ptr));<br /> if ( EVEN(sts)) exit(0);<br />}<br /><br />void ra_myappl::scan()<br />{<br /> for ( unsigned int i = 0;;i++) {<br /> if ( i % 5 == 0) {<br /> // Calculate x and y coordinates for a sine curve every fifth second<br /> for ( int j = 0; j < 100; j++) {<br /> curve_ptr->XValue[j] = j;<br /> curve_ptr->YValue[j] = 50 + 50 * sin( 2.0 * M_PI * (j + i) / 100);<br /> }<br /> // Indicate new curve to graph<br /> curve_ptr->Update = 1;<br /> }<br /> else if ( i % 5 == 2)<br /> curve_ptr->Update = 0;<br /> sleep(1);<br /> if ( i > 360)<br /> i = 0;<br /> }<br />}<br /><br />void ra_myappl::close()<br />{<br /> gdh_UnrefObjectInfo( dlid);<br />}<br /><br /><br />int main()<br />{<br /> ra_myappl myappl;<br /> <br /> myappl.init();<br /> myappl.scan(); <br /> myappl.close();<br />}</p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </tbody> | ||
+ | </table> | ||
+ | <br /> | ||
+ | <p><strong>On terminal</strong></p> | ||
+ | $ sdf cpp $ cd /usr/local/pwrp/cpp/src/appl/ $ g++ -g -c ra_myappl.cpp -o $pwrp_obj/ra_myappl.o -I$pwr_inc -DOS_LINUX=1 -DOS=linux -DHW_X86=1 -DHW=x86 $ g++ -g -o $pwrp_exe/ra_myappl $pwrp_obj/ra_myappl.o $pwr_obj/pwr_msg_rt.o -L$pwr_lib -lpwr_rt -lpwr_co -lpwr_msg_dummy -lrt | ||
+ | <p><br /> <strong>On proview</strong></p> | ||
+ | <ul> | ||
+ | <li> Shift+Ctrl+B Node + B </li> | ||
+ | <li> Tools -> Runtime Monitor </li> | ||
+ | <li> Start Runtime </li> | ||
+ | <li> File -> Start Runtime Navigator </li> | ||
+ | <li> right key Database </li> | ||
+ | <li> right key plant </li> | ||
+ | <li> MB3 curve Object Graph </li> | ||
+ | </ul> | ||
+ | <p><br /> <strong>On terminal</strong></p> | ||
+ | $ ra_myappl</div> |
Revision as of 04:53, 21 August 2013
Proview Designer's Guide Chapter 13
Open Proview
- Ctrl+E
- MB1 $Hier
- MB2 right panel
- right key on Oxx $Hier
- ObjectName application
- MB1 ProjectReg
- MB2 in application $Hier
- right key on Oxx $ProjectReg
- ObjectName cpp
- Ctrl+E
- Yes
- Yes
- MB3 cpp Open Project...
- Next
- Next
- No
- Next
- Next
- Next
- Next
- Yes
Configure RootVolume
- Next
- Next
- Next
- MB1 Plant -> $PlantHier
- MB2 right panel
- right key on Oxx $PlantHier
- ObjectName plant
- MB1 AllClases -> pwrb -> XyCurve
- MB2 in plant $PlantHier
- right key on Oxx XyCurve
- ObjectName curve
- Ctrl+E
- Yes
/usr/local/pwrp/cpp/src/appl/ra_myappl.cpp
#include <math.h> |
On terminal
$ sdf cpp $ cd /usr/local/pwrp/cpp/src/appl/ $ g++ -g -c ra_myappl.cpp -o $pwrp_obj/ra_myappl.o -I$pwr_inc -DOS_LINUX=1 -DOS=linux -DHW_X86=1 -DHW=x86 $ g++ -g -o $pwrp_exe/ra_myappl $pwrp_obj/ra_myappl.o $pwr_obj/pwr_msg_rt.o -L$pwr_lib -lpwr_rt -lpwr_co -lpwr_msg_dummy -lrt
On proview
- Shift+Ctrl+B Node + B
- Tools -> Runtime Monitor
- Start Runtime
- File -> Start Runtime Navigator
- right key Database
- right key plant
- MB3 curve Object Graph
On terminal