ProviewR Programmer's Reference Manual  V6.1.4
Functions
NMpsAppl Functions

Functions

pwr_tStatus nmpsappl_MirrorInit (pwr_tString80 *cell_array, unsigned long options, nmpsappl_t_ctx *ctx)
 Initialize mirroring. More...
 
pwr_tStatus nmpsappl_Mirror (nmpsappl_t_ctx applctx, int *data_count, nmpsappl_t_datainfo **datainfo)
 Update mirroring. More...
 
pwr_tStatus nmpsappl_RemoveData (nmpsappl_t_ctx applctx, pwr_tObjid objid)
 Removes a dataobject from one of the cells that are mirrored. More...
 
pwr_tStatus nmpsappl_RemoveAndDeleteData (nmpsappl_t_ctx applctx, pwr_tObjid objid)
 Removes and deletes a dataobject from one of the cells that are mirrored. More...
 

Detailed Description

Function Documentation

◆ nmpsappl_Mirror()

pwr_tStatus nmpsappl_Mirror ( nmpsappl_t_ctx  applctx,
int *  data_count,
nmpsappl_t_datainfo **  datainfo 
)

Update mirroring.

nmpsappl_Mirror mirrors the content of one or several cells into an application program.

The function handles direct link of cells and dataobjects, and returns a list of data objects to the application together with information about front, back, select properties, and which data objects are new or has disappeard. The application also receives a pointer to each data object.

The mirroring is initiated by calling nmpsappl_MirrorInit. The cells are mirrored are specified in this call. Then nmpsappl_Mirror is called cyclic to recieve the current content of the cells. All the dataobjects found in the cells are placed in an array, and the order the cells was specified in nmpsappl_MirrorInit determines the order in the dataobject array.

Several mirroring can be handled in the same application (max 32), and each mirroring can handle maximum 32 cells.

Example

#include "pwr_inc:pwr.h"
#include "ssab_inc:rs_nmps_appl.h"
#include "pwrp_inc:pwr_cvolvkvendclasses.h"
main()
{
int i;
int plate_count;
nmpsappl_t_datainfo *plate_info;
pwr_sClass_Plate *plate_ptr;
pwr_tString80 cellnames[] = {
"VKV-END-PF-Plc-W-Svb15",
"VKV-END-PF-Plc-W-R30A",
""};
// Init Proview runtime
sts = gdh_Init( "rs_nmps);
if (EVEN(sts)) LogAndExit( sts);
// Init the mirroring
sts = nmpsappl_MirrorInit( cellnames, nmpsappl_mOption_Remove, &ctx);
if (EVEN(sts)) exit(sts);
for (;;) {
sts = nmpsappl_Mirror( ctx, &plate_count, &plate_info);
for ( i = 0; i < plate_count; i++) {
plate_ptr = plate_info[i].object_ptr;
printf( "%20s %1d %1d %1d %1d %1d %4d %5.1f\n",
plate_info[i].name,
plate_info[i].front,
plate_info[i].back,
plate_info[i].select,
plate_info[i].new,
plate_info[i].removed,
plate_info[i].cell_mask,
plate_ptr->Tjocklek);
}
sleep( 1);
}
}
pwr_tStatus gdh_Init(const char *name)
Initialize the process to the Proview runtime environment.
Definition: rt_gdh.c:2065
char pwr_tString80[80]
80 byte string type.
Definition: pwr.h:412
int pwr_tStatus
Status type.
Definition: pwr.h:284
Returns
pwr_tStatus
Parameters
applctxContext for nmpsappl mirror.
data_countNumber or data object in the array.
datainfoData strucure with dataobjects found in the cells.

Definition at line 449 of file nmps_appl.c.

◆ nmpsappl_MirrorInit()

pwr_tStatus nmpsappl_MirrorInit ( pwr_tString80 cell_array,
unsigned long  options,
nmpsappl_t_ctx ctx 
)

Initialize mirroring.

nmpsappl_MirrorInit initiates a mirroring by specifying the cells that should be mirrored.

Use nmpsappl_Mirror to fetch the mirrored data structure.

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 also
nmpsappl_Mirror
Returns
pwr_tStatus
Parameters
cell_arrayA string array with the names of the cells that should be mirrored. The element after the last cellname should be a NULL string.
optionsBitmask specifying options for the mirroring.
ctxContext pointer.

Definition at line 245 of file nmps_appl.c.

◆ nmpsappl_RemoveAndDeleteData()

pwr_tStatus nmpsappl_RemoveAndDeleteData ( nmpsappl_t_ctx  applctx,
pwr_tObjid  objid 
)

Removes and deletes a dataobject from one of the cells that are mirrored.

See also
nmpsappl_RemoveData
Returns
pwr_tStatus
Parameters
applctxnmpsappl mirror context.
objidObjid for the data object that is to be removed.

Definition at line 720 of file nmps_appl.c.

References EVEN, and gdh_DeleteObject().

◆ nmpsappl_RemoveData()

pwr_tStatus nmpsappl_RemoveData ( nmpsappl_t_ctx  applctx,
pwr_tObjid  objid 
)

Removes a dataobject from one of the cells that are mirrored.

See also
nmpsappl_RemoveAndDeleteData
Returns
pwr_tStatus
Parameters
applctxContext for nmpsappl mirror.
objidObjid for dataobject that is to be removed.

Definition at line 681 of file nmps_appl.c.