Commit 9af2f4fd authored by Claes Sjofors's avatar Claes Sjofors

Plc data and NMps, class DataRefv added and type DataRef used for data references

parent 1bcb5424
......@@ -374,14 +374,14 @@ static pwr_tStatus nmpsbck_data_handler( bck_ctx bckctx)
{
/* Check if the objid already is in the data_db */
sts = nmpsbck_data_db_find( bckctx->data_list,
data_block_ptr->Data_ObjId, &data_ptr);
data_block_ptr->DataP.Aref.Objid, &data_ptr);
if ( ODD(sts))
data_ptr->found = 1;
else
{
/* New data object, insert it */
sts = nmpsbck_data_db_create( bckctx,
data_block_ptr->Data_ObjId, &data_ptr);
data_block_ptr->DataP.Aref.Objid, &data_ptr);
if ( EVEN(sts)) return sts;
data_ptr->found = 1;
data_ptr->new = 1;
......@@ -402,14 +402,14 @@ static pwr_tStatus nmpsbck_data_handler( bck_ctx bckctx)
{
/* Check if the objid already is in the data_db */
sts = nmpsbck_data_db_find( bckctx->data_list,
data_block_ptr->Data_ObjId, &data_ptr);
data_block_ptr->DataP.Aref.Objid, &data_ptr);
if ( ODD(sts))
data_ptr->found = 1;
else
{
/* New data object, insert it */
sts = nmpsbck_data_db_create( bckctx,
data_block_ptr->Data_ObjId, &data_ptr);
data_block_ptr->DataP.Aref.Objid, &data_ptr);
if ( EVEN(sts))
{
/* The object does not exist... */
......@@ -2032,7 +2032,7 @@ static pwr_tStatus nmpsbck_read( bck_ctx bckctx, char *backupfile)
{
/* Check if the objid already is in the data_db */
sts = nmpsbck_data_db_find_old( bckctx->data_list,
data_block_ptr->Data_ObjId, &data_ptr);
data_block_ptr->DataP.Aref.Objid, &data_ptr);
if ( EVEN(sts))
{
sts = NMPS__RELOADINCONS;
......@@ -2040,39 +2040,39 @@ static pwr_tStatus nmpsbck_read( bck_ctx bckctx, char *backupfile)
}
/* Replace the objid */
data_ptr->found = 1;
data_block_ptr->Data_ObjId = data_ptr->objid;
data_block_ptr->DataP.Aref.Objid = data_ptr->objid;
/* Put NULL in pointer */
data_block_ptr->DataP = NULL;
data_block_ptr->DataP.Ptr = NULL;
data_block_ptr->Data_Dlid = pwr_cNDlid;
data_block_ptr++;
}
/* Replace DataLast and DataL */
if ( cell_ptr->LastIndex > 0 &&
cdh_ObjidIsNotNull( cell_ptr->DataL_ObjId))
cdh_ObjidIsNotNull( cell_ptr->DataLP.Aref.Objid))
{
sts = nmpsbck_data_db_find_old( bckctx->data_list,
cell_ptr->DataL_ObjId, &data_ptr);
cell_ptr->DataLP.Aref.Objid, &data_ptr);
if ( EVEN(sts))
{
sts = NMPS__RELOADINCONS;
goto nmpsbck_read_abort;
}
/* Replace the objid */
cell_ptr->DataL_ObjId = data_ptr->objid;
cell_ptr->DataLP.Aref.Objid = data_ptr->objid;
/* Put NULL in pointer */
cell_ptr->DataLP = NULL;
cell_ptr->DataLP.Ptr = NULL;
sts = nmpsbck_data_db_find_old( bckctx->data_list,
cell_ptr->DataLast_ObjId, &data_ptr);
cell_ptr->DataLastP.Aref.Objid, &data_ptr);
if ( EVEN(sts))
{
sts = NMPS__RELOADINCONS;
goto nmpsbck_read_abort;
}
/* Replace the objid */
cell_ptr->DataLast_ObjId = data_ptr->objid;
cell_ptr->DataLastP.Aref.Objid = data_ptr->objid;
/* Put NULL in pointer */
cell_ptr->DataLastP = NULL;
cell_ptr->DataLastP.Ptr = NULL;
}
/* Reset flags */
cell_ptr->InFlag = 0;
......@@ -2098,34 +2098,34 @@ static pwr_tStatus nmpsbck_read( bck_ctx bckctx, char *backupfile)
{
/* Check if the objid already is in the data_db */
sts = nmpsbck_data_db_find_old( bckctx->data_list,
data_block_ptr->Data_ObjId, &data_ptr);
data_block_ptr->DataP.Aref.Objid, &data_ptr);
if ( EVEN(sts))
{
sts = NMPS__RELOADINCONS;
goto nmpsbck_read_abort;
}
data_ptr->found = 1;
data_block_ptr->Data_ObjId = data_ptr->objid;
data_block_ptr->DataP.Aref.Objid = data_ptr->objid;
/* Put NULL in pointer */
data_block_ptr->DataP = NULL;
data_block_ptr->DataP.Ptr = NULL;
data_block_ptr->Data_Dlid = pwr_cNDlid;
data_block_ptr++;
}
/* Replace DataLast */
if ( cell_ptr->LastIndex > 0 &&
cdh_ObjidIsNotNull( cell_ptr->DataLast_ObjId))
cdh_ObjidIsNotNull( cell_ptr->DataLastP.Aref.Objid))
{
sts = nmpsbck_data_db_find_old( bckctx->data_list,
cell_ptr->DataLast_ObjId, &data_ptr);
cell_ptr->DataLastP.Aref.Objid, &data_ptr);
if ( EVEN(sts))
{
sts = NMPS__RELOADINCONS;
goto nmpsbck_read_abort;
}
/* Replace the objid */
cell_ptr->DataLast_ObjId = data_ptr->objid;
cell_ptr->DataLastP.Aref.Objid = data_ptr->objid;
/* Put NULL in pointer */
cell_ptr->DataLastP = NULL;
cell_ptr->DataLastP.Ptr = NULL;
}
/* Reset flags */
object_ptr->TempLastIndex = cell_ptr->LastIndex;
......
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
ifndef link_rule_mk
link_rule_mk := 1
link = $(ld) $(elinkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(rt_msg_eobjs) \
$(pwr_eobj)/rt_io_user.o \
$(pwre_conf_libdir) $(pwre_conf_libpwrrt) $(pwre_conf_lib)
endif
......@@ -86,9 +86,9 @@
#include "rt_errh.h"
#include "rt_gdh_msg.h"
#include "rt_hash_msg.h"
#include "rs_nmps.h"
#include "nmps.h"
#include "rs_nmps_msg.h"
#include "rs_sutl.h"
//#include "rs_sutl.h"
#define ODD(a) (((int)(a) & 1) != 0)
#define EVEN(a) (((int)(a) & 1) == 0)
......@@ -233,8 +233,10 @@ static pwr_tUInt32 nmpsbck_print_cellheader(
printf(" type: %s\n", cellheader->type);
printf(" objid: %s\n", cdh_ObjidToString( NULL,
cellheader->objid, 0));
printf(" class: %lx\n", cellheader->class);
if ( strcmp( cellheader->type, HEADERTYPE_CELLEND) != 0) {
printf(" class: %x\n", cellheader->class);
printf(" size: %d\n", cellheader->size);
}
return NMPS__SUCCESS;
}
......@@ -245,19 +247,20 @@ static pwr_tUInt32 nmpsbck_print_dataheader(
printf(" type: %s\n", dataheader->type);
printf(" objid: %s\n", cdh_ObjidToString( NULL,
dataheader->objid, 0));
printf(" class: %lx\n", dataheader->class);
if ( strcmp( dataheader->type, HEADERTYPE_DATAEND) != 0) {
printf(" class: %x\n", dataheader->class);
printf(" name: %s\n", dataheader->data_name);
printf(" size: %d\n", dataheader->size);
}
return NMPS__SUCCESS;
}
static int nmpsbck_timecmp( pwr_tTime *time_old,
pwr_tTime *time_new)
{
pwr_tTime testtime;
int sts;
sts = lib$sub_times( time_new, time_old, &testtime);
if ( sts == LIB$_NEGTIM)
sts = time_Acomp( time_new, time_old);
if ( sts == -1)
return 0;
return 1;
}
......@@ -269,7 +272,6 @@ int nmpsbck_get_filename(
{
char *s;
char *s2;
char filename[80];
strcpy( outname, inname);
......@@ -319,7 +321,6 @@ static pwr_tStatus nmpsbck_check_file( bck_ctx bckctx,
pwr_tTime *last_record_time,
int time_only)
{
pwr_tStatus sts;
nmpsbck_t_fileheader fileheader;
nmpsbck_t_recordheader recordheader;
nmpsbck_t_recordheader recordheaderend;
......@@ -331,9 +332,11 @@ static pwr_tStatus nmpsbck_check_file( bck_ctx bckctx,
int data_read_success;
char filename[80];
int k;
char buffer[2000];
char buffer[30000];
int size;
fgetname( bckfile, filename);
// fgetname( bckfile, filename);
strcpy( filename, bckctx->bckconfig->BackupFile);
printf("******************************************************\n");
printf("Examining file %s\n\n", filename);
......@@ -404,6 +407,11 @@ static pwr_tStatus nmpsbck_check_file( bck_ctx bckctx,
else if ( strcmp( cellheader.type, HEADERTYPE_CELL))
break;
size = cellheader.size;
if ( size > sizeof(buffer)) {
size = sizeof(buffer);
printf("** Max buffer size exceeded, cell body truncated\n");
}
csts = fread( buffer, cellheader.size, 1, bckfile);
if (csts == 0)
break;
......@@ -417,22 +425,22 @@ static pwr_tStatus nmpsbck_check_file( bck_ctx bckctx,
plc_t_DataInfo *data_block_ptr;
cell_ptr = (pwr_sClass_NMpsCell *) buffer;
data_block_ptr = (plc_t_DataInfo *) &cell_ptr->Data1P;
data_block_ptr = (plc_t_DataInfo *) &cell_ptr->Data1P.Ptr;
for ( k = 0; k < cell_ptr->LastIndex; k++)
{
/* Check if the objid already is in the data_db */
printf( " Data%d: %s %c %c %c\n", k,
cdh_ObjidToString( NULL,
data_block_ptr->Data_ObjId, 0),
data_block_ptr->DataP.Aref.Objid, 0),
data_block_ptr->Data_Front ? 'F':' ',
data_block_ptr->Data_Back ? 'B':' ',
data_block_ptr->Data_Select ? 'S':' ');
data_block_ptr++;
}
data_block_ptr = (plc_t_DataInfo *) &cell_ptr->DataLP;
data_block_ptr = (plc_t_DataInfo *) &cell_ptr->DataLP.Ptr;
printf( " DataL: %s %c %c %c\n",
cdh_ObjidToString( NULL,
data_block_ptr->Data_ObjId, 0),
data_block_ptr->DataP.Aref.Objid, 0),
data_block_ptr->Data_Front ? 'F':' ',
data_block_ptr->Data_Back ? 'B':' ',
data_block_ptr->Data_Select ? 'S':' ');
......@@ -444,12 +452,12 @@ static pwr_tStatus nmpsbck_check_file( bck_ctx bckctx,
plc_t_DataInfoMirCell *data_block_ptr;
cell_ptr = (pwr_sClass_NMpsMirrorCell *) buffer;
data_block_ptr = (plc_t_DataInfoMirCell *) &cell_ptr->Data1P;
data_block_ptr = (plc_t_DataInfoMirCell *) &cell_ptr->Data1P.Ptr;
for ( k = 0; k < cell_ptr->LastIndex; k++)
{
printf( " Data%d: %s\n", k,
cdh_ObjidToString( NULL,
data_block_ptr->Data_ObjId, 0));
data_block_ptr->DataP.Aref.Objid, 0));
data_block_ptr++;
}
break;
......@@ -536,6 +544,7 @@ static pwr_tStatus nmpsbck_check_file( bck_ctx bckctx,
static pwr_tStatus nmpsbck_read( bck_ctx bckctx)
{
#if 0
pwr_tStatus sts;
nmpsbck_t_fileheader fileheader;
nmpsbck_t_recordheader recordheader;
......@@ -543,7 +552,6 @@ static pwr_tStatus nmpsbck_read( bck_ctx bckctx)
nmpsbck_t_cellheader cellheader;
nmpsbck_t_dataheader dataheader;
FILE *bckfile;
FILE *bckfile1;
FILE *bckfile2;
pwr_tUInt32 csts;
pwr_tUInt32 actpos;
......@@ -557,11 +565,7 @@ static pwr_tStatus nmpsbck_read( bck_ctx bckctx)
char filename[80];
char file_ext[8];
int file_num = 1;
int record_count;
char *s;
pwr_tUInt32 cellarea_start[NMPSBCK_MAX_RECORDS];
pwr_tUInt32 dataarea_start[NMPSBCK_MAX_RECORDS];
pwr_tUInt32 record_start[NMPSBCK_MAX_RECORDS];
int cell_read_success;
int data_read_success;
int i;
......@@ -569,11 +573,17 @@ static pwr_tStatus nmpsbck_read( bck_ctx bckctx)
int data_count;
int created;
pwr_tTime first_record_time;
pwr_tTime bckfile2_time;
pwr_tStatus bckfile2_sts;
#endif
FILE *bckfile1;
pwr_tUInt32 cellarea_start[NMPSBCK_MAX_RECORDS];
pwr_tUInt32 dataarea_start[NMPSBCK_MAX_RECORDS];
pwr_tUInt32 record_start[NMPSBCK_MAX_RECORDS];
int record_count;
pwr_tTime last_record_time;
pwr_tTime bckfile1_time;
pwr_tTime bckfile2_time;
pwr_tStatus bckfile1_sts;
pwr_tStatus bckfile2_sts;
/* Open file 1 */
#if defined(OS_ELN)
......@@ -591,7 +601,7 @@ static pwr_tStatus nmpsbck_read( bck_ctx bckctx)
return bckfile1_sts;
}
main(int argc, char *argv[])
int main(int argc, char *argv[])
{
bck_ctx bckctx;
int sts;
......
......@@ -1142,9 +1142,6 @@ static pwr_tStatus nmpsmir_origcell_init(
sts = gdh_GetObjectInfo ( name, &maxsize, sizeof(maxsize));
if ( EVEN(sts)) return NMPS__NODEDOWN;
/* attrref.Size = sizeof( pwr_sClass_NMpsCell) -
sizeof( plc_t_DataInfo) * ( NMPS_CELL_SIZE - maxsize);
*/
break;
}
case pwr_cClass_NMpsMirrorCell:
......@@ -1159,10 +1156,6 @@ static pwr_tStatus nmpsmir_origcell_init(
sts = gdh_GetObjectInfo ( name, &maxsize, sizeof(maxsize));
if ( EVEN(sts)) return NMPS__NODEDOWN;
/* attrref.Size = sizeof( pwr_sClass_NMpsMirrorCell) -
sizeof( plc_t_DataInfoMirCell) * ( NMPS_CELLMIR_SIZE - maxsize)-
sizeof( nmps_t_mircell_copyarea);
*/
break;
}
default:
......@@ -1173,23 +1166,9 @@ static pwr_tStatus nmpsmir_origcell_init(
}
/** Test
{
void *infop;
sts = gdh_ObjidToName ( objid, name, sizeof(name), cdh_mNName);
if ( EVEN(sts)) return NMPS__NODEDOWN;
sts = gdh_RefObjectInfo( name, (void *)&infop, orig_subid,
attrref.Size);
if ( EVEN(sts)) return sts;
}
**/
sts = gdh_SubRefObjectInfoAttrref( &attrref, orig_subid);
if (EVEN(sts)) LogAndReturn(NMPS__MIRORIGCELL, sts);
/**** Use gdh_SubData instead
sts = gdh_SubAssociateBuffer( *orig_subid, (void *)orig_cell, attrref.Size);
if (EVEN(sts)) LogAndReturn(NMPS__MIRASSBUFF, sts);
***/
}
return NMPS__SUCCESS;
}
......@@ -1338,46 +1317,6 @@ static pwr_tStatus nmpsmir_cellmirlist_add(
return NMPS__SUCCESS;
}
#if 0
/****************************************************************************
* Name: nmpsmir_get_convconfig()
*
* Type pwr_tStatus
*
* Type Parameter IOGF Description
*
* Description:
* Get the conversion config object.
*
**************************************************************************/
static pwr_tStatus nmpsmir_get_convconfig(
mir_ctx mirctx,
pwr_tObjid objid,
char **object_ptr)
{
int i;
int found;
nmpsmir_t_convconfig_list *convconfig_ptr;
found = 1;
convconfig_ptr = mirctx->convconfiglist;
for (i = 0; i < mirctx->convconfig_count; i++)
{
if ( cdh_ObjidIsEqual( objid, convconfig_ptr->objid))
{
*object_ptr = (char *) convconfig_ptr->convconfig;
found = 1;
break;
}
convconfig_ptr++;
}
if ( !found)
return NMPS__CONVOBJECT;
return NMPS__SUCCESS;
}
#endif
/****************************************************************************
* Name: nmpsmir_convconfig_add()
......@@ -1683,11 +1622,11 @@ static pwr_tStatus nmpsmir_cellmir_handler( mir_ctx mirctx)
{
if ( cellmir_ptr->datalist_ptr[j]->plc_data_ptr == 0)
{
if ( cdh_ObjidIsEqual( copyarea->datainfo[count].Data_ObjId,
if ( cdh_ObjidIsEqual( copyarea->datainfo[count].DataP.Aref.Objid,
cellmir_ptr->data_objid[j]))
{
cellmir_ptr->datalist_ptr[j]->plc_data_ptr =
(char *) copyarea->datainfo[count].DataP;
(char *) copyarea->datainfo[count].DataP.Ptr;
cellmir_ptr->datalist_ptr[j]->plc_dlid =
copyarea->datainfo[count].Data_Dlid;
}
......@@ -1781,7 +1720,7 @@ static pwr_tStatus nmpsmir_cellmir_handler( mir_ctx mirctx)
for ( l = 0; l < orig_data_count; l++)
{
if ( cdh_ObjidIsEqual( cellmir_ptr->orig_data_objid[l],
data_block_ptr->Data_ObjId))
data_block_ptr->DataP.Aref.Objid))
{
objid_found = 1;
break;
......@@ -1791,7 +1730,7 @@ static pwr_tStatus nmpsmir_cellmir_handler( mir_ctx mirctx)
if ( !objid_found)
{
cellmir_ptr->orig_data_objid[ orig_data_count] =
data_block_ptr->Data_ObjId;
data_block_ptr->DataP.Aref.Objid;
orig_data_count++;
}
data_block_ptr++;
......@@ -1819,7 +1758,7 @@ static pwr_tStatus nmpsmir_cellmir_handler( mir_ctx mirctx)
for ( l = 0; l < orig_data_count; l++)
{
if ( cdh_ObjidIsEqual( cellmir_ptr->orig_data_objid[l],
data_block_ptr->Data_ObjId))
data_block_ptr->DataP.Aref.Objid))
{
objid_found = 1;
break;
......@@ -1829,7 +1768,7 @@ static pwr_tStatus nmpsmir_cellmir_handler( mir_ctx mirctx)
if ( !objid_found)
{
cellmir_ptr->orig_data_objid[ orig_data_count] =
data_block_ptr->Data_ObjId;
data_block_ptr->DataP.Aref.Objid;
orig_data_count++;
}
data_block_ptr++;
......@@ -1922,11 +1861,11 @@ static pwr_tStatus nmpsmir_cellmir_handler( mir_ctx mirctx)
/* Try to find info of data in the mircell */
for ( k = 0; k < cellmir_ptr->cell->TempLastIndex; k++)
{
if ( cdh_ObjidIsEqual( copyarea->datainfo[k].Data_ObjId,
if ( cdh_ObjidIsEqual( copyarea->datainfo[k].DataP.Aref.Objid,
datalist_ptr->data_objid))
{
datalist_ptr->plc_data_ptr =
(char *) copyarea->datainfo[k].DataP;
(char *) copyarea->datainfo[k].DataP.Ptr;
datalist_ptr->plc_dlid =
copyarea->datainfo[k].Data_Dlid;
break;
......@@ -1957,7 +1896,7 @@ static pwr_tStatus nmpsmir_cellmir_handler( mir_ctx mirctx)
{
for ( j = 0; j < cellmir_ptr->cell->TempLastIndex; j++)
{
if ( cdh_ObjidIsNotEqual( copyarea->datainfo[j].Data_ObjId,
if ( cdh_ObjidIsNotEqual( copyarea->datainfo[j].DataP.Aref.Objid,
cellmir_ptr->data_objid[j]))
{
change_detected = 1;
......@@ -1974,7 +1913,7 @@ static pwr_tStatus nmpsmir_cellmir_handler( mir_ctx mirctx)
found = 0;
for ( k = 0; k < orig_data_count; k++)
{
if ( cdh_ObjidIsEqual( copyarea->datainfo[j].Data_ObjId,
if ( cdh_ObjidIsEqual( copyarea->datainfo[j].DataP.Aref.Objid,
cellmir_ptr->data_objid[k]))
{
found = 1;
......@@ -1985,7 +1924,7 @@ static pwr_tStatus nmpsmir_cellmir_handler( mir_ctx mirctx)
{
/* This object is probably removed */
sts = nmpsmir_data_db_find( mirctx->data_list,
copyarea->datainfo[j].Data_ObjId,
copyarea->datainfo[j].DataP.Aref.Objid,
cellmir_ptr->objid,
&datalist_ptr);
if ( EVEN(sts))
......@@ -1999,7 +1938,7 @@ static pwr_tStatus nmpsmir_cellmir_handler( mir_ctx mirctx)
/* Insert the object in the backup removed list */
sts = nmpsmir_bckremoved_store(
&mirctx->bckremoved_list,
copyarea->datainfo[j].Data_ObjId,
copyarea->datainfo[j].DataP.Aref.Objid,
&bckremlist_ptr);
if (ODD(sts))
{
......@@ -2046,8 +1985,8 @@ static pwr_tStatus nmpsmir_cellmir_handler( mir_ctx mirctx)
break;
if ( !cellmir_ptr->data_noinit[j])
{
copyarea->datainfo[count].Data_ObjId = cellmir_ptr->data_objid[j];
copyarea->datainfo[count].DataP =
copyarea->datainfo[count].DataP.Aref.Objid = cellmir_ptr->data_objid[j];
copyarea->datainfo[count].DataP.Ptr =
(pwr_tFloat32 *) cellmir_ptr->datalist_ptr[j]->plc_data_ptr;
copyarea->datainfo[count].Data_Dlid =
cellmir_ptr->datalist_ptr[j]->plc_dlid;
......
......@@ -76,10 +76,9 @@
#ifndef nmps_data_info
#define nmps_data_info
/* Data structure for one dataobjekt in a NMpsCell and NMpsSelectCell */
/* Data structure for one dataobject in a NMpsCell and NMpsStoreCell */
typedef struct {
pwr_tFloat32 *DataP pwr_dAlignLW;
pwr_tObjid Data_ObjId pwr_dAlignLW;
pwr_tDataRef DataP pwr_dAlignLW;
pwr_tBoolean Data_Front pwr_dAlignW;
pwr_tBoolean Data_Back pwr_dAlignW;
gdh_tDlid Data_Dlid pwr_dAlignW;
......@@ -90,18 +89,11 @@ typedef struct {
/* Data structure for one dataobjekt in a NMpsMirrorCell */
typedef struct {
pwr_tFloat32 *DataP pwr_dAlignLW;
pwr_tObjid Data_ObjId pwr_dAlignLW;
pwr_tDataRef DataP pwr_dAlignLW;
gdh_tDlid Data_Dlid pwr_dAlignW;
} plc_t_DataInfoMirCell;
#endif
/* Data structure for the DLpointer and the objid in a Cell */
typedef struct {
pwr_tFloat32 *DataP;
pwr_tObjid Data_ObjId;
} plc_t_DataInfoBrief;
/* Data structure for the copyarea in a NMpsMirrorCell */
typedef struct {
plc_t_DataInfoMirCell datainfo[ NMPS_CELLMIR_SIZE];
......
......@@ -570,7 +570,7 @@ nmpsappl_Mirror(
for ( j = 0; j < applctx->data_count; j++)
{
if ( cdh_ObjidIsEqual( applctx->datainfo[j].objid,
data_block_ptr->Data_ObjId))
data_block_ptr->DataP.Aref.Objid))
{
found = 1;
break;
......@@ -579,7 +579,7 @@ nmpsappl_Mirror(
if ( !found)
{
applctx->datainfo[applctx->data_count].objid =
data_block_ptr->Data_ObjId;
data_block_ptr->DataP.Aref.Objid;
applctx->datainfo[applctx->data_count].front =
data_block_ptr->Data_Front;
applctx->datainfo[applctx->data_count].back =
......@@ -624,7 +624,7 @@ nmpsappl_Mirror(
for ( j = 0; j < i; j++)
{
if ( cdh_ObjidIsEqual( applctx->datainfo[j].objid,
data_block_ptr->Data_ObjId))
data_block_ptr->DataP.Aref.Objid))
{
found = 1;
break;
......@@ -633,7 +633,7 @@ nmpsappl_Mirror(
if ( !found)
{
applctx->datainfo[applctx->data_count].objid =
data_block_ptr->Data_ObjId;
data_block_ptr->DataP.Aref.Objid;
applctx->datainfo[applctx->data_count].select = 0;
applctx->datainfo[applctx->data_count].front = 0;
applctx->datainfo[applctx->data_count].back = 0;
......
This diff is collapsed.
......@@ -278,11 +278,11 @@ void CellDisp_exec(
data_info += cell->LastIndex - 1;
for ( i = num; i < num + cell->LastIndex; i++)
{
datap = (char *) data_info->DataP;
datap = (char *) data_info->DataP.Ptr;
dataptr[i] = datap;
if ( datap)
{
object->Objid[i] = data_info->Data_ObjId;
object->Objid[i] = data_info->DataP.Aref.Objid;
if ( object->FloatAttrOffs[0] >= 0)
object->F1[i] = *(pwr_tFloat32 *)(datap + object->FloatAttrOffs[0]);
if ( object->FloatAttrOffs[1] >= 0)
......@@ -911,11 +911,11 @@ void CellDispMir_exec(
data_info += cell->LastIndex - 1;
for ( i = num; i < num + cell->LastIndex; i++)
{
datap = (char *) data_info->DataP;
datap = (char *) data_info->DataP.Ptr;
dataptr[i] = datap;
if ( datap)
{
object->Objid[i] = data_info->Data_ObjId;
object->Objid[i] = data_info->DataP.Aref.Objid;
if ( object->FloatAttrOffs[0] >= 0)
object->F1[i] = *(pwr_tFloat32 *)(datap + object->FloatAttrOffs[0]);
if ( object->FloatAttrOffs[1] >= 0)
......@@ -1464,11 +1464,11 @@ void CellUpdate_exec(
data_info += cell->LastIndex - 1;
for ( i = num; i < num + cell->LastIndex; i++)
{
datap = (char *) data_info->DataP;
datap = (char *) data_info->DataP.Ptr;
dataptr[i] = datap;
if ( datap)
{
object->Objid[i] = data_info->Data_ObjId;
object->Objid[i] = data_info->DataP.Aref.Objid;
if ( object->FloatAttrOffs[0] >= 0)
{
if ( object->F1[i] != object->F1Old[i])
......
......@@ -6,8 +6,8 @@
101 20
102 289
103 -2
104 3.7377
136 3.7377
104 3.711
136 3.711
105 100
106 2
107 0
......@@ -15,10 +15,10 @@
109 0.800006
110 22.5672
111 3.302
116 52
116 51
117 0
118 179
119 113
118 186
119 112
120 1
121 Claes context
122 0
......@@ -33,6 +33,7 @@
137 4510
138 3
139 2
140 2
134
22
2200 0
......@@ -55,7 +56,9 @@ pwrp_exe:
ssab_exe:
pwr_exe:
2215 0
2246 0
2236 0
2247 0
2216 0
2221 0
2237 0
......@@ -83,6 +86,7 @@ pwr_exe:
2234 3
2235 0
2243 0
2248 0
2245 0
2244
99
......@@ -179,7 +183,9 @@ pwr_exe:
306
307
308 1024
330 0
321 0
331 0
309 0
313 0
322 0
......@@ -199,6 +205,7 @@ pwr_exe:
319 0
320 0
328 1819043161
332 0
99
3
300 pwr_indsquare
......@@ -263,7 +270,9 @@ pwr_exe:
306
307
308 4
330 0
321 0
331 0
309 29
313 0
322 0
......@@ -283,6 +292,7 @@ pwr_exe:
319 0
320 0
328 1819043161
332 0
99
3
300 pwr_buttonset
......@@ -574,7 +584,9 @@ pwr_exe:
306
307
308 0
330 0
321 4
331 0
309 0
313 0
322 0
......@@ -594,6 +606,7 @@ pwr_exe:
319 0
320 0
328 1819043161
332 0
99
3
300 pwr_valuelong
......@@ -686,7 +699,9 @@ pwr_exe:
306
307
308 1024
330 0
321 0
331 0
309 0
313 0
322 0
......@@ -706,10 +721,13 @@ pwr_exe:
319 0
320 0
328 0
332 0
329
1
100 1
105 0
101 1
106 0
102 65532
103 0
99
......@@ -805,7 +823,9 @@ pwr_exe:
306
307
308 1024
330 0
321 4096
331 0
309 0
313 0
322 0
......@@ -825,10 +845,13 @@ pwr_exe:
319 0
320 0
328 0
332 0
329
1
100 1
105 0
101 1
106 0
102 65532
103 0
99
......@@ -1112,7 +1135,9 @@ pwr_exe:
2721
1
100 1024
105 0
101 0
106 0
102 62
103 0
12
......@@ -1278,7 +1303,9 @@ pwr_exe:
2721
1
100 1
105 0
101 1
106 0
102 65532
103 0
12
......@@ -1716,7 +1743,9 @@ pwr_exe:
2721
1
100 1
105 0
101 1
106 0
102 65532
103 0
12
......@@ -1883,7 +1912,9 @@ pwr_exe:
2721
1
100 6
105 0
101 260
106 0
102 4
103 0
2
......@@ -2020,7 +2051,9 @@ pwr_exe:
2721
1
100 1
105 0
101 1
106 0
102 65532
103 0
2
......@@ -2093,7 +2126,9 @@ pwr_exe:
4002
1
100 1
105 0
101 1
106 0
102 33619964
103 0
99
......@@ -2405,7 +2440,9 @@ pwr_exe:
2721
1
100 1024
105 0
101 4096
106 0
102 4
103 0
12
......@@ -2547,7 +2584,9 @@ pwr_exe:
2721
1
100 1024
105 0
101 4096
106 0
102 4
103 0
12
......@@ -2740,7 +2779,9 @@ pwr_exe:
2721
1
100 1024
105 0
101 4096
106 0
102 4
103 0
12
......@@ -2882,7 +2923,9 @@ pwr_exe:
2721
1
100 1024
105 0
101 0
106 0
102 38
103 0
12
......@@ -3014,7 +3057,9 @@ pwr_exe:
2721
1
100 1024
105 0
101 2
106 0
102 65532
103 0
12
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -59,24 +59,12 @@ SObject NMps:Class
!*/
Object DataP $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr TypeRef = "pwrs:Type-$DataRef"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!/**
! Objid of data object.
!*/
Object Data_ObjId $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! True if the front of the data object is inside the cell.
!*/
Object Data_Front $Attribute 3
......
......@@ -255,25 +255,12 @@ SObject NMps:Class
Object OutDataP $Output 19
Body SysBody
Attr PgmName = "OutDataP"
Attr TypeRef = "pwrs:Type-$Void"
Attr TypeRef = "pwrs:Type-$DataRef"
Attr GraphName = "Out"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!/**
! Objid of the data object of the selected input.
!*/
Object OutData_ObjId $Intern 20
Body SysBody
Attr PgmName = "OutData_ObjId"
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
EndObject
!
! DATASELECT Development Body
......@@ -290,7 +277,7 @@ SObject NMps:Class
Body SysBody
Attr object_type = 11
Attr parameters[0] = 18
Attr parameters[1] = 1
Attr parameters[1] = 0
Attr parameters[2] = 1
Attr parameters[3] = 0
Attr subwindows = 0
......
......@@ -38,6 +38,9 @@
SObject NMps:Class
!/**
! @Group MaterialPlanning,Plc
!
! Note! Obsolete since V5.2
! Replaced by GetDataRefp.
!*/
Object GetDap $ClassDef 19
Body SysBody
......
This diff is collapsed.
......@@ -478,21 +478,11 @@ SObject NMps:Class
Object DataLP $Intern 28
Body SysBody
Attr PgmName = "DataLP"
Attr TypeRef = "pwrs:Type-$Void"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr TypeRef = "pwrs:Type-$DataRef"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object DataL_ObjId $Intern 29
Body SysBody
Attr PgmName = "DataL_ObjId"
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
Object DataL_Front $Intern 30
Body SysBody
Attr PgmName = "DataL_Front"
......@@ -537,26 +527,13 @@ SObject NMps:Class
Object DataLastP $Output 35
Body SysBody
Attr PgmName = "DataLastP"
Attr TypeRef = "pwrs:Type-$Void"
Attr TypeRef = "pwrs:Type-$DataRef"
Attr GraphName = "DL"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!/**
! Objid for data object with highest index.
!*/
Object DataLast_ObjId $Intern 36
Body SysBody
Attr PgmName = "DataLast_ObjId"
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! True if the front of the data object with highest index is inside the cell.
!*/
Object DataLast_Front $Intern 37
......@@ -601,20 +578,11 @@ SObject NMps:Class
EndObject
Object DataCurrentP $Intern 42
Body SysBody
Attr TypeRef = "pwrs:Type-$Void"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr TypeRef = "pwrs:Type-$DataRef"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object DataCurrent_ObjId $Intern 43
Body SysBody
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
Object DataCurrent_Front $Intern 44
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
......
......@@ -478,21 +478,11 @@ SObject NMps:Class
Object DataLP $Intern 28
Body SysBody
Attr PgmName = "DataLP"
Attr TypeRef = "pwrs:Type-$Void"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr TypeRef = "pwrs:Type-$DataRef"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object DataL_ObjId $Intern 29
Body SysBody
Attr PgmName = "DataL_ObjId"
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
Object DataL_Front $Intern 30
Body SysBody
Attr PgmName = "DataL_Front"
......@@ -537,26 +527,13 @@ SObject NMps:Class
Object DataLastP $Output 35
Body SysBody
Attr PgmName = "DataLastP"
Attr TypeRef = "pwrs:Type-$Void"
Attr TypeRef = "pwrs:Type-$DataRef"
Attr GraphName = "DL"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!/**
! Objid for data object with highest index.
!*/
Object DataLast_ObjId $Intern 36
Body SysBody
Attr PgmName = "DataLast_ObjId"
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! True if the front of the data object with highest index is inside the cell.
!*/
Object DataLast_Front $Intern 37
......@@ -601,20 +578,11 @@ SObject NMps:Class
EndObject
Object DataCurrentP $Intern 42
Body SysBody
Attr TypeRef = "pwrs:Type-$Void"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr TypeRef = "pwrs:Type-$DataRef"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object DataCurrent_ObjId $Intern 43
Body SysBody
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
Object DataCurrent_Front $Intern 44
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
......
......@@ -336,21 +336,11 @@ SObject NMps:Class
Object DataLP $Intern 28
Body SysBody
Attr PgmName = "DataLP"
Attr TypeRef = "pwrs:Type-$Void"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr TypeRef = "pwrs:Type-$DataRef"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object DataL_ObjId $Intern 29
Body SysBody
Attr PgmName = "DataL_ObjId"
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
Object DataL_Front $Intern 30
Body SysBody
Attr PgmName = "DataL_Front"
......@@ -392,22 +382,12 @@ SObject NMps:Class
Object DataLastP $Output 35
Body SysBody
Attr PgmName = "DataLastP"
Attr TypeRef = "pwrs:Type-$Void"
Attr TypeRef = "pwrs:Type-$DataRef"
Attr GraphName = "DL"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
Object DataLast_ObjId $Intern 36
Body SysBody
Attr PgmName = "DataLast_ObjId"
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
Object DataLast_Front $Intern 37
Body SysBody
Attr PgmName = "DataLast_Front"
......@@ -447,20 +427,11 @@ SObject NMps:Class
EndObject
Object DataCurrentP $Intern 42
Body SysBody
Attr TypeRef = "pwrs:Type-$Void"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr TypeRef = "pwrs:Type-$DataRef"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object DataCurrent_ObjId $Intern 43
Body SysBody
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
Object DataCurrent_Front $Intern 44
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
......@@ -492,22 +463,12 @@ SObject NMps:Class
Object Data1P $Output 53
Body SysBody
Attr PgmName = "Data1P"
Attr TypeRef = "pwrs:Type-$Void"
Attr TypeRef = "pwrs:Type-$DataRef"
Attr GraphName = "D1"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
Object Data1_ObjId $Intern 54
Body SysBody
Attr PgmName = "Data1_ObjId"
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
Object Data1_Front $Intern 55
Body SysBody
Attr PgmName = "Data1_Front"
......
......@@ -472,21 +472,11 @@ SObject NMps:Class
Object DataLP $Intern 28
Body SysBody
Attr PgmName = "DataLP"
Attr TypeRef = "pwrs:Type-$Void"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr TypeRef = "pwrs:Type-$DataRef"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object DataL_ObjId $Intern 29
Body SysBody
Attr PgmName = "DataL_ObjId"
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
Object DataL_Front $Intern 30
Body SysBody
Attr PgmName = "DataL_Front"
......@@ -531,26 +521,13 @@ SObject NMps:Class
Object DataLastP $Output 35
Body SysBody
Attr PgmName = "DataLastP"
Attr TypeRef = "pwrs:Type-$Void"
Attr TypeRef = "pwrs:Type-$DataRef"
Attr GraphName = "DL"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!/**
! Objid for data object with highest index.
!*/
Object DataLast_ObjId $Intern 36
Body SysBody
Attr PgmName = "DataLast_ObjId"
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! True if the front of the data object with highest index is inside the cell.
!*/
Object DataLast_Front $Intern 37
......@@ -595,20 +572,11 @@ SObject NMps:Class
EndObject
Object DataCurrentP $Intern 42
Body SysBody
Attr TypeRef = "pwrs:Type-$Void"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr TypeRef = "pwrs:Type-$DataRef"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object DataCurrent_ObjId $Intern 43
Body SysBody
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
Object DataCurrent_Front $Intern 44
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
......
......@@ -472,21 +472,11 @@ SObject NMps:Class
Object DataLP $Intern 28
Body SysBody
Attr PgmName = "DataLP"
Attr TypeRef = "pwrs:Type-$Void"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr TypeRef = "pwrs:Type-$DataRef"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object DataL_ObjId $Intern 29
Body SysBody
Attr PgmName = "DataL_ObjId"
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
Object DataL_Front $Intern 30
Body SysBody
Attr PgmName = "DataL_Front"
......@@ -531,26 +521,13 @@ SObject NMps:Class
Object DataLastP $Output 35
Body SysBody
Attr PgmName = "DataLastP"
Attr TypeRef = "pwrs:Type-$Void"
Attr TypeRef = "pwrs:Type-$DataRef"
Attr GraphName = "DL"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!/**
! Objid for data object with highest index.
!*/
Object DataLast_ObjId $Intern 36
Body SysBody
Attr PgmName = "DataLast_ObjId"
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! True if the front of the data object with highest index is inside the cell.
!*/
Object DataLast_Front $Intern 37
......@@ -595,20 +572,11 @@ SObject NMps:Class
EndObject
Object DataCurrentP $Intern 42
Body SysBody
Attr TypeRef = "pwrs:Type-$Void"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr TypeRef = "pwrs:Type-$DataRef"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object DataCurrent_ObjId $Intern 43
Body SysBody
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
Object DataCurrent_Front $Intern 44
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
......
......@@ -420,6 +420,7 @@ int CnvWblToH::attribute_exec()
strcmp( CnvCtx::low(ctx->rw->attr_typeref), "deltatime") == 0 ||
strcmp( CnvCtx::low(ctx->rw->attr_typeref), "castid") == 0 ||
strcmp( CnvCtx::low(ctx->rw->attr_typeref), "disableattr") == 0 ||
strcmp( CnvCtx::low(ctx->rw->attr_typeref), "dataref") == 0 ||
strcmp( ctx->rw->attr_name, "TimerFlag") == 0)
strcpy( alignstr, " pwr_dAlignLW");
else
......
......@@ -548,8 +548,8 @@ typedef pwr_sAttrRef pwr_tAttrRef;
@aref dataref DataRef
*/
typedef struct {
void *Ptr; //!< Private plc pointer to data object.
pwr_sAttrRef Aref; //!< Attribute reference to data object.
pwr_tVoid *Ptr pwr_dAlignLW; //!< Private plc pointer to data object.
pwr_tAttrRef Aref pwr_dAlignLW; //!< Attribute reference to data object.
} pwr_tDataRef;
/*_*
......
......@@ -152,8 +152,7 @@ typedef struct {
} rttsys_t_cell_list;
typedef struct {
pwr_tFloat32 *DataP;
pwr_tObjid Data_ObjId pwr_dAlignLW;
pwr_tDataRef DataP pwr_dAlignLW;
pwr_tBoolean Data_Front pwr_dAlignW;
pwr_tBoolean Data_Back pwr_dAlignW;
gdh_tDlid Data_Dlid pwr_dAlignW;
......@@ -162,8 +161,7 @@ typedef struct {
} plc_t_DataInfo;
typedef struct {
pwr_tFloat32 *DataP;
pwr_tObjid Data_ObjId pwr_dAlignW;
pwr_tDataRef DataP pwr_dAlignLW;
gdh_tDlid Data_Dlid pwr_dAlignW;
} plc_t_DataInfoMirCell;
......@@ -5752,7 +5750,7 @@ int RTTSYS_OBJECT_CELL( menu_ctx ctx,
else
menu_ptr->value_ptr = (char *) &((pwr_sClass_NMpsCell *)(cell_ptr))->LastIndex;
menu_ptr++;
menu_ptr->value_ptr = (char *) &((pwr_sClass_NMpsCell *)(cell_ptr))->DataLast_ObjId;
menu_ptr->value_ptr = (char *) &((pwr_sClass_NMpsCell *)(cell_ptr))->DataLastP.Aref.Objid;
menu_ptr++;
*(pwr_tBoolean *)(menu_ptr->value_ptr) =
((pwr_sClass_NMpsCell *)(cell_ptr))->DataLast_Front;
......@@ -5801,7 +5799,7 @@ int RTTSYS_OBJECT_CELL( menu_ctx ctx,
{
menu_ptr->value_ptr = (char *) &((pwr_sClass_NMpsMirrorCell *)(cell_ptr))->LastIndex;
menu_ptr++;
menu_ptr->value_ptr = (char *) &((pwr_sClass_NMpsMirrorCell *)(cell_ptr))->DataLast_ObjId;
menu_ptr->value_ptr = (char *) &((pwr_sClass_NMpsMirrorCell *)(cell_ptr))->DataLastP.Aref.Objid;
menu_ptr++;
menu_ptr->value_ptr = (char *) RTT_ERASE;
menu_ptr++;
......@@ -5878,8 +5876,8 @@ int RTTSYS_OBJECT_CELL( menu_ctx ctx,
menu_ptr->func2 = &rttsys_cell_dataobject;
menu_ptr->func3 = &rtt_object_parameters;
menu_ptr->argoi = cell_objid;
menu_ptr->arg1 = &data_info->Data_ObjId;
*(pwr_tObjid *)(menu_ptr->value_ptr) = data_info->Data_ObjId;
menu_ptr->arg1 = &data_info->DataP.Aref.Objid;
*(pwr_tObjid *)(menu_ptr->value_ptr) = data_info->DataP.Aref.Objid;
menu_ptr++;
*(pwr_tBoolean *)(menu_ptr->value_ptr) = data_info->Data_Front;
menu_ptr++;
......@@ -5913,8 +5911,8 @@ int RTTSYS_OBJECT_CELL( menu_ctx ctx,
menu_ptr->func2 = &rttsys_cell_dataobject;
menu_ptr->func3 = &rtt_object_parameters;
menu_ptr->argoi = cell_objid;
menu_ptr->arg1 = &data_info->Data_ObjId;
*(pwr_tObjid *)(menu_ptr->value_ptr) = data_info->Data_ObjId;
menu_ptr->arg1 = &data_info->DataP.Aref.Objid;
*(pwr_tObjid *)(menu_ptr->value_ptr) = data_info->DataP.Aref.Objid;
menu_ptr++;
*(pwr_tBoolean *)(menu_ptr->value_ptr) = 0;
menu_ptr++;
......@@ -6258,9 +6256,9 @@ int RTTSYS_NMPSCELL( menu_ctx ctx,
data_info = (plc_t_DataInfo *)
&((pwr_sClass_NMpsCell *)(cellist_ptr->value_ptr))->Data1P;
cell_menu_ptr->arg1 = &data_info->Data_ObjId;
cell_menu_ptr->arg1 = &data_info->DataP.Aref.Objid;
*(pwr_tObjid *)(menu_ptr->value_ptr) = data_info->Data_ObjId;
*(pwr_tObjid *)(menu_ptr->value_ptr) = data_info->DataP.Aref.Objid;
menu_ptr++;
*(pwr_tBoolean *)(menu_ptr->value_ptr) = data_info->Data_Front;
menu_ptr++;
......@@ -6289,9 +6287,9 @@ int RTTSYS_NMPSCELL( menu_ctx ctx,
data_info = (plc_t_DataInfoMirCell *)
&((pwr_sClass_NMpsMirrorCell *)(cellist_ptr->value_ptr))->Data1P;
cell_menu_ptr->arg1 = &data_info->Data_ObjId;
cell_menu_ptr->arg1 = &data_info->DataP.Aref.Objid;
*(pwr_tObjid *)(menu_ptr->value_ptr) = data_info->Data_ObjId;
*(pwr_tObjid *)(menu_ptr->value_ptr) = data_info->DataP.Aref.Objid;
menu_ptr++;
*(pwr_tBoolean *)(menu_ptr->value_ptr) = 0;
menu_ptr++;
......@@ -6341,8 +6339,8 @@ int RTTSYS_NMPSCELL( menu_ctx ctx,
menu_ptr++;
*(pwr_tInt32 *)(menu_ptr->value_ptr) = l + 1;
menu_ptr++;
cell_menu_ptr->arg1 = &data_info->Data_ObjId;
*(pwr_tObjid *)(menu_ptr->value_ptr) = data_info->Data_ObjId;
cell_menu_ptr->arg1 = &data_info->DataP.Aref.Objid;
*(pwr_tObjid *)(menu_ptr->value_ptr) = data_info->DataP.Aref.Objid;
menu_ptr++;
*(pwr_tBoolean *)(menu_ptr->value_ptr) = data_info->Data_Front;
menu_ptr++;
......@@ -6387,8 +6385,8 @@ int RTTSYS_NMPSCELL( menu_ctx ctx,
menu_ptr++;
*(pwr_tInt32 *)(menu_ptr->value_ptr) = l + 1;
menu_ptr++;
cell_menu_ptr->arg1 = &data_info->Data_ObjId;
*(pwr_tObjid *)(menu_ptr->value_ptr) = data_info->Data_ObjId;
cell_menu_ptr->arg1 = &data_info->DataP.Aref.Objid;
*(pwr_tObjid *)(menu_ptr->value_ptr) = data_info->DataP.Aref.Objid;
menu_ptr++;
*(pwr_tBoolean *)(menu_ptr->value_ptr) = 0;
menu_ptr++;
......
......@@ -53,11 +53,6 @@
#define max(Dragon,Eagle) ((Dragon) > (Eagle) ? (Dragon) : (Eagle))
#define min(Dragon,Eagle) ((Dragon) < (Eagle) ? (Dragon) : (Eagle))
typedef struct {
pwr_tFloat32 *DataP pwr_dAlignLW;
pwr_tObjid Data_ObjId pwr_dAlignLW;
} plc_t_DataInfoBrief;
/* PLC RUTINER */
/*_*
......@@ -158,14 +153,13 @@ void DataCollect_exec(
pwr_sClass_DataCollect *object)
{
int i;
plc_t_DataInfoBrief **InP;
pwr_tDataRef **InP;
for ( i = 0; i < object->MaxIndex; i++)
{
InP = (plc_t_DataInfoBrief **) ((char *) &object->DataIn1P +
InP = (pwr_tDataRef **) ((char *) &object->DataIn1P +
i * pwr_cInputOffset);
object->DataP[i] = (*InP)->DataP;
object->DataObjId[i] = (*InP)->Data_ObjId;
memcpy( &object->DataP[i], *InP, sizeof(pwr_tDataRef));
}
}
......
......@@ -865,3 +865,19 @@
obj->ActVal.low = in;
obj->ActVal.high = 0;
#endif
/*_*
StoDataRefv
Store data reference value
@aref stodatarefv StoDataRefv
*/
#define StoDataRefv_exec(obj,in) \
memcpy( &obj->ActualValue, &(in), sizeof(pwr_tDataRef));
/*_*
CStoDataRefv
Conditional storage of a data reference value
@aref cstodatarefv CStoDataRefv
*/
#define CStoDataRefv_exec(obj,in,cond) \
if ( cond) memcpy( &obj->ActualValue, &(in), sizeof(pwr_tDataRef));
......@@ -130,6 +130,7 @@ noseqreset <No SequenceReset object found in main object> /error
compmethod <Invalid compile method> /error
libref <Invalid reference to library hierarchy> /error
misplacedthread <Misplaced thread object> /error
obsolete <Object is obsolete> /error
.facility FOE,280 /prefix = FOE__ ! Function object editor
......
......@@ -291,20 +291,10 @@ SObject pwrb:Class
Object OutDataP $Output 27
Body SysBody
Attr PgmName = "OutDataP"
Attr TypeRef = "pwrs:Type-$Void"
Attr TypeRef = "pwrs:Type-$DataRef"
Attr GraphName = "Out"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_PRIVATE
EndBody
EndObject
Object OutData_ObjId $Intern 28
Body SysBody
Attr PgmName = "OutData_ObjId"
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
EndObject
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -51,7 +51,7 @@ SObject pwrb:Class
! objects.
!
! Another advantage of DataCollect is that its sometimes convenient to have
! the values arranged in an array, to use for example in an for or
! the values arranged in an array, for example to use in a for or
! while loop.
!
! MaxIndex should be assigned the number of used inputs in the DataCollect
......@@ -67,7 +67,7 @@ SObject pwrb:Class
!
! OA1 = 0;
! for ( i = 0; i < Da1->MaxIndex; i++)
! if ( ((pwr_sClass_Mtrl *)(Da1->DataP[i]))->Length > 10.0)
! if ( ((pwr_sClass_Mtrl *)(Da1->DataP[i].Ptr))->Length > 10.0)
! OA1++;
!
!*/
......@@ -268,21 +268,7 @@ SObject pwrb:Class
!*/
Object DataP $Intern 26
Body SysBody
Attr TypeRef = "pwrs:Type-$Void"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 24
EndBody
EndObject
!/**
! Array that contains objid to the the data input objects.
!*/
Object DataObjId $Intern 27
Body SysBody
Attr TypeRef = "pwrs:Type-$ObjId"
Attr TypeRef = "pwrs:Type-$DataRef"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_ARRAY
......@@ -295,20 +281,10 @@ SObject pwrb:Class
Object OutDataP $Output 28
Body SysBody
Attr PgmName = "OutDataP"
Attr TypeRef = "pwrs:Type-$Void"
Attr TypeRef = "pwrs:Type-$DataRef"
Attr GraphName = "Out"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_PRIVATE
EndBody
EndObject
Object OutData_ObjId $Intern 29
Body SysBody
Attr PgmName = "OutData_ObjId"
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
EndObject
......@@ -327,7 +303,7 @@ SObject pwrb:Class
Body SysBody
Attr object_type = 11
Attr parameters[0] = 24
Attr parameters[1] = 3
Attr parameters[1] = 2
Attr parameters[2] = 1
Attr parameters[3] = 0
Attr subwindows = 0
......
This diff is collapsed.
......@@ -314,20 +314,10 @@ SObject pwrb:Class
Object OutDataP $Output 27
Body SysBody
Attr PgmName = "OutDataP"
Attr TypeRef = "pwrs:Type-$Void"
Attr TypeRef = "pwrs:Type-$DataRef"
Attr GraphName = "Out"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_PRIVATE
EndBody
EndObject
Object OutData_ObjId $Intern 28
Body SysBody
Attr PgmName = "OutData_ObjId"
Attr TypeRef = "pwrs:Type-$ObjId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
EndObject
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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