Commit 7962453d authored by Claes Sjofors's avatar Claes Sjofors

PRM update with pdf output

parent 19879b4c
...@@ -263,26 +263,28 @@ static pwr_tStatus nmpsappl_cell_init( ...@@ -263,26 +263,28 @@ static pwr_tStatus nmpsappl_cell_init(
} }
/** /**
*@brief Initierar spegling. *@brief Initialize mirroring.
* *
* Med nmpsappl_MirrorInit initierar man en spegling genom att ange de celler som ska speglas. * nmpsappl_MirrorInit initiates a mirroring by specifying the cells that should
* Man fr till baka en context som anvnds fr att skilja olika speglingar t. * be mirrored.
* Efter initieringen anropas nmpsappl_Mirror cykliskt fr att f information om cellinnehllet.
* *
* * Use nmpsappl_Mirror to fetch the mirrored data structure.
*@return pwr_tStatus *
* The option argument is a bitmask where the bits specifies different functions
* in nmpsappl_mirror:
* - nmpsappl_mOption_Remove Dataobject that is removed since the last call of
* nmpsappl_Mirror is added to the dataobject list with the remove flags set.
* - nmpsappl_mOption_NamePath The name field for a dataobject in the datastructure
* returned by nmpsappl_Mirror contains the path.
*
* @see nmpsappl_Mirror
* @return pwr_tStatus
*/ */
pwr_tStatus pwr_tStatus
nmpsappl_MirrorInit( nmpsappl_MirrorInit(
pwr_tString80 *cell_array, /**< En vektor som innehller namnet p de celler som ska speglas. pwr_tString80 *cell_array, /**< A string array with the names of the cells that should be mirrored. The element after the last cellname should be a NULL string. */
De speglade dataobjekten ordnas i den ordning cellerna anges i vektorn. unsigned long options, /**< Bitmask specifying options for the mirroring.*/
En NULL-string markerar sista cellnamnet. */ nmpsappl_t_ctx *ctx /**< Context pointer. */
unsigned long options, /**< Options r en bitmask. Bitarna anger olika funktioner fr nmpsappl_mirror:
nmpsappl_mOption_Remove - Dataobjekt som har frsvunnit frn de angivna cellerna sedan senaste
anropet lggs med i dataobjektlistan med remove-flaggan satt.
nmpsappl_mOption_NamePath - Namnfltet i den datastruktur som returneras fr ett dataobjekt
p dataobjektet innehller hierarkinamnet. */
nmpsappl_t_ctx *ctx /**< En kontext-pekare som skickas med till nmpsappl_mirror rutinen. */
) )
{ {
pwr_tString80 *cellname; pwr_tString80 *cellname;
...@@ -422,64 +424,58 @@ nmpsappl_MirrorInit( ...@@ -422,64 +424,58 @@ nmpsappl_MirrorInit(
} }
/** /**
*@brief Anropas cykliskt fr att uppdatera speglingen. *@brief Update mirroring.
* *
* Rutinen fyller i en lista p samtliga dataobjekt som finns i cellerna. * nmpsappl_Mirror mirrors the content of one or several cells into an application
* Listan r av typen nmpsappl_t_datainfo. (lnk till structdef?) * program.
* *
* nmpsappl_mirror speglar innehllet i en eller flera celler till ett applikationsprogram. * The function handles direct link of cells and dataobjects, and returns a list of
* Funktionen hanterar direktlnkning av celler och dataobjekt och returnerar ej lista p dataobjekt till applikationen, * data objects to the application together with information about front, back, select
* tillsammans med information om bakkant, framkant, utval, vilka objekt som r nya eller har frsvunnit, vilken cell ett objekt tillhr. * properties, and which data objects are new or has disappeard. The application also
* Applikationen frses ven med pekare till dataobjekten. * receives a pointer to each data object.
* *
* Man initierar en spegling genom att anropar rutinen nmpsappl_MirrorInit. * The mirroring is initiated by calling nmpsappl_MirrorInit. The cells are
* Som argument skickar man med en lista p de celler som ska speglas. * mirrored are specified in this call. Then nmpsappl_Mirror is called cyclic
* Sedan anropas nmpsappl_Mirror cykliskt fr att f information om vilka dataobjekt som ligger i cellerna. * to recieve the current content of the cells. All the dataobjects found in the
* Alla dataobjekt som finns i den angivna cellerna bakas ihop i en vektor, * cells are placed in an array, and the order the cells was specified in
* och ordningen bestmms av den ordning man angivit cellerna till nmpsappl_MirrorInit. * nmpsappl_MirrorInit determines the order in the dataobject array.
*
* Flera speglingar (max 32 st) kan hanteras i samma program, och varje spegling omfattar maximalt 32 celler.
* Samma cell kan tillhra flera speglingar.
* Man kan t ex spegla samtliga celler i systemet i en array, samtidigt som man speglar enstaka celler, eller urval av celler i andra arrayer.
*
*
* Exempel
* *
* Several mirroring can be handled in the same application (max 32), and each
* mirroring can handle maximum 32 cells.
*
* Exempel
* @code
* #include "pwr_inc:pwr.h" * #include "pwr_inc:pwr.h"
* #include "ssab_inc:rs_nmps_appl.h" * #include "ssab_inc:rs_nmps_appl.h"
* #include "pwrp_inc:pwr_cvolvkvendclasses.h" * #include "pwrp_inc:pwr_cvolvkvendclasses.h"
* *
* main() * main()
* { * {
* nmpsappl_t_ctx ctx; * nmpsappl_t_ctx ctx;
* int i; * int i;
* int plate_count; * int plate_count;
* nmpsappl_t_datainfo *plate_info; * nmpsappl_t_datainfo *plate_info;
* pwr_tStatus sts; * pwr_tStatus sts;
* pwr_sClass_Plate *plate_ptr; * pwr_sClass_Plate *plate_ptr;
* pwr_tString80 cellnames[] = { * pwr_tString80 cellnames[] = {
* "VKV-END-PF-Pltfljning-W-Svb15", * "VKV-END-PF-Plc-W-Svb15",
* "VKV-END-PF-Pltfljning-W-R30A", * "VKV-END-PF-Plc-W-R30A",
* ""}; * ""};
* *
* // Init pams and gdh * // Init Proview runtime
* sts = gdh_Init( 0, NULL); * sts = gdh_Init( "rs_nmps);
* if (EVEN(sts)) LogAndExit( sts); * if (EVEN(sts)) LogAndExit( sts);
* *
* // Init the mirroring * // Init the mirroring
* sts = nmpsappl_MirrorInit( cellnames, * sts = nmpsappl_MirrorInit( cellnames, nmpsappl_mOption_Remove, &ctx);
* nmpsappl_mOption_Remove, &ctx); * if (EVEN(sts)) exit(sts);
* if (EVEN(sts)) exit(sts);
* *
* for (;;) * for (;;) {
* { * sts = nmpsappl_Mirror( ctx, &plate_count, &plate_info);
* sts = nmpsappl_Mirror( ctx, &plate_count,
* &plate_info);
* *
* for ( i = 0; i < plate_count; i++) * for ( i = 0; i < plate_count; i++) {
* { * plate_ptr = plate_info[i].object_ptr;
* plate_ptr = plate_info[i].object_ptr; * printf( "%20s %1d %1d %1d %1d %1d %4d %5.1f\n",
* printf( "%20s %1d %1d %1d %1d %1d %4d %5.1f\n",
* plate_info[i].name, * plate_info[i].name,
* plate_info[i].front, * plate_info[i].front,
* plate_info[i].back, * plate_info[i].back,
...@@ -488,18 +484,18 @@ nmpsappl_MirrorInit( ...@@ -488,18 +484,18 @@ nmpsappl_MirrorInit(
* plate_info[i].removed, * plate_info[i].removed,
* plate_info[i].cell_mask, * plate_info[i].cell_mask,
* plate_ptr->Tjocklek); * plate_ptr->Tjocklek);
* } * }
* sleep( 1); * sleep( 1);
* } * }
* } * }
* *@endcode
*@return pwr_tStatus *@return pwr_tStatus
*/ */
pwr_tStatus pwr_tStatus
nmpsappl_Mirror( nmpsappl_Mirror(
nmpsappl_t_ctx applctx, /**< En kontext-pekare som erhlls vid anrop till nmpsappl_mirror_init. */ nmpsappl_t_ctx applctx, /**< Context for nmpsappl mirror. */
int *data_count, /**< Antal dataobjekt i dataobjekts-listan. */ int *data_count, /**< Number or data object in the array. */
nmpsappl_t_datainfo **datainfo /**<Lista p dataobjekten i cellerna. */ nmpsappl_t_datainfo **datainfo /**< Data strucure with dataobjects found in the cells. */
) )
{ {
int i, j, k; int i, j, k;
...@@ -752,15 +748,15 @@ nmpsappl_Mirror( ...@@ -752,15 +748,15 @@ nmpsappl_Mirror(
} }
/** /**
*@brief Tar bort ett dataobjekt ur de celler som speglas. *@brief Removes a dataobject from one of the cells that are mirrored.
*
* *
*@see nmpsappl_RemoveAndDeleteData
*@return pwr_tStatus *@return pwr_tStatus
*/ */
pwr_tStatus pwr_tStatus
nmpsappl_RemoveData( nmpsappl_RemoveData(
nmpsappl_t_ctx applctx, /**< Kontext-pekare som erhlls vid anrop till nmpsappl_mirror_init. */ nmpsappl_t_ctx applctx, /**< Context for nmpsappl mirror. */
pwr_tObjid objid /**< Objid fr dataobjekt som ska tas bort. */ pwr_tObjid objid /**< Objid for dataobject that is to be removed. */
) )
{ {
int k; int k;
...@@ -791,16 +787,15 @@ nmpsappl_RemoveData( ...@@ -791,16 +787,15 @@ nmpsappl_RemoveData(
/** /**
*@brief Tar bort ett dataobjekt ur de celler som speglas. *@brief Removes and deletes a dataobject from one of the cells that are mirrored.
*
* Tar bort ett dataobjekt ur de celler som speglas. Dessutom tas objektet bort ur databasen.
* *
*@see nmpsappl_RemoveData
*@return pwr_tStatus *@return pwr_tStatus
*/ */
pwr_tStatus pwr_tStatus
nmpsappl_RemoveAndDeleteData( nmpsappl_RemoveAndDeleteData(
nmpsappl_t_ctx applctx, /**< Kontext-pekare som erhlls vid anrop till nmpsappl_mirror_init. */ nmpsappl_t_ctx applctx, /**< nmpsappl mirror context. */
pwr_tObjid objid /**< Objid fr dataobjekt som ska tas bort. */ pwr_tObjid objid /**< Objid for the data object that is to be removed. */
) )
{ {
int sts, k; int sts, k;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
This include file contains the Proview NMps type definitions. This include file contains the Proview NMps type definitions.
*/ */
/** @addtogroup NMps */ /** @addtogroup NMpsAppl */
/*@{*/ /*@{*/
#if defined __cplusplus #if defined __cplusplus
...@@ -46,7 +46,7 @@ extern "C" { ...@@ -46,7 +46,7 @@ extern "C" {
#define nmpsappl_mOption_ReverseOrder (1 << 2) #define nmpsappl_mOption_ReverseOrder (1 << 2)
/** @defgroup NMPS_DS Data Structures /** @defgroup NMPS_DS NMpsAppl Data Structures
* @ingroup NMps * @ingroup NMps
* @{ * @{
*/ */
...@@ -65,15 +65,31 @@ typedef struct nmpsappl_s_cellist { ...@@ -65,15 +65,31 @@ typedef struct nmpsappl_s_cellist {
} nmpsappl_t_cellist; } nmpsappl_t_cellist;
typedef struct { typedef struct {
pwr_tObjid objid; /**< Dataobjektets objid */ pwr_tObjid objid; /**< Dataobject objid */
pwr_tString80 name; /**< Dataobjektet namn (sista namnledet) */ pwr_tString80 name; /**< Dataobject name (last segment) */
pwr_tAddress object_ptr; /**< Pekare till dataobjektet */ pwr_tAddress object_ptr; /**< Pointer to data object */
pwr_tBoolean select; /**< Select-attributet fr dataobjektet i cell-objektet. Om ett dataobjekt ligger i flera celler, stts select om objektet r utvalt i minst en av cellerna. */ pwr_tBoolean select; /**< The select attribute for the dataobject in the
pwr_tBoolean front; /**< Front-attributet fr dataobjektet i cell-objektet. Om ett dataobjekt ligger i flera celler, stts front om front-flaggen r satt i en av cellerna. */ cell object. If the dataobject is present in several
pwr_tBoolean back; /**< Back-attributet fr dataobjektet i cell-objektet. Om ett dataobjekt ligger i flera celler, stts back om back-flaggen r satt i en av cellerna. */ cells, select is set if the dataobject is selected
pwr_tBoolean newdata; /**< Markerar att ett dataobjekt r nytt sedan senaste speglingen.*/ in at least one of the cells. */
pwr_tBoolean removed; /**< Markerar att dataobjektet har frsvunnit sedan senaste speglingen. Krver att nmpsappl_mOption_Remove har angetts i options. */ pwr_tBoolean front; /**< The Front attribute for the dataobject in the cell
unsigned long cell_mask; /**< Anger vilken eller vilka celler dataobjektet befinner sig i. cell_mask r en bitmask dr frsta biten anger frsta cellen (dvs den som angivits frst i listan till nmpsappl_mirror_init), osv. */ object. If the dataobject is present in several
cells, front is set if the Front flag is set in one
of the cells. */
pwr_tBoolean back; /**< The Back attribute for the dataobject in the cell
object. If the dataobject is present in several
cells, back is set if the Back flag is set in one
of the cells. */
pwr_tBoolean newdata; /**< Marks that a data object is new since the last
mirror. */
pwr_tBoolean removed; /**< Marks that the dataobject has disappeard since
the last mirror. Requires the the option
nmpsappl_mOption_Remove is selected. */
unsigned long cell_mask; /**< Mask that specifies in which cell or which
cells the dataobject resides. The first bit
corresponds to the first cell, i.e. the first
cell in cell list supplied to nmpsappl_MirrorInit,
etc. */
} nmpsappl_t_datainfo; } nmpsappl_t_datainfo;
typedef struct nmpsappl_s_ctx { typedef struct nmpsappl_s_ctx {
...@@ -90,7 +106,7 @@ typedef struct nmpsappl_s_ctx { ...@@ -90,7 +106,7 @@ typedef struct nmpsappl_s_ctx {
/** @} */ /** @} */
/** /**
* @defgroup NMPS_FC Function Calls * @defgroup NMPS_FC NMpsAppl Functions
* @ingroup NMps * @ingroup NMps
* @{ * @{
*/ */
......
This diff is collapsed.
This diff is collapsed.
...@@ -41,7 +41,18 @@ $(clean_html) : clean_%.html : %.html ...@@ -41,7 +41,18 @@ $(clean_html) : clean_%.html : %.html
$(doc_dir)/prm/index.html : ../../doxygen.dx $(doc_dir)/prm/index.html : ../../doxygen.dx
@ echo "doxygen documentation $(source) $(target)" @ echo "doxygen documentation $(source) $(target)"
@ doxygen @ doxygen
@ if [ -e latex ]; then \
./repl.sh latex/*.tex; \
cd latex; \
make pdf; \
cp refman.pdf $(pwr_doc)/en_us/man_prm.pdf; \
cp classra__appl.pdf $(pwr_doc)/en_us/; \
cp classrt__appl.pdf $(pwr_doc)/en_us/; \
cd ..; \
rm -r -f latex; \
rm -f repl.sed; \
rm -f repl.tmp; \
fi
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
/*@{*/ /*@{*/
/** @defgroup rt_ex Example applications /** @defgroup rt_ex Application examples
* @ingroup NMps * @ingroup applex
* @{ * @{
*/ */
#include "pwr.h" #include "pwr.h"
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
//! A simple c++ application example //! A simple c++ application example
/*! ra_appl is a subclass to rt_appl and implements the virtual /*! ra_appl is a subclass to rt_appl and implements the virtual
* functions open(), close(), and scan(). * functions open(), close(), and scan().
*
* @see ra_appl.cpp
*/ */
class ra_appl : public rt_appl { class ra_appl : public rt_appl {
public: public:
...@@ -53,159 +55,6 @@ int main() ...@@ -53,159 +55,6 @@ int main()
appl.mainloop(); appl.mainloop();
} }
#include "pwr.h"
#include "rt_gdh.h"
#include "rt_errh.h"
#include "rt_aproc.h"
#include "rt_pwr_msg.h"
#include "rt_qcom_msg.h"
#include "rt_ini_event.h"
#include "co_error.h"
//! Advanced c++ application example
/*! Example of a proview application program
*/
class MyAppl {
public:
MyAppl() {}
void init( qcom_sQid *qid);
void open();
void close();
void scan();
float scantime() { return 1.0;}
};
void MyAppl::init( qcom_sQid *qid)
{
qcom_sQid qini;
qcom_sQattr qAttr;
pwr_tStatus sts;
// Init error and status logger with a unic application index per node.
errh_Init( "rs_appl", errh_eAnix_appl1);
errh_SetStatus( PWR__APPLSTARTUP);
// Init database
sts = gdh_Init("rs_appl");
if ( EVEN(sts)) {
errh_Fatal( "gdh_Init, %m", sts);
errh_SetStatus( PWR__APPLTERM);
exit(sts);
}
// Create a queue to receive stop and restart events
if (!qcom_Init(&amp;sts, 0, "rs_appl")) {
errh_Fatal("qcom_Init, %m", sts);
errh_SetStatus( PWR__APPLTERM);
exit(sts);
}
qAttr.type = qcom_eQtype_private;
qAttr.quota = 100;
if (!qcom_CreateQ(&amp;sts, qid, &amp;qAttr, "events")) {
errh_Fatal("qcom_CreateQ, %m", sts);
errh_SetStatus( PWR__APPLTERM);
exit(sts);
}
qini = qcom_cQini;
if (!qcom_Bind(&amp;sts, qid, &amp;qini)) {
errh_Fatal("qcom_Bind(Qini), %m", sts);
errh_SetStatus( PWR__APPLTERM);
exit(-1);
}
}
void MyAppl::open()
{
pwr_tOid oid;
pwr_tStatus sts;
// Get configuration object
sts = gdh_NameToObjid( "Noder-Node-MyAppl", &amp;oid);
if ( EVEN(sts)) throw co_error(sts);
aproc_RegisterObject( oid);
// Link to database objects
}
void MyAppl::close()
{
// Unlink to database objects
}
void MyAppl::scan()
{
aproc_TimeStamp();
// Do something
}
int main()
{
pwr_tStatus sts;
MyAppl appl;
int tmo;
char mp[2000];
qcom_sQid qid = qcom_cNQid;
qcom_sGet get;
int swap = 0;
bool first_scan = true;
appl.init( &amp;qid);
try {
appl.open();
}
catch ( co_error&amp; e) {
errh_Error( (char *)e.what().c_str());
errh_Fatal( "rs_appl aborting");
errh_SetStatus( PWR__APPLTERM);
exit(0);
}
aproc_TimeStamp();
errh_SetStatus( PWR__ARUN);
first_scan = true;
for (;;) {
if ( first_scan) {
tmo = (int) (appl.scantime() * 1000 - 1);
}
get.maxSize = sizeof(mp);
get.data = mp;
qcom_Get( &amp;sts, &amp;qid, &amp;get, tmo);
if (sts == QCOM__TMO || sts == QCOM__QEMPTY) {
if ( !swap)
appl.scan();
}
else {
ini_mEvent new_event;
qcom_sEvent *ep = (qcom_sEvent*) get.data;
new_event.m = ep-&gt;mask;
if (new_event.b.oldPlcStop &amp;&amp; !swap) {
errh_SetStatus( PWR__APPLRESTART);
swap = 1;
appl.close();
} else if (new_event.b.swapDone &amp;&amp; swap) {
swap = 0;
appl.open();
errh_SetStatus( PWR__ARUN);
} else if (new_event.b.terminate) {
exit(0);
}
}
first_scan = false;
}
}
/** @} */ /** @} */
/** @} */ /** @} */
...@@ -24,7 +24,9 @@ ...@@ -24,7 +24,9 @@
<h2 id="mainmenu">Reference Manuals</h2> <h2 id="mainmenu">Reference Manuals</h2>
<table id="mainmenu" border="1" cellspacing="0" width="100%"> <table id="mainmenu" border="1" cellspacing="0" width="100%">
<tr><td id="mainmenu"><a id="mainmenu" href="orm_f.html" target="_top">Object Reference Manual</a></td></tr> <tr><td id="mainmenu"><a id="mainmenu" href="orm_f.html" target="_top">Object Reference Manual</a></td></tr>
<tr><td id="mainmenu"><a id="mainmenu" href="prm_f.html" target="_top">API Reference</a></td></tr> <tr><td id="mainmenu"><a id="mainmenu" href="prm_f.html" target="_top">Programmer's Reference Manual</a>
<a id="mainmenulink" href="prm_f.html" target="top"><br>(html),</a>
<a id="mainmenulink" href="man_prm.pdf" target="right">(pdf)</a></td></tr>
</table> </table>
<h2 id="mainmenu">Guides</h2> <h2 id="mainmenu">Guides</h2>
<table id="mainmenu" border="1" cellspacing="0" width="100%"> <table id="mainmenu" border="1" cellspacing="0" width="100%">
......
...@@ -24,7 +24,9 @@ ...@@ -24,7 +24,9 @@
<h2 id="mainmenu">Referens</h2> <h2 id="mainmenu">Referens</h2>
<table id="mainmenu" border="1" cellspacing="0" width="100%"> <table id="mainmenu" border="1" cellspacing="0" width="100%">
<tr><td id="mainmenu"><a id="mainmenu" href="orm_f.html" target="_top">Objekthandbok (ORM)</a></td></tr> <tr><td id="mainmenu"><a id="mainmenu" href="orm_f.html" target="_top">Objekthandbok (ORM)</a></td></tr>
<tr><td id="mainmenu"><a id="mainmenu" href="../en_us/prm_f.html" target="_top">API-handbok (PRM)</a></td></tr> <tr><td id="mainmenu"><a id="mainmenu" href="../en_us/prm_f.html" target="_top">API-handbok</a>
<a id="mainmenulink" href="../en_us/prm_f.html" target="top"><br>(html),</a>
<a id="mainmenulink" href="../en_us/man_prm.pdf" target="right">(pdf)</a></td></tr>
</table> </table>
<h2 id="mainmenu">Guider</h2> <h2 id="mainmenu">Guider</h2>
<table id="mainmenu" border="1" cellspacing="0" width="100%"> <table id="mainmenu" border="1" cellspacing="0" width="100%">
......
...@@ -45,7 +45,7 @@ extern "C" { ...@@ -45,7 +45,7 @@ extern "C" {
needed to use CDH. needed to use CDH.
*/ */
/*! \defgroup Cdh_DS Data Structures /*! \defgroup Cdh_DS Cdh Data Structures
\ingroup Cdh \ingroup Cdh
*/ */
...@@ -444,6 +444,15 @@ typedef union { ...@@ -444,6 +444,15 @@ typedef union {
//! Name string format description. //! Name string format description.
/*! /*!
Bitmask that denotes an object or attriubte name string, i.e. which components of the
name that is included in the string.<br>
Some common examples are
<b>cdh_mName_object</b> Object.<br>
<b>cdh_mName_object | cdh_mName_attribute</b> Object and attribute.<br>
<b>cdh_mName_pathStrict</b> Path, object and attribute<br>
<b>cdh_mName_volumeStrict</b> Volume, path, object and attribute.
Let us assume we have an object of class Ai. Let us assume we have an object of class Ai.
The object has an attribute called FilterAttribute. The object has an attribute called FilterAttribute.
...@@ -663,7 +672,12 @@ typedef struct { ...@@ -663,7 +672,12 @@ typedef struct {
} cdh_sParseName; } cdh_sParseName;
/*@}*/ /*@}*/
/*! \addtogroup Cdh */
/*! \defgroup Cdh_FC Cdh Functions
\ingroup Cdh
*/
/*! \addtogroup Cdh_FC */
/*@{*/ /*@{*/
/* Function prototypes to exported functions. */ /* Function prototypes to exported functions. */
......
...@@ -56,9 +56,15 @@ typedef unsigned int time_tClock; ...@@ -56,9 +56,15 @@ typedef unsigned int time_tClock;
This include file contains definitions and function prototypes This include file contains definitions and function prototypes
needed to use time functions. needed to use time functions.
*/ */
/*! \addtogroup Time */
/*! \defgroup Time_DS Time Data Structures
\ingroup Time
*/
/*! \addtogroup Time_DS */
/*@{*/ /*@{*/
//! Time string format //! Time string format
typedef enum { typedef enum {
time_eFormat_DateAndTime = 0, //!< Display date and time, 01-JAN-1970 01:00:00.00 time_eFormat_DateAndTime = 0, //!< Display date and time, 01-JAN-1970 01:00:00.00
...@@ -92,6 +98,15 @@ typedef enum { ...@@ -92,6 +98,15 @@ typedef enum {
); );
#endif #endif
/*@}*/
/*! \defgroup Time_FC Time Functions
\ingroup Time
*/
/*! \addtogroup Time_FC */
/*@{*/
int time_IsNull (pwr_tTime *t1); int time_IsNull (pwr_tTime *t1);
pwr_tTime * time_Aabs (pwr_tTime*, pwr_tTime*); pwr_tTime * time_Aabs (pwr_tTime*, pwr_tTime*);
pwr_tTime * time_Aadd (pwr_tTime*, pwr_tTime*, pwr_tDeltaTime*); pwr_tTime * time_Aadd (pwr_tTime*, pwr_tTime*, pwr_tDeltaTime*);
......
...@@ -36,20 +36,43 @@ ...@@ -36,20 +36,43 @@
*/ */
class rt_appl { class rt_appl {
public: public:
rt_appl( char *name, errh_eAnix anix,
double scantime = 1.0, qcom_sQid qid = qcom_cNQid) : //! Constructor.
m_anix(anix), m_scantime(scantime), m_qid(qid) rt_appl(
char *name, //< Process name.
errh_eAnix anix, //< Application index.
double scantime = 1.0, //< Scantime for call of the scan() function.
qcom_sQid qid = qcom_cNQid //< Qcom queue identity.
) : m_anix(anix), m_scantime(scantime), m_qid(qid)
{ strcpy( m_name, name); } { strcpy( m_name, name); }
void init(); void init();
virtual void open() {};
virtual void close() {};
virtual void scan() {};
void register_appl( char *name); void register_appl( char *name);
void mainloop(); void mainloop();
double scantime() { return m_scantime;} double scantime() { return m_scantime;}
void set_scantime( double time) { m_scantime = time;} void set_scantime( double time) { m_scantime = time;}
pwr_tOid& apploid() { return m_apploid;} pwr_tOid& apploid() { return m_apploid;}
//! Initialize the application.
/*! The open() function is called after initialization, and may contain setup of
direct links to objects and attributes in the realtime database.
The open() function is also called after a soft restart.
*/
virtual void open() {};
//! Closes the application.
/*! the close() is called when a restart or stop event is received. It should
unlink to all direct links.
*/
virtual void close() {};
//! Cyclic function.
/*! The scan() function is called cyclic with the scantime specified in the constructor.
In this function all the control and supervision work of the application is placed.
*/
virtual void scan() {};
virtual ~rt_appl() {} virtual ~rt_appl() {}
private: private:
......
This diff is collapsed.
This diff is collapsed.
...@@ -46,7 +46,7 @@ extern "C" { ...@@ -46,7 +46,7 @@ extern "C" {
#endif #endif
/** @defgroup MSGH_DS Data Structures /** @defgroup MSGH_DS MhAppl Data Structures
* @ingroup MSGH * @ingroup MSGH
* @{ * @{
*/ */
...@@ -117,14 +117,10 @@ struct mhs_ApplMessage { ...@@ -117,14 +117,10 @@ struct mhs_ApplMessage {
/**@}*/ /**@}*/
/** @defgroup MSGH_FC Function Calls /** @defgroup MSGH_FC MhAppl Functions
* @ingroup MSGH * @ingroup MSGH
* @{ * @{
*/ */
/** @defgroup MSG_AR Application routines
* @ingroup MSGH_FC
* @{
*/
pwr_tStatus mh_ApplCancel ( pwr_tStatus mh_ApplCancel (
pwr_tUInt32 id, pwr_tUInt32 id,
...@@ -175,7 +171,6 @@ pwr_tStatus mh_ApplGetMsgInfo ( ...@@ -175,7 +171,6 @@ pwr_tStatus mh_ApplGetMsgInfo (
mh_sApplMessage *Message mh_sApplMessage *Message
); );
/**@}*/
/**@}*/ /**@}*/
/**@}*/ /**@}*/
......
...@@ -82,7 +82,7 @@ extern "C" ...@@ -82,7 +82,7 @@ extern "C"
#define qcom_cInacp (1<<31 | 106) #define qcom_cInacp (1<<31 | 106)
#define qcom_cIini (1<<31 | 107) #define qcom_cIini (1<<31 | 107)
/** @defgroup QCOM_DS Data Structures /** @defgroup QCOM_DS Qcom Data Structures
* @ingroup QCOM * @ingroup QCOM
* @{ * @{
*/ */
...@@ -244,7 +244,7 @@ typedef struct { ...@@ -244,7 +244,7 @@ typedef struct {
/** @} */ /** @} */
/** @defgroup QCOM_FC Function Calls /** @defgroup QCOM_FC Qcom Functions
* @ingroup QCOM * @ingroup QCOM
* @{ * @{
*/ */
......
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