Commit 6934ff89 authored by Claes Sjofors's avatar Claes Sjofors

More 64 bit corrections

parent a6142d98
......@@ -391,7 +391,7 @@ void CompOnOffBurnerFo_exec( plc_sThread *tp,
pwr_tFloat32 Cnt;
zono = (pwr_sClass_CompOnOffZoneFo *)
((char *)o->InP - sizeof(pwr_tAttrRef) - 24);
((char *)o->InP - (sizeof(pwr_sClass_CompOnOffZoneFo) - pwr_AlignLW(sizeof(pwr_tFloat32))));
zonco = (pwr_sClass_CompOnOffZone *)zono->PlcConnectP;
if ( !co || !zonco)
......
......@@ -50,8 +50,10 @@ typedef struct {
pwr_tRefId refid;
} sJid;
#if defined OS_LINUX && defined HW_X86_64
static tree_sTable *jid_table = 0;
static int jid_next = 1;
#endif
static int gdh_ExtractNameSuffix( char *Name,
char **Suffix);
......
......@@ -530,8 +530,8 @@ jobject convertAlarmOrInfoToMhrEvent( mh_sMessage *MsgP)
char birthTime_str[40];
pwr_tObjid objid = MsgP->Info.Object;
pwr_tTime time = MsgP->Info.EventTime;
pwr_tTime birthTime = MsgP->Info.Id.BirthTime;
pwr_tTime time = net_NetTimeToTime( &MsgP->Info.EventTime);
pwr_tTime birthTime = net_NetTimeToTime( &MsgP->Info.Id.BirthTime);
//hmta enviormentpekaren
jvm->AttachCurrentThread((void **)&env,NULL);
......@@ -618,9 +618,9 @@ jobject convertReturnToMhrEvent( mh_sReturn *MsgP)
char birthTime_str[40];
pwr_tObjid objid = MsgP->Info.Object;
pwr_tTime time = MsgP->Info.EventTime;
pwr_tTime birthTime = MsgP->Info.Id.BirthTime;
pwr_tTime targetBirthTime = MsgP->TargetId.BirthTime;
pwr_tTime time = net_NetTimeToTime( &MsgP->Info.EventTime);
pwr_tTime birthTime = net_NetTimeToTime( &MsgP->Info.Id.BirthTime);
pwr_tTime targetBirthTime = net_NetTimeToTime( &MsgP->TargetId.BirthTime);
//hmta enviormentpekaren
jvm->AttachCurrentThread((void **)&env,NULL);
......@@ -710,9 +710,9 @@ jobject convertAckToMhrEvent( mh_sAck *MsgP)
char birthTime_str[40];
pwr_tObjid objid = MsgP->Info.SupObject;
pwr_tTime time = MsgP->Info.EventTime;
pwr_tTime birthTime = MsgP->Info.Id.BirthTime;
pwr_tTime targetBirthTime = MsgP->TargetId.BirthTime;
pwr_tTime time = net_NetTimeToTime( &MsgP->Info.EventTime);
pwr_tTime birthTime = net_NetTimeToTime( &MsgP->Info.Id.BirthTime);
pwr_tTime targetBirthTime = net_NetTimeToTime( &MsgP->TargetId.BirthTime);
//hmta enviormentpekaren
jvm->AttachCurrentThread((void **)&env,NULL);
......
......@@ -76,6 +76,7 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Mh_outunitAck
jfieldID idx_fid;
jfieldID birthTime_fid;
jclass mhrsEventId_class;
pwr_tTime t;
jclass pwrtStatus_id = NULL;
static jmethodID pwrtStatus_cid = NULL;
......@@ -145,7 +146,8 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Mh_outunitAck
sts = -1;//out of memory
}
time_AsciiToA(str_copy, &eventId.BirthTime);
t = net_NetTimeToTime( &eventId.BirthTime);
time_AsciiToA(str_copy, &t);
sts = mh_OutunitAck(&eventId);
(*env)->ReleaseStringUTFChars(env,jstr,str_copy);
......@@ -319,9 +321,9 @@ pwr_tStatus ev_mh_ack_bc( mh_sAck *MsgP)
char birthTime_str[40];
pwr_tObjid objid = MsgP->Info.SupObject;
pwr_tTime time = MsgP->Info.EventTime;
pwr_tTime birthTime = MsgP->Info.Id.BirthTime;
pwr_tTime targetBirthTime = MsgP->TargetId.BirthTime;
pwr_tTime time = net_NetTimeToTime( &MsgP->Info.EventTime);
pwr_tTime birthTime = net_NetTimeToTime( &MsgP->Info.Id.BirthTime);
pwr_tTime targetBirthTime = net_NetTimeToTime( &MsgP->TargetId.BirthTime);
//hmta enviormentpekaren
(*jvm)->AttachCurrentThread(jvm,(void **)&env,NULL);
......@@ -406,9 +408,9 @@ pwr_tStatus ev_mh_return_bc( mh_sReturn *MsgP)
char birthTime_str[40];
pwr_tObjid objid = MsgP->Info.Object;
pwr_tTime time = MsgP->Info.EventTime;
pwr_tTime birthTime = MsgP->Info.Id.BirthTime;
pwr_tTime targetBirthTime = MsgP->TargetId.BirthTime;
pwr_tTime time = net_NetTimeToTime( &MsgP->Info.EventTime);
pwr_tTime birthTime = net_NetTimeToTime( &MsgP->Info.Id.BirthTime);
pwr_tTime targetBirthTime = net_NetTimeToTime( &MsgP->TargetId.BirthTime);
//hmta enviormentpekaren
(*jvm)->AttachCurrentThread(jvm,(void **)&env,NULL);
......@@ -491,8 +493,8 @@ pwr_tStatus ev_mh_alarm_bc( mh_sMessage *MsgP)
char birthTime_str[40];
pwr_tObjid objid = MsgP->Info.Object;
pwr_tTime time = MsgP->Info.EventTime;
pwr_tTime birthTime = MsgP->Info.Id.BirthTime;
pwr_tTime time = net_NetTimeToTime( &MsgP->Info.EventTime);
pwr_tTime birthTime = net_NetTimeToTime( &MsgP->Info.Id.BirthTime);
//hmta enviormentpekaren
(*jvm)->AttachCurrentThread(jvm,(void **)&env,NULL);
......@@ -569,8 +571,8 @@ pwr_tStatus ev_mh_info_bc( mh_sMessage *MsgP)
char birthTime_str[40];
pwr_tObjid objid = MsgP->Info.Object;
pwr_tTime time = MsgP->Info.EventTime;
pwr_tTime birthTime = MsgP->Info.Id.BirthTime;
pwr_tTime time = net_NetTimeToTime( &MsgP->Info.EventTime);
pwr_tTime birthTime = net_NetTimeToTime( &MsgP->Info.Id.BirthTime);
//hmta enviormentpekaren
(*jvm)->AttachCurrentThread(jvm,(void **)&env,NULL);
......
......@@ -1064,9 +1064,11 @@ Volume OtherManufacturer $ClassVolume 0.0.250.1
! A pointer to the status word in the profibus module object.
!*/
Object IoStatus $Attribute 38 03-OCT-2007 10:47:30.26
Body SysBody 08-OCT-2007 13:05:34.49
Body SysBody 16-JUN-2009 17:16:40.60
Attr PgmName = "IoStatus"
Attr Size = 4
Attr Flags = 1041
Attr ParamIndex = 48
Attr TypeRef = "pwrs:Type-$Status"
EndBody
EndObject
......@@ -11349,7 +11351,7 @@ XS : activa alarms
EndObject
Object GetIpPtr27 GetIpPtr 1258 04-OCT-2007 13:18:38.36
Body RtBody 04-OCT-2007 13:18:55.87
Attr IpPtrObject = "$PlcMain:OtherManufacturer-Class-Eurotherm_TC3001.IoStatus"
Attr IpPtrObject = "$PlcMain:OtherManufacturer-Class-Eurotherm_TC3001"
EndBody
Body DevBody 12-OCT-2007 16:51:57.96
Buffer PlcNode
......@@ -14884,7 +14886,7 @@ else
EndObject
Object StoIpPtr3 StoIpPtr 1324 05-OCT-2007 10:52:49.91
Body RtBody 05-OCT-2007 10:53:15.22
Attr IpPtrObject = "$PlcMain:OtherManufacturer-Class-Eurotherm_TC3001.IoStatus"
Attr IpPtrObject = "$PlcMain:OtherManufacturer-Class-Eurotherm_TC3001"
EndBody
Body DevBody 11-OCT-2007 17:14:19.59
Buffer PlcNode
......@@ -24063,9 +24065,11 @@ Eurotherm TC3001 Aggregate
EndBody
EndObject
Object IoStatus $Attribute 36 26-MAR-2007 09:07:46.99
Body SysBody 26-MAR-2007 09:08:20.20
Body SysBody 16-JUN-2009 17:22:48.85
Attr PgmName = "IoStatus"
Attr Size = 4
Attr Flags = 1
Attr ParamIndex = 40
Attr TypeRef = "pwrs:Type-$Status"
EndBody
EndObject
......@@ -24461,9 +24465,11 @@ Eurotherm TC3001 Aggregate
EndBody
EndObject
Object IoStatus $Attribute 44 30-MAR-2007 14:36:26.29
Body SysBody 30-MAR-2007 14:36:26.29
Body SysBody 16-JUN-2009 17:23:25.33
Attr PgmName = "IoStatus"
Attr Size = 4
Attr Flags = 1
Attr ParamIndex = 48
Attr TypeRef = "pwrs:Type-$Status"
EndBody
EndObject
......@@ -235,7 +235,7 @@ Insert (
memset(&data, 0, sizeof(data));
eventKey.Id = ip->Id;
eventKey.EventTime = ip->EventTime;
eventKey.EventTime = net_NetTimeToTime( &ip->EventTime);
/* copy the data do the DBT-structs*/
key.data = (void *)&eventKey;
......@@ -426,7 +426,7 @@ CopyEvent (
sp = malloc(sizeof(sEvent));
sp->EventType = ip->EventType;
sp->EventTime = ip->EventTime;
sp->EventTime = net_NetTimeToTime( &ip->EventTime);
switch (ip->EventType) {
case mh_eEvent_Alarm:
......
......@@ -276,19 +276,19 @@ struct s_SupActive {
};
struct s_ASup {
pwr_tFloat32 *InP;
pwr_tFloat32 In;
sSup Sup;
mh_sASupInfo Info;
sTimer Timer;
pwr_tFloat32 *InP pwr_dAlignLW;
pwr_tFloat32 In pwr_dAlignLW;
sSup Sup pwr_dAlignLW;
mh_sASupInfo Info pwr_dAlignW;
sTimer Timer pwr_dAlignLW;
};
struct s_DSup {
pwr_tBoolean *InP;
pwr_tBoolean In;
sSup Sup;
mh_sDSupInfo Info;
sTimer Timer;
pwr_tBoolean *InP pwr_dAlignLW;
pwr_tBoolean In pwr_dAlignLW;
sSup Sup pwr_dAlignLW;
mh_sDSupInfo Info pwr_dAlignW;
sTimer Timer pwr_dAlignLW;
};
struct s_ApplActive {
......@@ -2843,7 +2843,7 @@ isValidApplication (
} else {
ap = LstObj(al);
if (memcmp(&ap->birthTime, &hp->birthTime, sizeof(ap->birthTime)) != 0) {
if (ap->birthTime.tv_sec != hp->birthTime.tv_sec) {
/* Different times, i.e. the application is restarted */
ap->link.source = mh_eSource_Application;
ap->link.qid = hp->qid;
......@@ -2906,7 +2906,7 @@ isValidOutunit (
} else {
op = LstObj(ol);
if (memcmp(&op->birthTime, &hp->birthTime, sizeof(op->birthTime)) != 0) {
if (op->birthTime.tv_sec != hp->birthTime.tv_sec) {
/* Different times, i.e. the outunit is restarted */
op->link.source = mh_eSource_Outunit;
op->link.qid = hp->qid;
......
......@@ -939,7 +939,7 @@ isValidHandler (
} else {
hp = LstObj(hl);
if (memcmp(&hp->birthTime, &p->birthTime, sizeof(hp->birthTime)) != 0) {
if ( hp->birthTime.tv_sec != p->birthTime.tv_sec) {
/* Different times, i.e. the handler is restarted */
hp->birthTime = net_NetTimeToTime( &p->birthTime);
hp->qid = p->qid;
......
......@@ -74,7 +74,7 @@
) { \
if (o->Action) o->Action = FALSE; \
if (o->ReturnCheck) { \
clock_gettime(CLOCK_REALTIME, &o->ReturnTime); \
time_GetTime(&o->ReturnTime); \
o->ReturnCheck = FALSE; \
o->ReturnSend = TRUE; \
} \
......@@ -90,7 +90,7 @@
if (o->DetectCheck) { \
o->ActualValue = In; \
timer_in(tp, o); \
clock_gettime(CLOCK_REALTIME, &o->DetectTime); \
time_GetTime(&o->DetectTime); \
o->DetectCheck = FALSE; \
} \
if (!o->TimerFlag) { \
......@@ -135,7 +135,7 @@
if (In != o->CtrlPosition) { \
if (o->Action) o->Action = FALSE; \
if (o->ReturnCheck) { \
clock_gettime(CLOCK_REALTIME, &o->ReturnTime); \
time_GetTime( &o->ReturnTime); \
o->ReturnCheck = FALSE; \
o->ReturnSend = TRUE; \
} \
......@@ -149,7 +149,7 @@
if (o->DetectCheck) { \
o->ActualValue = In; \
timer_in(tp, o); \
clock_gettime(CLOCK_REALTIME, &o->DetectTime); \
time_GetTime(&o->DetectTime); \
o->DetectCheck = FALSE; \
} \
if (!o->TimerFlag) { \
......
......@@ -87,6 +87,7 @@ void wb_build::node( char *nodename, void *volumelist, int volumecnt)
int rebuild = 1;
pwr_tStatus status;
char currentnode[80];
char node[80];
pwr_tStatus sumsts;
printf( "Build node %s\n", nodename);
......@@ -118,6 +119,7 @@ void wb_build::node( char *nodename, void *volumelist, int volumecnt)
if ( EVEN(status)) {
rebuild = 1;
}
strcpy( node, vlist[i].p2);
}
if ( vlist[i].volume_id == m_session.vid()) {
......@@ -156,14 +158,14 @@ void wb_build::node( char *nodename, void *volumelist, int volumecnt)
syi_NodeName( &m_sts, currentnode, sizeof(currentnode));
if ( cdh_NoCaseStrcmp( nodename, currentnode) == 0) {
if ( cdh_NoCaseStrcmp( node, currentnode) == 0) {
pwr_tFileName src_fname, dest_fname;
pwr_tCmd cmd;
pwr_tTime dest_time, src_time;
// Copy xtt_help.dat from $pwrp_cnf to $pwrp_exe
sprintf( src_fname, "$pwrp_cnf/%s/xtt_help.dat", nodename);
sprintf( src_fname, "$pwrp_cnf/%s/xtt_help.dat", node);
dcli_translate_filename( src_fname, src_fname);
m_sts = dcli_file_time( src_fname, &src_time);
if ( evenSts()) {
......@@ -195,7 +197,7 @@ void wb_build::node( char *nodename, void *volumelist, int volumecnt)
sumsts = m_sts;
// Copy pwrp_alias.dat from $pwrp_cnf to $pwrp_load
sprintf( src_fname, "$pwrp_cnf/%s/pwrp_alias.dat", nodename);
sprintf( src_fname, "$pwrp_cnf/%s/pwrp_alias.dat", node);
dcli_translate_filename( src_fname, src_fname);
m_sts = dcli_file_time( src_fname, &src_time);
if ( evenSts()) {
......@@ -224,26 +226,26 @@ void wb_build::node( char *nodename, void *volumelist, int volumecnt)
if ( sumsts == PWRB__NOBUILT && m_sts != PWRB__NOBUILT)
sumsts = m_sts;
// Copy ld_appl_...txt from $pwrp_cnf to $pwrp_exe
sprintf( src_fname, load_cNameAppl, "$pwrp_cnf", nodename, bussid);
// Copy ld_appl_...txt from $pwrp_cnf to $pwrp_load
sprintf( src_fname, load_cNameAppl, "$pwrp_cnf", node, bussid);
dcli_translate_filename( src_fname, src_fname);
m_sts = dcli_file_time( src_fname, &src_time);
if ( evenSts()) {
char dir[80];
strcpy( dir, "$pwrp_cnf/");
sprintf( src_fname, load_cNameAppl, dir, nodename, bussid);
sprintf( src_fname, load_cNameAppl, dir, node, bussid);
dcli_translate_filename( src_fname, src_fname);
m_sts = dcli_file_time( src_fname, &src_time);
}
if ( oddSts()) {
sprintf( dest_fname, load_cNameAppl, "$pwrp_exe/", nodename, bussid);
sprintf( dest_fname, load_cNameAppl, "$pwrp_load/", node, bussid);
dcli_translate_filename( dest_fname, dest_fname);
m_sts = dcli_file_time( dest_fname, &dest_time);
if ( opt.force || evenSts() || src_time.tv_sec > dest_time.tv_sec) {
sprintf( cmd, "cp %s %s", src_fname, dest_fname);
system( cmd);
sprintf( cmd, "Build: %s -> $pwrp_exe", src_fname);
sprintf( cmd, "Build: %s -> $pwrp_load", src_fname);
MsgWindow::message( 'I', cmd, msgw_ePop_No);
m_sts = PWRB__SUCCESS;
}
......
......@@ -413,7 +413,7 @@ void EvList::event_info( mh_sMessage *msg)
return;
if ( type != ev_eType_HistList ) {
sts = get_destination( event->Info.EventTime, (void **)&dest);
sts = get_destination( net_NetTimeToTime( &event->Info.EventTime), (void **)&dest);
if ( EVEN(sts)) {
dest_code = flow_eDest_IntoLast;
dest_node = NULL;
......@@ -429,12 +429,12 @@ void EvList::event_info( mh_sMessage *msg)
}
new ItemAlarm( this, "Alarm",
event->Info.EventTime, event->Msg.EventText,
event->Info.EventName, event->Info.EventFlags,
event->Info.EventPrio, event->Info.Id,
event->Info.Object, &event->Msg.EventSound,
event->Msg.EventMoreText, msg->Status,
evlist_eEventType_Info, dest_node, dest_code);
net_NetTimeToTime( &event->Info.EventTime), event->Msg.EventText,
event->Info.EventName, event->Info.EventFlags,
event->Info.EventPrio, event->Info.Id,
event->Info.Object, &event->Msg.EventSound,
event->Msg.EventMoreText, msg->Status,
evlist_eEventType_Info, dest_node, dest_code);
size++;
}
......@@ -458,7 +458,7 @@ void EvList::event_alarm( mh_sMessage *msg)
return;
}
if ( type != ev_eType_HistList ) {
sts = get_destination( event->Info.EventTime, (void **)&dest);
sts = get_destination( net_NetTimeToTime( &event->Info.EventTime), (void **)&dest);
if ( EVEN(sts)) {
dest_code = flow_eDest_IntoLast;
dest_node = NULL;
......@@ -474,12 +474,12 @@ void EvList::event_alarm( mh_sMessage *msg)
}
new ItemAlarm( this, "Alarm",
event->Info.EventTime, event->Msg.EventText,
event->Info.EventName, event->Info.EventFlags,
event->Info.EventPrio, event->Info.Id,
event->Info.Object, &event->Msg.EventSound,
event->Msg.EventMoreText, msg->Status,
evlist_eEventType_Alarm, dest_node, dest_code);
net_NetTimeToTime( &event->Info.EventTime), event->Msg.EventText,
event->Info.EventName, event->Info.EventFlags,
event->Info.EventPrio, event->Info.Id,
event->Info.Object, &event->Msg.EventSound,
event->Msg.EventMoreText, msg->Status,
evlist_eEventType_Alarm, dest_node, dest_code);
size++;
}
......@@ -504,7 +504,7 @@ void EvList::event_block( mh_sBlock *msg)
brow_DeleteNode( brow->ctx, item->node);
size--;
}
sts = get_destination( event->Info.EventTime, (void **)&dest);
sts = get_destination( net_NetTimeToTime( &event->Info.EventTime), (void **)&dest);
if ( EVEN(sts)) {
dest_code = flow_eDest_IntoLast;
dest_node = NULL;
......@@ -523,7 +523,7 @@ void EvList::event_block( mh_sBlock *msg)
strcpy( text, "Unknown");
new ItemAlarm( this, "Alarm",
event->Info.EventTime, event->Info.EventName,
net_NetTimeToTime( &event->Info.EventTime), event->Info.EventName,
text, event->Info.EventFlags,
event->Info.EventPrio, event->Info.Id,
event->Info.Object, 0, 0, 0, evlist_eEventType_Block,
......@@ -579,7 +579,7 @@ void EvList::event_block( mh_sBlock *msg)
dest_node = NULL;
ItemAlarm *item = new ItemAlarm( this, "Alarm",
event->Info.EventTime, text,
net_NetTimeToTime( &event->Info.EventTime), text,
event->Info.EventName, event->Info.EventFlags,
event->Info.EventPrio, event->Info.Id,
event->Info.Object, 0, 0, 0, evlist_eEventType_Block,
......@@ -649,7 +649,7 @@ void EvList::event_ack( mh_sAck *msg)
if ( type == ev_eType_EventList || type == ev_eType_HistList) {
if(type == ev_eType_EventList) {
sts = get_destination( event->Info.EventTime, (void **)&dest);
sts = get_destination( net_NetTimeToTime( &event->Info.EventTime), (void **)&dest);
if ( EVEN(sts)) {
dest_code = flow_eDest_IntoLast;
dest_node = NULL;
......@@ -664,7 +664,7 @@ void EvList::event_ack( mh_sAck *msg)
dest_node = NULL;
}
new ItemAlarm( this, "Alarm",
event->Info.EventTime, "",
net_NetTimeToTime( &event->Info.EventTime), "",
event->Info.EventName, event->Info.EventFlags,
event->Info.EventPrio, event->Info.Id,
event->Info.Object, 0, 0, 0, evlist_eEventType_Ack,
......@@ -712,7 +712,7 @@ void EvList::event_return( mh_sReturn *msg)
if ( type == ev_eType_EventList || type == ev_eType_HistList) {
if(type == ev_eType_EventList) {
sts = get_destination( event->Info.EventTime, (void **)&dest);
sts = get_destination( net_NetTimeToTime( &event->Info.EventTime), (void **)&dest);
if ( EVEN(sts)) {
dest_code = flow_eDest_IntoLast;
dest_node = NULL;
......@@ -727,11 +727,11 @@ void EvList::event_return( mh_sReturn *msg)
dest_node = NULL;
}
new ItemAlarm( this, "Alarm",
event->Info.EventTime, event->Msg.EventText,
event->Info.EventName, event->Info.EventFlags,
event->Info.EventPrio, event->Info.Id,
event->Info.Object, 0, 0, 0, evlist_eEventType_Return,
dest_node, dest_code);
net_NetTimeToTime( &event->Info.EventTime), event->Msg.EventText,
event->Info.EventName, event->Info.EventFlags,
event->Info.EventPrio, event->Info.Id,
event->Info.Object, 0, 0, 0, evlist_eEventType_Return,
dest_node, dest_code);
size++;
}
......
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