Commit 4508af64 authored by Claes Sjofors's avatar Claes Sjofors

NMps cells added with size 60 and 120

parent e2cdbfb4
......@@ -341,7 +341,11 @@ static pwr_tStatus nmpsbck_data_handler( bck_ctx bckctx)
switch( cellheader->class)
{
case pwr_cClass_NMpsCell:
case pwr_cClass_NMpsCell60:
case pwr_cClass_NMpsCell120:
case pwr_cClass_NMpsStoreCell:
case pwr_cClass_NMpsStoreCell60:
case pwr_cClass_NMpsStoreCell120:
{
pwr_sClass_NMpsCell *cell_ptr;
plc_t_DataInfo *data_block_ptr;
......@@ -724,7 +728,11 @@ static pwr_tStatus nmpsbck_cellist_add(
switch ( class)
{
case pwr_cClass_NMpsCell:
case pwr_cClass_NMpsCell60:
case pwr_cClass_NMpsCell120:
case pwr_cClass_NMpsStoreCell:
case pwr_cClass_NMpsStoreCell60:
case pwr_cClass_NMpsStoreCell120:
if ( !(((pwr_sClass_NMpsCell *)objectp)->Function &
NMPS_CELLFUNC_BACKUP))
return NMPS__SUCCESS;
......@@ -759,7 +767,11 @@ static pwr_tStatus nmpsbck_cellist_add(
switch( cellist_ptr->class)
{
case pwr_cClass_NMpsCell:
case pwr_cClass_NMpsCell60:
case pwr_cClass_NMpsCell120:
case pwr_cClass_NMpsStoreCell:
case pwr_cClass_NMpsStoreCell60:
case pwr_cClass_NMpsStoreCell120:
cellist_ptr->size =
(char *)&(((pwr_sClass_NMpsCell *)(cellist_ptr->cell))->Data1P) -
(char *)(cellist_ptr->cell) +
......@@ -845,7 +857,30 @@ static pwr_tStatus nmps_cell_init( bck_ctx bckctx)
sts = gdh_GetNextObject( objid, &objid);
}
/* Get the cell objects on this node */
sts = gdh_GetClassList ( pwr_cClass_NMpsCell60, &objid);
while ( ODD(sts))
{
/* Store and direct link the cells */
sts = nmpsbck_cellist_add( bckctx, objid, &bckctx->cellist,
&bckctx->cell_count);
if ( EVEN(sts)) return sts;
sts = gdh_GetNextObject( objid, &objid);
}
sts = gdh_GetClassList ( pwr_cClass_NMpsCell120, &objid);
while ( ODD(sts))
{
/* Store and direct link the cells */
sts = nmpsbck_cellist_add( bckctx, objid, &bckctx->cellist,
&bckctx->cell_count);
if ( EVEN(sts)) return sts;
sts = gdh_GetNextObject( objid, &objid);
}
/* Get the store cell objects on this node */
sts = gdh_GetClassList ( pwr_cClass_NMpsStoreCell, &objid);
while ( ODD(sts))
{
......@@ -856,7 +891,30 @@ static pwr_tStatus nmps_cell_init( bck_ctx bckctx)
sts = gdh_GetNextObject( objid, &objid);
}
/* Get the cell objects on this node */
sts = gdh_GetClassList ( pwr_cClass_NMpsStoreCell60, &objid);
while ( ODD(sts))
{
/* Store and direct link the cells */
sts = nmpsbck_cellist_add( bckctx, objid, &bckctx->cellist,
&bckctx->cell_count);
if ( EVEN(sts)) return sts;
sts = gdh_GetNextObject( objid, &objid);
}
sts = gdh_GetClassList ( pwr_cClass_NMpsStoreCell120, &objid);
while ( ODD(sts))
{
/* Store and direct link the cells */
sts = nmpsbck_cellist_add( bckctx, objid, &bckctx->cellist,
&bckctx->cell_count);
if ( EVEN(sts)) return sts;
sts = gdh_GetNextObject( objid, &objid);
}
/* Get the mirror cell objects on this node */
sts = gdh_GetClassList ( pwr_cClass_NMpsMirrorCell, &objid);
while ( ODD(sts))
{
......@@ -1939,7 +1997,11 @@ static pwr_tStatus nmpsbck_read( bck_ctx bckctx)
switch( cellheader.class)
{
case pwr_cClass_NMpsCell:
case pwr_cClass_NMpsCell60:
case pwr_cClass_NMpsCell120:
case pwr_cClass_NMpsStoreCell:
case pwr_cClass_NMpsStoreCell60:
case pwr_cClass_NMpsStoreCell120:
{
pwr_sClass_NMpsCell *cell_ptr;
pwr_sClass_NMpsCell *object_ptr;
......@@ -2098,7 +2160,11 @@ static pwr_tStatus nmpsbck_read( bck_ctx bckctx)
switch( clist_ptr->class)
{
case pwr_cClass_NMpsCell:
case pwr_cClass_NMpsCell60:
case pwr_cClass_NMpsCell120:
case pwr_cClass_NMpsStoreCell:
case pwr_cClass_NMpsStoreCell60:
case pwr_cClass_NMpsStoreCell120:
((pwr_sClass_NMpsCell *) clist_ptr->buffer)->ReloadDone = 0;
((pwr_sClass_NMpsCell *) clist_ptr->buffer)->MirrorRestart = 1;
((pwr_sClass_NMpsCell *) clist_ptr->buffer)->Function =
......@@ -2147,6 +2213,50 @@ static pwr_tStatus nmpsbck_read( bck_ctx bckctx)
}
sts = gdh_GetNextObject( objid, &objid);
}
sts = gdh_GetClassList ( pwr_cClass_NMpsCell60, &objid);
while ( ODD(sts))
{
sts = nmpsbck_clist_find( clist, cellheader.objid, &clist_ptr);
if (EVEN(sts))
{
sts = gdh_ObjidToPointer( objid, (pwr_tAddress *) &objectp);
if (EVEN(sts))
{
nmpsbck_set_cell_backup_done();
LogAndReturn(NMPS__RESTOREERROR, sts);
}
if ( ((pwr_sClass_NMpsCell *) objectp)->Function &
NMPS_CELLFUNC_BACKUP)
{
((pwr_sClass_NMpsCell *) objectp)->ReloadDone = NMPS_CELL_RELOADDONE;
((pwr_sClass_NMpsCell *) objectp)->InitTime = 1;
}
}
sts = gdh_GetNextObject( objid, &objid);
}
sts = gdh_GetClassList ( pwr_cClass_NMpsCell120, &objid);
while ( ODD(sts))
{
sts = nmpsbck_clist_find( clist, cellheader.objid, &clist_ptr);
if (EVEN(sts))
{
sts = gdh_ObjidToPointer( objid, (pwr_tAddress *) &objectp);
if (EVEN(sts))
{
nmpsbck_set_cell_backup_done();
LogAndReturn(NMPS__RESTOREERROR, sts);
}
if ( ((pwr_sClass_NMpsCell *) objectp)->Function &
NMPS_CELLFUNC_BACKUP)
{
((pwr_sClass_NMpsCell *) objectp)->ReloadDone = NMPS_CELL_RELOADDONE;
((pwr_sClass_NMpsCell *) objectp)->InitTime = 1;
}
}
sts = gdh_GetNextObject( objid, &objid);
}
sts = gdh_GetClassList ( pwr_cClass_NMpsStoreCell, &objid);
while ( ODD(sts))
{
......@@ -2169,6 +2279,50 @@ static pwr_tStatus nmpsbck_read( bck_ctx bckctx)
}
sts = gdh_GetNextObject( objid, &objid);
}
sts = gdh_GetClassList ( pwr_cClass_NMpsStoreCell60, &objid);
while ( ODD(sts))
{
sts = nmpsbck_clist_find( clist, cellheader.objid, &clist_ptr);
if (EVEN(sts))
{
sts = gdh_ObjidToPointer( objid, (pwr_tAddress *) &objectp);
if (EVEN(sts))
{
nmpsbck_set_cell_backup_done();
LogAndReturn(NMPS__RESTOREERROR, sts);
}
if ( ((pwr_sClass_NMpsStoreCell *) objectp)->Function &
NMPS_CELLFUNC_BACKUP)
{
((pwr_sClass_NMpsStoreCell *) objectp)->ReloadDone = NMPS_CELL_RELOADDONE;
((pwr_sClass_NMpsStoreCell *) objectp)->InitTime = 1;
}
}
sts = gdh_GetNextObject( objid, &objid);
}
sts = gdh_GetClassList ( pwr_cClass_NMpsStoreCell120, &objid);
while ( ODD(sts))
{
sts = nmpsbck_clist_find( clist, cellheader.objid, &clist_ptr);
if (EVEN(sts))
{
sts = gdh_ObjidToPointer( objid, (pwr_tAddress *) &objectp);
if (EVEN(sts))
{
nmpsbck_set_cell_backup_done();
LogAndReturn(NMPS__RESTOREERROR, sts);
}
if ( ((pwr_sClass_NMpsStoreCell *) objectp)->Function &
NMPS_CELLFUNC_BACKUP)
{
((pwr_sClass_NMpsStoreCell *) objectp)->ReloadDone = NMPS_CELL_RELOADDONE;
((pwr_sClass_NMpsStoreCell *) objectp)->InitTime = 1;
}
}
sts = gdh_GetNextObject( objid, &objid);
}
sts = gdh_GetClassList ( pwr_cClass_NMpsMirrorCell, &objid);
while ( ODD(sts))
{
......@@ -2272,6 +2426,34 @@ static pwr_tStatus nmpsbck_set_cell_backup_done()
}
sts = gdh_GetNextObject( objid, &objid);
}
sts = gdh_GetClassList ( pwr_cClass_NMpsCell60, &objid);
while ( ODD(sts))
{
sts = gdh_ObjidToPointer( objid, (pwr_tAddress *) &objectp);
if (EVEN(sts)) LogAndReturn(NMPS__RESTOREERROR, sts);
if ( ((pwr_sClass_NMpsCell *) objectp)->Function &
NMPS_CELLFUNC_BACKUP)
{
((pwr_sClass_NMpsCell *) objectp)->ReloadDone = NMPS_CELL_RELOADDONE;
((pwr_sClass_NMpsCell *) objectp)->InitTime = 1;
}
sts = gdh_GetNextObject( objid, &objid);
}
sts = gdh_GetClassList ( pwr_cClass_NMpsCell120, &objid);
while ( ODD(sts))
{
sts = gdh_ObjidToPointer( objid, (pwr_tAddress *) &objectp);
if (EVEN(sts)) LogAndReturn(NMPS__RESTOREERROR, sts);
if ( ((pwr_sClass_NMpsCell *) objectp)->Function &
NMPS_CELLFUNC_BACKUP)
{
((pwr_sClass_NMpsCell *) objectp)->ReloadDone = NMPS_CELL_RELOADDONE;
((pwr_sClass_NMpsCell *) objectp)->InitTime = 1;
}
sts = gdh_GetNextObject( objid, &objid);
}
sts = gdh_GetClassList ( pwr_cClass_NMpsStoreCell, &objid);
while ( ODD(sts))
{
......@@ -2286,6 +2468,34 @@ static pwr_tStatus nmpsbck_set_cell_backup_done()
}
sts = gdh_GetNextObject( objid, &objid);
}
sts = gdh_GetClassList ( pwr_cClass_NMpsStoreCell60, &objid);
while ( ODD(sts))
{
sts = gdh_ObjidToPointer( objid, (pwr_tAddress *) &objectp);
if (EVEN(sts)) LogAndReturn(NMPS__RESTOREERROR, sts);
if ( ((pwr_sClass_NMpsStoreCell *) objectp)->Function &
NMPS_CELLFUNC_BACKUP)
{
((pwr_sClass_NMpsStoreCell *) objectp)->ReloadDone = NMPS_CELL_RELOADDONE;
((pwr_sClass_NMpsStoreCell *) objectp)->InitTime = 1;
}
sts = gdh_GetNextObject( objid, &objid);
}
sts = gdh_GetClassList ( pwr_cClass_NMpsStoreCell120, &objid);
while ( ODD(sts))
{
sts = gdh_ObjidToPointer( objid, (pwr_tAddress *) &objectp);
if (EVEN(sts)) LogAndReturn(NMPS__RESTOREERROR, sts);
if ( ((pwr_sClass_NMpsStoreCell *) objectp)->Function &
NMPS_CELLFUNC_BACKUP)
{
((pwr_sClass_NMpsStoreCell *) objectp)->ReloadDone = NMPS_CELL_RELOADDONE;
((pwr_sClass_NMpsStoreCell *) objectp)->InitTime = 1;
}
sts = gdh_GetNextObject( objid, &objid);
}
sts = gdh_GetClassList ( pwr_cClass_NMpsMirrorCell, &objid);
while ( ODD(sts))
{
......@@ -2327,7 +2537,11 @@ static pwr_tStatus nmpsbck_cell_handler( bck_ctx bckctx)
switch ( cell_ptr->class)
{
case pwr_cClass_NMpsCell:
case pwr_cClass_NMpsCell60:
case pwr_cClass_NMpsCell120:
case pwr_cClass_NMpsStoreCell:
case pwr_cClass_NMpsStoreCell60:
case pwr_cClass_NMpsStoreCell120:
if (((pwr_sClass_NMpsCell *)(cell_ptr->cell))->BackupNow)
{
backup_now = 1;
......
......@@ -19,7 +19,7 @@
#define NMPS_CELL_SIZE 30 /* Number of dataobject in
#define NMPS_CELL_MAXSIZE 120 /* Number of dataobject in
NMpsCell och NMpsSelectCell */
#define NMPS_CELLMIR_SIZE 30 /* Number of dataobject in
NMpsMirrorCell */
......@@ -57,19 +57,20 @@
#define nmps_data_info
/* Data structure for one dataobjekt in a NMpsCell and NMpsSelectCell */
typedef struct {
pwr_tFloat32 *DataP;
pwr_tFloat32 *DataP pwr_dAlignLW;
pwr_tObjid Data_ObjId pwr_dAlignLW;
pwr_tBoolean Data_Front pwr_dAlignW;
pwr_tBoolean Data_Back pwr_dAlignW;
gdh_tDlid Data_Dlid pwr_dAlignW;
pwr_tBoolean Data_Select pwr_dAlignW;
pwr_tBoolean Data_OldSelect pwr_dAlignW;
// pwr_tInt32 filler;
} plc_t_DataInfo;
/* Data structure for one dataobjekt in a NMpsMirrorCell */
typedef struct {
pwr_tFloat32 *DataP;
pwr_tObjid Data_ObjId pwr_dAlignW;
pwr_tFloat32 *DataP pwr_dAlignLW;
pwr_tObjid Data_ObjId pwr_dAlignLW;
gdh_tDlid Data_Dlid pwr_dAlignW;
} plc_t_DataInfoMirCell;
#endif
......
......@@ -388,12 +388,16 @@ nmpsappl_MirrorInit(
switch ( cellist_ptr->classid)
{
case pwr_cClass_NMpsCell:
case pwr_cClass_NMpsCell60:
case pwr_cClass_NMpsCell120:
case pwr_cClass_NMpsStoreCell:
case pwr_cClass_NMpsStoreCell60:
case pwr_cClass_NMpsStoreCell120:
maxsize =
((pwr_sClass_NMpsCell *) cellist_ptr->object_ptr)->MaxSize;
applctx->total_cellsize += maxsize;
cellist_ptr->tmp_size = sizeof( pwr_sClass_NMpsCell) -
sizeof( plc_t_DataInfo) * ( NMPS_CELL_SIZE - maxsize);
sizeof( plc_t_DataInfo) * ( 30 - maxsize);
break;
case pwr_cClass_NMpsMirrorCell:
maxsize =
......
This diff is collapsed.
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
-include ../../special.mk
-include ../special.mk
-include special.mk
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.
!
! Proview $Id$
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! 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.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
! pwrb_c_nmpscelldata.wb_load -- Defines the class NMpsCellData.
!
SObject NMps:Class
!/**
! @Version 1.0
! @Group MaterialPlanning,Plc
! @Summary Data objects link class.
!
! The NMpsCellData class is used to link data object is NMpCell object.
!
! @classlink NMpsCell60 nmps_nmpscell60.html
!*/
Object NMpsCellData $ClassDef 52
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_Connections
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "NMpsCellData"
EndBody
!/**
! Pointer to data object.
!*/
Object DataP $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
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_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! True if the front of the data object is inside the cell.
!*/
Object Data_Front $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! True if the back of the data object is inside the cell.
!*/
Object Data_Back $Attribute 4
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! Realtime database direct link identiy.
!*/
Object Data_Dlid $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$RefId"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! True if the data is selected.
!*/
Object Data_Select $Attribute 6
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! Stored value of Data_Select to detect changes.
!*/
Object Data_SelectOld $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
EndObject
!
! Template object
!
Object Template NMpsCellData
Body RtBody
EndBody
EndObject
EndObject
EndSObject
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