Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
16ebc80d
Commit
16ebc80d
authored
Jan 10, 2006
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved from src
parent
9c6fe08d
Changes
25
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
5936 additions
and
0 deletions
+5936
-0
tlog/exe/rs_tlog/src/os_linux/hw_x86/makefile
tlog/exe/rs_tlog/src/os_linux/hw_x86/makefile
+12
-0
tlog/exe/rs_tlog/src/rs_tlog.c
tlog/exe/rs_tlog/src/rs_tlog.c
+2058
-0
tlog/exe/rs_tlog_diff/src/rs_tlog_diff.c
tlog/exe/rs_tlog_diff/src/rs_tlog_diff.c
+152
-0
tlog/exe/rs_tlog_diff/src/tlog_cld.cld
tlog/exe/rs_tlog_diff/src/tlog_cld.cld
+44
-0
tlog/exe/rs_tlog_diff/src/tlog_cli.c
tlog/exe/rs_tlog_diff/src/tlog_cli.c
+244
-0
tlog/exe/rs_tlog_diff/src/tlog_diff.c
tlog/exe/rs_tlog_diff/src/tlog_diff.c
+1498
-0
tlog/exe/rs_tlog_diff/src/tlog_diff.h
tlog/exe/rs_tlog_diff/src/tlog_diff.h
+45
-0
tlog/wbl/tlog/src/os_linux/hw_x86/makefile
tlog/wbl/tlog/src/os_linux/hw_x86/makefile
+85
-0
tlog/wbl/tlog/src/tlog_c_atlog.wb_load
tlog/wbl/tlog/src/tlog_c_atlog.wb_load
+141
-0
tlog/wbl/tlog/src/tlog_c_catlog.wb_load
tlog/wbl/tlog/src/tlog_c_catlog.wb_load
+134
-0
tlog/wbl/tlog/src/tlog_c_cdtlog.wb_load
tlog/wbl/tlog/src/tlog_c_cdtlog.wb_load
+134
-0
tlog/wbl/tlog/src/tlog_c_chgatlog.wb_load
tlog/wbl/tlog/src/tlog_c_chgatlog.wb_load
+122
-0
tlog/wbl/tlog/src/tlog_c_chgotlog.wb_load
tlog/wbl/tlog/src/tlog_c_chgotlog.wb_load
+125
-0
tlog/wbl/tlog/src/tlog_c_cotlog.wb_load
tlog/wbl/tlog/src/tlog_c_cotlog.wb_load
+134
-0
tlog/wbl/tlog/src/tlog_c_dtlog.wb_load
tlog/wbl/tlog/src/tlog_c_dtlog.wb_load
+137
-0
tlog/wbl/tlog/src/tlog_c_execplcoff.wb_load
tlog/wbl/tlog/src/tlog_c_execplcoff.wb_load
+106
-0
tlog/wbl/tlog/src/tlog_c_execplcon.wb_load
tlog/wbl/tlog/src/tlog_c_execplcon.wb_load
+106
-0
tlog/wbl/tlog/src/tlog_c_tlogconfigure.wb_load
tlog/wbl/tlog/src/tlog_c_tlogconfigure.wb_load
+68
-0
tlog/wbl/tlog/src/tlog_c_tlogexecalloff.wb_load
tlog/wbl/tlog/src/tlog_c_tlogexecalloff.wb_load
+111
-0
tlog/wbl/tlog/src/tlog_c_tlogexecallon.wb_load
tlog/wbl/tlog/src/tlog_c_tlogexecallon.wb_load
+111
-0
tlog/wbl/tlog/src/tlog_c_tlogmodify.wb_load
tlog/wbl/tlog/src/tlog_c_tlogmodify.wb_load
+130
-0
tlog/wbl/tlog/src/tlog_c_tlogopen.wb_load
tlog/wbl/tlog/src/tlog_c_tlogopen.wb_load
+139
-0
tlog/wbl/tlog/src/tlog_ch_tlogclasses.wb_load
tlog/wbl/tlog/src/tlog_ch_tlogclasses.wb_load
+24
-0
tlog/wbl/tlog/src/tlog_l_base.wb_load
tlog/wbl/tlog/src/tlog_l_base.wb_load
+54
-0
tlog/wbl/tlog/src/tlog_v.wb_load
tlog/wbl/tlog/src/tlog_v.wb_load
+22
-0
No files found.
tlog/exe/rs_tlog/src/os_linux/hw_x86/makefile
0 → 100644
View file @
16ebc80d
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
tlog/exe/rs_tlog/src/rs_tlog.c
0 → 100644
View file @
16ebc80d
/*
* Proview $Id: rs_tlog.c,v 1.1 2006-01-10 14:38:36 claes Exp $
* 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.
*/
/************************************************************************
*
* Filename: rs_tlog.c
* Date Pgm. Read. Remark
* Modified 940104 CS Initial creation
*
* Description:
* Test Logging Handler.
*
**************************************************************************/
/*_Include files_________________________________________________________*/
#ifdef OS_VMS
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <descrip.h>
#include <string.h>
#include <starlet.h>
#include <lib$routines.h>
#endif
#if defined OS_LYNX || defined OS_LINUX
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#endif
#ifdef OS_ELN
#include stdio
#include stdlib
#include signal
#include descrip
#include string
#include starlet
#include lib$routines
#endif
#include "pwr.h"
#include "pwr_class.h"
#include "pwr_baseclasses.h"
#include "rt_errh.h"
#include "pwr_tlogclasses.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include "rt_gdh.h"
#include "rt_gdh_msg.h"
#ifndef rt_mh_h
#include "rt_mh.h"
#endif
#ifndef rt_mh_outunit_h
#include "rt_mh_outunit.h"
#endif
#include "rt_mh_msg.h"
#include "rt_mh_appl.h"
#include "rs_tlog_msg.h"
#include "co_time.h"
/* Nice functions */
#define ODD(a) (((int)(a) & 1) != 0)
#define EVEN(a) (((int)(a) & 1) == 0)
#define max(Dragon,Eagle) ((Dragon) > (Eagle) ? (Dragon) : (Eagle))
#define min(Dragon,Eagle) ((Dragon) < (Eagle) ? (Dragon) : (Eagle))
#ifndef __ALPHA
#define abs(Dragon) ((Dragon) >= 0 ? (Dragon) : (-(Dragon)))
#endif
#define LogAndExit( status) \
{\
errh_CErrLog(status, NULL);\
exit( status);\
}
typedef
union
alau_Event
ala_uEvent
;
union
alau_Event
{
mh_sMsgInfo
Info
;
mh_sAck
Ack
;
mh_sMessage
Msg
;
mh_sReturn
Return
;
};
#define TLOG_ALLOC 50
typedef
struct
{
pwr_tObjid
objid
;
char
name
[
80
];
char
*
object_ptr
;
gdh_tDlid
subid
;
}
tlog_t_objectlist
;
enum
tlog_ee_logtype
{
tlog_logtype_DtLogUp
,
tlog_logtype_DtLogDown
,
tlog_logtype_AtLogUp
,
tlog_logtype_AtLogDown
,
tlog_logtype_Info
,
tlog_logtype_AlarmA
,
tlog_logtype_AlarmB
,
tlog_logtype_AlarmC
,
tlog_logtype_AlarmD
,
tlog_logtype_Modify
,
tlog_logtype_UnModify
,
tlog_logtype_Close
,
tlog_logtype_CAtLog
,
tlog_logtype_CDtLog
,
tlog_logtype_COtLog
,
tlog_logtype_ExecOn
,
tlog_logtype_ExecOff
,
tlog_logtype_ChgAtLog
,
tlog_logtype_ChgOtLog
};
typedef
enum
tlog_ee_logtype
tlog_e_logtype
;
typedef
struct
{
pwr_tObjid
objid
;
tlog_e_logtype
logtype
;
pwr_tString80
logtext
;
pwr_tAName
attrname
;
pwr_tTime
logtime
;
pwr_tDeltaTime
diftime
;
}
tlog_t_loglist
;
typedef
struct
{
FILE
*
outfile
;
pwr_tObjid
objid
;
int
listindex
;
int
extselectlist
;
pwr_tTime
open_time
;
pwr_sClass_TLogOpen
*
object_ptr
;
pwr_tOName
TLogSelectList
[
10
];
}
tlog_t_filectx
;
typedef
struct
{
pwr_tObjid
objid
;
int
deleted
;
int
check
;
pwr_tOName
TLogSelectList
[
10
];
pwr_tOName
AlarmSelectList
[
10
];
}
tlog_t_selectlist
;
/*** Local variables *****************************************************/
static
pwr_sClass_TLogConfigure
*
tlog_TLogConf
;
static
tlog_t_loglist
*
log_list
;
static
int
log_count
;
static
int
log_alloc
;
static
tlog_t_filectx
filectx
;
static
tlog_t_selectlist
selectlists
[
20
];
static
int
selectlist_count
;
static
int
selectlist_current
;
static
int
log
=
0
;
static
pwr_tUInt32
tlog_sleep
(
float
time
);
static
pwr_tUInt32
tlog_exec_off_all
(
pwr_tObjid
objid
);
static
pwr_tUInt32
tlog_exec_on_all
(
pwr_tObjid
objid
);
static
pwr_tUInt32
tlog_file_close
(
tlog_t_filectx
*
filectx
);
static
pwr_tUInt32
tlog_extselectlist_reset
(
tlog_t_filectx
*
filectx
);
static
pwr_tUInt32
tlog_selectlist_modify
(
tlog_t_filectx
*
filectx
,
pwr_tObjid
objid
);
static
pwr_tUInt32
tlog_extselectlist_unmodify
(
tlog_t_filectx
*
filectx
,
pwr_tObjid
objid
);
static
pwr_tUInt32
tlog_selectlist_check
(
tlog_t_filectx
*
filectx
,
pwr_tObjid
objid
);
static
pwr_tUInt32
tlog_extselectlist_check
(
tlog_t_filectx
*
filectx
,
pwr_tObjid
objid
);
static
pwr_tUInt32
tlog_extselectlist_modify
(
tlog_t_filectx
*
filectx
,
pwr_tObjid
objid
,
pwr_sClass_User
*
UserObject
,
pwr_tObjid
*
tlog_selectlist
,
pwr_tObjid
*
alarm_selectlist
);
static
pwr_tUInt32
tlog_selectlist_unmodify
(
tlog_t_filectx
*
filectx
,
pwr_tObjid
objid
,
pwr_sClass_User
*
UserObject
);
static
pwr_tStatus
tlog_mh_info_bc
(
mh_sMessage
*
MsgP
);
static
pwr_tStatus
tlog_mh_alarm_bc
(
mh_sMessage
*
MsgP
);
static
pwr_tUInt32
tlog_alarm_update
()
;
static
pwr_tUInt32
tlog_alarm_connect
(
pwr_tObjid
user_object
);
static
pwr_tUInt32
tlog_loglist_sort
(
tlog_t_loglist
*
loglist
,
int
loglist_count
);
static
pwr_tUInt32
tlog_loglist_print
(
tlog_t_filectx
*
filectx
,
tlog_t_loglist
*
loglist
,
int
*
loglist_count
,
pwr_sClass_User
*
UserObject
);
static
pwr_tUInt32
tlog_loglist_add
(
tlog_t_filectx
*
filectx
,
pwr_tObjid
objid
,
tlog_e_logtype
logtype
,
pwr_tString80
*
logtext
,
pwr_sAttrRef
*
attribute
,
pwr_tString80
*
attrname
,
pwr_tTime
*
logtime
,
tlog_t_loglist
**
loglist
,
int
*
loglist_count
,
int
*
alloc
);
static
pwr_tUInt32
tlog_objectlist_add
(
pwr_tObjid
object_objid
,
pwr_tClassId
class
,
tlog_t_objectlist
**
objectlist
,
int
*
objectlist_count
,
int
*
alloc
);
static
pwr_tUInt32
tlog_object_add
(
pwr_tClassId
class
,
tlog_t_objectlist
**
objectlist
,
int
*
objectlist_count
,
int
*
object_alloc
);
static
pwr_tUInt32
tlog_timestring
(
pwr_tDeltaTime
*
time
,
char
*
timestr
);
static
pwr_tUInt32
tlog_fulltimestring
(
pwr_tTime
*
time
,
char
*
timestr
);
static
pwr_tUInt32
tlog_getfilename
(
pwr_tObjid
objid
,
char
*
filename
,
pwr_sClass_TLogConfigure
*
TLogConf
);
static
pwr_tUInt32
tlog_getconfigobject
(
pwr_sClass_TLogConfigure
**
TLogConf
,
pwr_sClass_User
**
UserObject
);
static
pwr_tUInt32
tlog_loglist_add
();
static
pwr_tUInt32
tlog_timestring
();
/****************************************************************************
* Name: tlog_sleep()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
* Sleep...
*
**************************************************************************/
static
pwr_tUInt32
tlog_sleep
(
float
time
)
{
#ifdef OS_VMS
int
sts
;
sts
=
lib
$
wait
(
&
time
);
#elif OS_ELN
LARGE_INTEGER
l_time
;
l_time
.
high
=
-
1
;
l_time
.
low
=
-
time
*
10000000
;
ker
$
wait_any
(
NULL
,
NULL
,
&
l_time
);
#else
pwr_tDeltaTime
p_time
;
time_FloatToD
(
&
p_time
,
time
);
nanosleep
(
(
pwr_tTime
*
)
&
p_time
,
NULL
);
#endif
return
TLOG__SUCCESS
;
}
/****************************************************************************
* Name: tlog_exec_off_all()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
* Turn execution of all plcpgm's off.
*
**************************************************************************/
static
pwr_tUInt32
tlog_exec_off_all
(
pwr_tObjid
objid
)
{
int
sts
;
pwr_tObjid
plcpgm
;
pwr_tClassId
class
;
pwr_tObjid
window
;
pwr_tObjid
parent
;
pwr_tOName
name
;
pwr_tBoolean
value
=
1
;
int
found
;
/* Get the plcpgm of the calling objid, it is not advisable to turn
execution of this plc off... */
found
=
0
;
sts
=
gdh_GetParent
(
objid
,
&
parent
);
while
(
ODD
(
sts
))
{
sts
=
gdh_GetObjectClass
(
parent
,
&
class
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
class
==
pwr_cClass_plc
)
{
found
=
1
;
break
;
}
sts
=
gdh_GetParent
(
parent
,
&
parent
);
}
if
(
!
found
)
return
sts
;
/* Get all plcpgm of this node */
sts
=
gdh_GetClassList
(
pwr_cClass_plc
,
&
plcpgm
);
while
(
ODD
(
sts
))
{
if
(
cdh_ObjidIsNotEqual
(
plcpgm
,
parent
))
{
/* Get the child window to the plc and set ScanOff to true */
sts
=
gdh_GetChild
(
plcpgm
,
&
window
);
while
(
ODD
(
sts
))
{
sts
=
gdh_GetObjectClass
(
window
,
&
class
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
class
==
pwr_cClass_windowplc
)
{
sts
=
gdh_ObjidToName
(
window
,
name
,
sizeof
(
name
),
cdh_mNName
);
if
(
EVEN
(
sts
))
return
sts
;
strcat
(
name
,
".ScanOff"
);
sts
=
gdh_SetObjectInfo
(
name
,
&
value
,
sizeof
(
value
));
if
(
EVEN
(
sts
))
return
sts
;
break
;
}
sts
=
gdh_GetNextSibling
(
window
,
&
window
);
}
}
sts
=
gdh_GetNextObject
(
plcpgm
,
&
plcpgm
);
}
return
TLOG__SUCCESS
;
}
/****************************************************************************
* Name: tlog_exec_on_all()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
* Turn execution of all plcpgm's on.
*
**************************************************************************/
static
pwr_tUInt32
tlog_exec_on_all
(
pwr_tObjid
objid
)
{
int
sts
;
pwr_tObjid
plcpgm
;
pwr_tClassId
class
;
pwr_tObjid
window
;
pwr_tAName
name
;
pwr_tBoolean
value
=
0
;
/* Get all initsteps of this node */
sts
=
gdh_GetClassList
(
pwr_cClass_plc
,
&
plcpgm
);
while
(
ODD
(
sts
))
{
/* Get the child window to the plc and set ScanOff to true */
sts
=
gdh_GetChild
(
plcpgm
,
&
window
);
while
(
ODD
(
sts
))
{
sts
=
gdh_GetObjectClass
(
window
,
&
class
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
class
==
pwr_cClass_windowplc
)
{
sts
=
gdh_ObjidToName
(
window
,
name
,
sizeof
(
name
),
cdh_mNName
);
if
(
EVEN
(
sts
))
return
sts
;
strcat
(
name
,
".ScanOff"
);
sts
=
gdh_SetObjectInfo
(
name
,
&
value
,
sizeof
(
value
));
if
(
EVEN
(
sts
))
return
sts
;
break
;
}
sts
=
gdh_GetNextSibling
(
window
,
&
window
);
}
sts
=
gdh_GetNextObject
(
plcpgm
,
&
plcpgm
);
}
return
TLOG__SUCCESS
;
}
/****************************************************************************
* Name: tlog_file_close()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
*
**************************************************************************/
static
pwr_tUInt32
tlog_file_close
(
tlog_t_filectx
*
filectx
)
{
fclose
(
filectx
->
outfile
);
filectx
->
outfile
=
0
;
filectx
->
open_time
.
tv_sec
=
0
;
filectx
->
open_time
.
tv_nsec
=
0
;
return
TLOG__SUCCESS
;
}
/****************************************************************************
* Name: tlog_extselectlist_reset()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
*
**************************************************************************/
static
pwr_tUInt32
tlog_extselectlist_reset
(
tlog_t_filectx
*
filectx
)
{
int
i
;
filectx
->
extselectlist
=
0
;
selectlist_current
=
selectlist_count
;
if
(
selectlist_count
==
0
)
return
TLOG__SUCCESS
;
for
(
i
=
0
;
i
<
selectlist_count
;
i
++
)
{
selectlists
[
i
].
check
=
0
;
}
if
(
selectlist_count
>
0
)
selectlists
[
selectlist_count
-
1
].
check
=
1
;
return
TLOG__SUCCESS
;
}
/****************************************************************************
* Name: tlog_selectlist_modify()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
*
**************************************************************************/
static
pwr_tUInt32
tlog_selectlist_modify
(
tlog_t_filectx
*
filectx
,
pwr_tObjid
objid
)
{
int
i
;
for
(
i
=
0
;
i
<
selectlist_count
;
i
++
)
{
if
(
cdh_ObjidIsEqual
(
objid
,
selectlists
[
i
].
objid
))
{
selectlist_current
=
i
+
1
;
break
;
}
}
if
(
log
)
printf
(
"mod num: %2d curr %2d check: %1d %1d %1d %1d
\n
"
,
selectlist_count
,
selectlist_current
,
selectlists
[
0
].
check
,
selectlists
[
1
].
check
,
selectlists
[
2
].
check
,
selectlists
[
3
].
check
);
return
TLOG__SUCCESS
;
}
/****************************************************************************
* Name: tlog_extselectlist_unmodify()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
*
**************************************************************************/
static
pwr_tUInt32
tlog_extselectlist_unmodify
(
tlog_t_filectx
*
filectx
,
pwr_tObjid
objid
)
{
int
i
,
j
;
for
(
i
=
0
;
i
<
selectlist_count
;
i
++
)
{
if
(
cdh_ObjidIsEqual
(
objid
,
selectlists
[
i
].
objid
))
{
if
(
selectlists
[
i
].
check
)
{
/* This is the current one, the previous should also be checked */
for
(
j
=
i
-
1
;
j
>=
0
;
j
--
)
{
if
(
!
selectlists
[
j
].
deleted
)
{
selectlists
[
j
].
check
=
1
;
filectx
->
extselectlist
=
1
;
break
;
}
}
}
break
;
}
}
if
(
log
)
printf
(
"extunmod num: %2d curr %2d check: %1d %1d %1d %1d
\n
"
,
selectlist_count
,
selectlist_current
,
selectlists
[
0
].
check
,
selectlists
[
1
].
check
,
selectlists
[
2
].
check
,
selectlists
[
3
].
check
);
return
TLOG__SUCCESS
;
}
/****************************************************************************
* Name: tlog_selectlist_check()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
*
**************************************************************************/
static
pwr_tUInt32
tlog_selectlist_check
(
tlog_t_filectx
*
filectx
,
pwr_tObjid
objid
)
{
int
i
,
j
;
int
sts
;
pwr_tOName
name
;
sts
=
gdh_ObjidToName
(
objid
,
name
,
sizeof
(
name
),
cdh_mNName
);
if
(
EVEN
(
sts
))
return
sts
;
j
=
0
;
i
=
selectlist_current
-
1
;
while
(
j
<
10
&&
selectlists
[
i
].
TLogSelectList
[
j
][
0
]
!=
0
)
{
if
(
strncmp
(
selectlists
[
i
].
TLogSelectList
[
j
],
name
,
strlen
(
selectlists
[
i
].
TLogSelectList
[
j
]))
==
0
)
return
TLOG__SUCCESS
;
j
++
;
}
return
TLOG__NOTSEL
;
}
/****************************************************************************
* Name: tlog_extselectlist_check()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
*
**************************************************************************/
static
pwr_tUInt32
tlog_extselectlist_check
(
tlog_t_filectx
*
filectx
,
pwr_tObjid
objid
)
{
int
i
,
j
;
int
sts
;
pwr_tOName
name
;
sts
=
gdh_ObjidToName
(
objid
,
name
,
sizeof
(
name
),
cdh_mNName
);
if
(
EVEN
(
sts
))
return
sts
;
for
(
i
=
0
;
i
<
selectlist_count
;
i
++
)
{
if
(
selectlists
[
i
].
check
)
{
j
=
0
;
while
(
j
<
10
&&
selectlists
[
i
].
TLogSelectList
[
j
][
0
]
!=
0
)
{
if
(
strncmp
(
selectlists
[
i
].
TLogSelectList
[
j
],
name
,
strlen
(
selectlists
[
i
].
TLogSelectList
[
j
]))
==
0
)
return
TLOG__SUCCESS
;
j
++
;
}
}
}
return
TLOG__NOTSEL
;
}
/****************************************************************************
* Name: tlog_extselectlist_modify()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
*
**************************************************************************/
static
pwr_tUInt32
tlog_extselectlist_modify
(
tlog_t_filectx
*
filectx
,
pwr_tObjid
objid
,
pwr_sClass_User
*
UserObject
,
pwr_tObjid
*
tlog_selectlist
,
pwr_tObjid
*
alarm_selectlist
)
{
pwr_tObjid
*
objid_ptr
;
int
i
;
int
sts
;
if
(
selectlist_count
>=
20
)
return
TLOG__MAXMODIFY
;
objid_ptr
=
tlog_selectlist
;
for
(
i
=
0
;
i
<
10
;
i
++
)
{
if
(
cdh_ObjidIsNotNull
(
*
objid_ptr
))
{
sts
=
gdh_ObjidToName
(
*
objid_ptr
,
filectx
->
TLogSelectList
[
i
],
sizeof
(
filectx
->
TLogSelectList
[
0
]),
cdh_mNName
);
if
(
EVEN
(
sts
))
return
sts
;
strcat
(
filectx
->
TLogSelectList
[
i
],
"-"
);
}
else
strcpy
(
filectx
->
TLogSelectList
[
i
],
""
);
objid_ptr
++
;
}
objid_ptr
=
alarm_selectlist
;
for
(
i
=
0
;
i
<
8
;
i
++
)
{
if
(
cdh_ObjidIsNotNull
(
*
objid_ptr
))
{
sts
=
gdh_ObjidToName
(
*
objid_ptr
,
UserObject
->
SelectList
[
i
],
sizeof
(
UserObject
->
SelectList
[
0
]),
cdh_mNName
);
if
(
EVEN
(
sts
))
return
sts
;
}
else
strcpy
(
UserObject
->
SelectList
[
i
],
""
);
objid_ptr
++
;
}
memcpy
(
&
selectlists
[
selectlist_count
].
TLogSelectList
,
&
filectx
->
TLogSelectList
,
sizeof
(
selectlists
[
0
].
TLogSelectList
));
/*
memcpy( &selectlists[ selectlist_count].AlarmSelectList,
&UserObject->SelectList,
sizeof( selectlists[0].AlarmSelectList));
*/
selectlists
[
selectlist_count
].
deleted
=
0
;
selectlists
[
selectlist_count
].
objid
=
objid
;
selectlist_count
++
;
selectlists
[
selectlist_count
-
1
].
check
=
1
;
filectx
->
extselectlist
=
1
;
if
(
log
)
printf
(
"extmod num: %2d curr %2d check: %1d %1d %1d %1d
\n
"
,
selectlist_count
,
selectlist_current
,
selectlists
[
0
].
check
,
selectlists
[
1
].
check
,
selectlists
[
2
].
check
,
selectlists
[
3
].
check
);
if
(
log
)
printf
(
"alarmsel: %s
\n
"
,
UserObject
->
SelectList
[
0
]);
return
TLOG__SUCCESS
;
}
/****************************************************************************
* Name: tlog_selectlist_unmodify()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
*
**************************************************************************/
static
pwr_tUInt32
tlog_selectlist_unmodify
(
tlog_t_filectx
*
filectx
,
pwr_tObjid
objid
,
pwr_sClass_User
*
UserObject
)
{
int
i
;
if
(
cdh_ObjidIsEqual
(
selectlists
[
selectlist_count
-
1
].
objid
,
objid
))
{
selectlist_count
--
;
selectlists
[
selectlist_count
].
deleted
=
0
;
selectlists
[
selectlist_count
].
objid
=
pwr_cNObjid
;
selectlists
[
selectlist_count
].
check
=
0
;
if
(
selectlist_count
>
0
)
{
while
(
selectlists
[
selectlist_count
-
1
].
deleted
==
1
&&
selectlist_count
>
0
)
{
selectlist_count
--
;
selectlists
[
selectlist_count
].
deleted
=
0
;
selectlists
[
selectlist_count
].
objid
=
pwr_cNObjid
;
selectlists
[
selectlist_count
].
check
=
0
;
}
}
selectlist_current
=
selectlist_count
;
memcpy
(
&
filectx
->
TLogSelectList
,
&
selectlists
[
selectlist_count
-
1
].
AlarmSelectList
,
sizeof
(
selectlists
[
0
].
TLogSelectList
));
/*
memcpy(
&UserObject->SelectList,
&selectlists[ selectlist_count - 1].AlarmSelectList,
sizeof( selectlists[0].AlarmSelectList));
*/
}
else
{
for
(
i
=
0
;
i
<
selectlist_count
;
i
++
)
{
if
(
cdh_ObjidIsEqual
(
selectlists
[
i
].
objid
,
objid
))
{
selectlists
[
i
].
deleted
=
1
;
break
;
}
}
}
if
(
log
)
printf
(
"unmod num: %2d curr %2d check: %1d %1d %1d %1d
\n
"
,
selectlist_count
,
selectlist_current
,
selectlists
[
0
].
check
,
selectlists
[
1
].
check
,
selectlists
[
2
].
check
,
selectlists
[
3
].
check
);
if
(
log
)
printf
(
"alarmsel: %s
\n
"
,
UserObject
->
SelectList
[
0
]);
return
TLOG__SUCCESS
;
}
/****************************************************************************
* Name: tlog_mh_info_bc()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
* Backcall from mh.
*
**************************************************************************/
static
pwr_tStatus
tlog_mh_info_bc
(
mh_sMessage
*
MsgP
)
{
int
sts
;
ala_uEvent
*
EventP
;
EventP
=
(
ala_uEvent
*
)
MsgP
;
/* Insert in loglist */
if
((
MsgP
->
Status
&
mh_mEventStatus_NotAck
)
||
(
MsgP
->
Status
&
mh_mEventStatus_NotRet
))
{
sts
=
tlog_loglist_add
(
&
filectx
,
pwr_cNObjid
,
tlog_logtype_Info
,
&
EventP
->
Msg
.
EventText
,
NULL
,
&
EventP
->
Info
.
EventName
,
&
EventP
->
Info
.
EventTime
,
&
log_list
,
&
log_count
,
&
log_alloc
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
tlog_TLogConf
->
AutoAck
)
mh_OutunitAck
(
&
EventP
->
Info
.
Id
);
}
return
TLOG__SUCCESS
;
}
/****************************************************************************
* Name: tlog_mh_alarm_bc()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
* Backcall from mh.
*
**************************************************************************/
static
pwr_tStatus
tlog_mh_alarm_bc
(
mh_sMessage
*
MsgP
)
{
int
sts
;
ala_uEvent
*
EventP
;
tlog_e_logtype
logtype
;
EventP
=
(
ala_uEvent
*
)
MsgP
;
/* Insert in loglist */
if
((
MsgP
->
Status
&
mh_mEventStatus_NotAck
)
||
(
MsgP
->
Status
&
mh_mEventStatus_NotRet
))
{
switch
(
MsgP
->
Info
.
EventPrio
)
{
case
mh_eEventPrio_A
:
logtype
=
tlog_logtype_AlarmA
;
break
;
case
mh_eEventPrio_B
:
logtype
=
tlog_logtype_AlarmB
;
break
;
case
mh_eEventPrio_C
:
logtype
=
tlog_logtype_AlarmC
;
break
;
case
mh_eEventPrio_D
:
logtype
=
tlog_logtype_AlarmD
;
break
;
default:
logtype
=
0
;
}
sts
=
tlog_loglist_add
(
&
filectx
,
pwr_cNObjid
,
logtype
,
&
EventP
->
Msg
.
EventText
,
NULL
,
&
EventP
->
Info
.
EventName
,
&
EventP
->
Info
.
EventTime
,
&
log_list
,
&
log_count
,
&
log_alloc
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
tlog_TLogConf
->
AutoAck
)
mh_OutunitAck
(
&
EventP
->
Info
.
Id
);
}
return
TLOG__SUCCESS
;
}
/****************************************************************************
* Name: tlog_alarm_update()
*
* Type int
*
*
* Type Parameter IOGF Description
*
* Description:
* Receive alarms.
*
**************************************************************************/
static
pwr_tUInt32
tlog_alarm_update
()
{
int
sts
;
sts
=
mh_OutunitReceive
();
while
(
ODD
(
sts
)
&&
sts
!=
MH__NOMESSAVAIL
)
{
sts
=
mh_OutunitReceive
();
}
return
TLOG__SUCCESS
;
}
/****************************************************************************
* Name: tlog_alarm_connect()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
* Connect to alarm handler.
*
**************************************************************************/
static
pwr_tUInt32
tlog_alarm_connect
(
pwr_tObjid
user_object
)
{
int
sts
;
sts
=
mh_OutunitConnect
(
user_object
,
mh_eOutunitType_Operator
,
0
,
NULL
,
tlog_mh_alarm_bc
,
NULL
,
NULL
,
NULL
,
NULL
,
tlog_mh_info_bc
,
NULL
);
if
(
EVEN
(
sts
))
return
sts
;
/*
sts = tlog_alarm_update();
*/
return
TLOG__SUCCESS
;
}
/*************************************************************************
*
* Name: tlog_loglist_sort()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
* This function sorts the items in the loglist in chronologic order.
*
**************************************************************************/
static
pwr_tUInt32
tlog_loglist_sort
(
tlog_t_loglist
*
loglist
,
int
loglist_count
)
{
int
i
,
j
;
tlog_t_loglist
dum
;
tlog_t_loglist
*
loglist_ptr
;
for
(
i
=
loglist_count
-
1
;
i
>
0
;
i
--
)
{
loglist_ptr
=
loglist
;
for
(
j
=
0
;
j
<
i
;
j
++
)
{
/***
lib$subx( &loglist_ptr->diftime, &(loglist_ptr + 1)->diftime,
&diftime);
if ( diftime.high < 0)
***/
if
(
time_Dcomp
(
&
loglist_ptr
->
diftime
,
&
(
loglist_ptr
+
1
)
->
diftime
)
==
-
1
)
{
/* Change order */
memcpy
(
&
dum
,
loglist_ptr
+
1
,
sizeof
(
tlog_t_loglist
));
memcpy
(
loglist_ptr
+
1
,
loglist_ptr
,
sizeof
(
tlog_t_loglist
));
memcpy
(
loglist_ptr
,
&
dum
,
sizeof
(
tlog_t_loglist
));
}
loglist_ptr
++
;
}
}
return
TLOG__SUCCESS
;
}
/*************************************************************************
*
* Name: tlog_loglist_print()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
* Print the loglist.
*
**************************************************************************/
static
pwr_tUInt32
tlog_loglist_print
(
tlog_t_filectx
*
filectx
,
tlog_t_loglist
*
loglist
,
int
*
loglist_count
,
pwr_sClass_User
*
UserObject
)
{
int
i
;
int
sts
;
char
timestr
[
64
];
tlog_t_loglist
*
loglist_ptr
;
char
logtypestr
[
5
];
int
close
;
tlog_loglist_sort
(
loglist
,
*
loglist_count
);
close
=
0
;
loglist_ptr
=
loglist
;
for
(
i
=
0
;
i
<
*
loglist_count
;
i
++
,
loglist_ptr
++
)
{
/* Print time, text and object on logfile */
if
(
filectx
->
extselectlist
==
1
&&
cdh_ObjidIsNotNull
(
loglist_ptr
->
objid
)
&&
!
(
loglist_ptr
->
logtype
==
tlog_logtype_Modify
||
loglist_ptr
->
logtype
==
tlog_logtype_UnModify
||
loglist_ptr
->
logtype
==
tlog_logtype_Close
))
{
sts
=
tlog_selectlist_check
(
filectx
,
loglist_ptr
->
objid
);
if
(
sts
==
TLOG__NOTSEL
)
continue
;
else
if
(
EVEN
(
sts
))
return
sts
;
}
switch
(
loglist_ptr
->
logtype
)
{
case
tlog_logtype_DtLogUp
:
strcpy
(
logtypestr
,
"Du"
);
break
;
case
tlog_logtype_DtLogDown
:
strcpy
(
logtypestr
,
"Dd"
);
break
;
case
tlog_logtype_AtLogUp
:
strcpy
(
logtypestr
,
"Au"
);
break
;
case
tlog_logtype_AtLogDown
:
strcpy
(
logtypestr
,
"Ad"
);
break
;
case
tlog_logtype_Info
:
strcpy
(
logtypestr
,
"Mi"
);
break
;
case
tlog_logtype_AlarmA
:
strcpy
(
logtypestr
,
"Ma"
);
break
;
case
tlog_logtype_AlarmB
:
strcpy
(
logtypestr
,
"Mb"
);
break
;
case
tlog_logtype_AlarmC
:
strcpy
(
logtypestr
,
"Mc"
);
break
;
case
tlog_logtype_AlarmD
:
strcpy
(
logtypestr
,
"Md"
);
break
;
case
tlog_logtype_Modify
:
strcpy
(
logtypestr
,
"Sl"
);
sts
=
tlog_selectlist_modify
(
filectx
,
loglist_ptr
->
objid
);
break
;
case
tlog_logtype_UnModify
:
strcpy
(
logtypestr
,
"Sl"
);
sts
=
tlog_selectlist_unmodify
(
filectx
,
loglist_ptr
->
objid
,
UserObject
);
break
;
case
tlog_logtype_Close
:
sts
=
tlog_selectlist_unmodify
(
filectx
,
loglist_ptr
->
objid
,
UserObject
);
strcpy
(
logtypestr
,
"Fc"
);
close
=
1
;
break
;
case
tlog_logtype_CAtLog
:
strcpy
(
logtypestr
,
"Ca"
);
break
;
case
tlog_logtype_CDtLog
:
strcpy
(
logtypestr
,
"Cd"
);
break
;
case
tlog_logtype_COtLog
:
strcpy
(
logtypestr
,
"Co"
);
break
;
case
tlog_logtype_ChgAtLog
:
strcpy
(
logtypestr
,
"Ha"
);
break
;
case
tlog_logtype_ChgOtLog
:
strcpy
(
logtypestr
,
"Ho"
);
break
;
case
tlog_logtype_ExecOn
:
case
tlog_logtype_ExecOff
:
strcpy
(
logtypestr
,
"Ex"
);
break
;
default:
strcpy
(
logtypestr
,
" "
);
}
tlog_timestring
(
&
loglist_ptr
->
diftime
,
timestr
);
fprintf
(
filectx
->
outfile
,
"%11s %s %-40.40s %s
\n
"
,
timestr
,
logtypestr
,
loglist_ptr
->
attrname
,
loglist_ptr
->
logtext
);
if
(
close
)
{
tlog_file_close
(
filectx
);
break
;
}
}
*
loglist_count
=
0
;
return
TLOG__SUCCESS
;
}
/*************************************************************************
*
* Name: tlog_loglist_add()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
* Add an object to the loglist.
*
**************************************************************************/
static
pwr_tUInt32
tlog_loglist_add
(
tlog_t_filectx
*
filectx
,
pwr_tObjid
objid
,
tlog_e_logtype
logtype
,
pwr_tString80
*
logtext
,
pwr_sAttrRef
*
attribute
,
pwr_tString80
*
attrname
,
pwr_tTime
*
logtime
,
tlog_t_loglist
**
loglist
,
int
*
loglist_count
,
int
*
alloc
)
{
tlog_t_loglist
*
loglist_ptr
;
tlog_t_loglist
*
new_loglist
;
int
sts
;
if
(
filectx
->
outfile
==
0
)
return
TLOG__SUCCESS
;
if
(
filectx
->
open_time
.
tv_sec
==
0
&&
filectx
->
open_time
.
tv_nsec
==
0
)
return
TLOG__SUCCESS
;
if
(
cdh_ObjidIsNotNull
(
objid
)
&&
!
(
logtype
==
tlog_logtype_Modify
||
logtype
==
tlog_logtype_UnModify
||
logtype
==
tlog_logtype_Close
))
{
if
(
filectx
->
extselectlist
==
1
)
sts
=
tlog_extselectlist_check
(
filectx
,
objid
);
else
sts
=
tlog_selectlist_check
(
filectx
,
objid
);
if
(
sts
==
TLOG__NOTSEL
)
return
TLOG__SUCCESS
;
else
if
(
EVEN
(
sts
))
return
sts
;
}
if
(
*
alloc
==
0
)
{
*
loglist
=
calloc
(
TLOG_ALLOC
,
sizeof
(
tlog_t_loglist
));
if
(
*
loglist
==
0
)
return
TLOG__NOMEMORY
;
*
alloc
=
TLOG_ALLOC
;
}
else
if
(
*
alloc
<=
*
loglist_count
)
{
new_loglist
=
calloc
(
*
alloc
+
TLOG_ALLOC
,
sizeof
(
tlog_t_loglist
));
if
(
new_loglist
==
0
)
return
TLOG__NOMEMORY
;
memcpy
(
new_loglist
,
*
loglist
,
*
loglist_count
*
sizeof
(
tlog_t_loglist
));
free
(
*
loglist
);
*
loglist
=
new_loglist
;
(
*
alloc
)
+=
TLOG_ALLOC
;
}
loglist_ptr
=
*
loglist
+
*
loglist_count
;
loglist_ptr
->
logtype
=
logtype
;
loglist_ptr
->
objid
=
objid
;
strcpy
(
loglist_ptr
->
logtext
,
(
char
*
)
logtext
);
if
(
attribute
!=
NULL
)
{
/* sts = gdh_AttrrefToName ( attribute, loglist_ptr->attrname,
sizeof(pwr_tString80), cdh_mNName);
*/
sts
=
gdh_ObjidToName
(
attribute
->
Objid
,
loglist_ptr
->
attrname
,
sizeof
(
loglist_ptr
->
attrname
),
cdh_mNName
);
if
(
EVEN
(
sts
))
{
sts
=
gdh_ObjidToName
(
objid
,
loglist_ptr
->
attrname
,
sizeof
(
loglist_ptr
->
attrname
),
cdh_mNName
);
if
(
EVEN
(
sts
))
strcpy
(
loglist_ptr
->
attrname
,
""
);
}
}
else
strcpy
(
loglist_ptr
->
attrname
,
(
char
*
)
attrname
);
memcpy
(
&
loglist_ptr
->
logtime
,
logtime
,
sizeof
(
pwr_tTime
));
time_Adiff
(
&
loglist_ptr
->
diftime
,
logtime
,
&
filectx
->
open_time
);
(
*
loglist_count
)
++
;
return
TLOG__SUCCESS
;
}
/*************************************************************************
*
* Name: tlog_objectlist_add()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
* Add an object to the objectlist.
*
**************************************************************************/
static
pwr_tUInt32
tlog_objectlist_add
(
pwr_tObjid
object_objid
,
pwr_tClassId
class
,
tlog_t_objectlist
**
objectlist
,
int
*
objectlist_count
,
int
*
alloc
)
{
tlog_t_objectlist
*
objectlist_ptr
;
tlog_t_objectlist
*
new_objectlist
;
pwr_tOName
namebuf
;
int
sts
;
pwr_sAttrRef
attrref
;
if
(
*
objectlist_count
==
0
)
{
*
objectlist
=
calloc
(
TLOG_ALLOC
,
sizeof
(
tlog_t_objectlist
));
if
(
*
objectlist
==
0
)
return
TLOG__NOMEMORY
;
*
alloc
=
TLOG_ALLOC
;
}
else
if
(
*
alloc
<=
*
objectlist_count
)
{
new_objectlist
=
calloc
(
*
alloc
+
TLOG_ALLOC
,
sizeof
(
tlog_t_objectlist
));
if
(
new_objectlist
==
0
)
return
TLOG__NOMEMORY
;
memcpy
(
new_objectlist
,
*
objectlist
,
*
objectlist_count
*
sizeof
(
tlog_t_objectlist
));
free
(
*
objectlist
);
*
objectlist
=
new_objectlist
;
(
*
alloc
)
+=
TLOG_ALLOC
;
}
objectlist_ptr
=
*
objectlist
+
*
objectlist_count
;
objectlist_ptr
->
objid
=
object_objid
;
sts
=
gdh_ObjidToName
(
object_objid
,
namebuf
,
sizeof
(
namebuf
),
cdh_mNName
);
if
(
EVEN
(
sts
))
return
sts
;
strcpy
(
objectlist_ptr
->
name
,
namebuf
);
memset
(
&
attrref
,
0
,
sizeof
(
attrref
));
attrref
.
Objid
=
object_objid
;
sts
=
gdh_DLRefObjectInfoAttrref
(
&
attrref
,
(
pwr_tAddress
*
)
&
objectlist_ptr
->
object_ptr
,
&
objectlist_ptr
->
subid
);
if
(
EVEN
(
sts
))
return
sts
;
(
*
objectlist_count
)
++
;
return
TLOG__SUCCESS
;
}
static
pwr_tUInt32
tlog_object_add
(
pwr_tClassId
class
,
tlog_t_objectlist
**
objectlist
,
int
*
objectlist_count
,
int
*
object_alloc
)
{
pwr_tObjid
object_objid
;
int
sts
;
/* Get all initsteps of this node */
sts
=
gdh_GetClassList
(
class
,
&
object_objid
);
while
(
ODD
(
sts
))
{
/* Store and direct link the initstep */
sts
=
tlog_objectlist_add
(
object_objid
,
class
,
objectlist
,
objectlist_count
,
object_alloc
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
gdh_GetNextObject
(
object_objid
,
&
object_objid
);
}
return
TLOG__SUCCESS
;
}
static
pwr_tUInt32
tlog_timestring
(
pwr_tDeltaTime
*
time
,
char
*
timestr
)
{
char
timstr
[
64
];
int
sts
;
/****
unsigned short int len;
struct dsc$descriptor_s timstr_desc = {sizeof(timstr)-1,DSC$K_DTYPE_T,
DSC$K_CLASS_S,};
timstr_desc.dsc$a_pointer = timstr;
if ( time->high >= 0)
strcpy( timestr, "00:00:00.00");
else
{
sys$asctim( &len, &timstr_desc, time, 0);
timstr[len] = 0 ;
strcpy( timestr, &timstr[5]);
}
****/
sts
=
time_DtoAscii
(
time
,
1
,
timstr
,
sizeof
(
timstr
));
if
(
ODD
(
sts
))
strcpy
(
timestr
,
timstr
);
return
TLOG__SUCCESS
;
}
static
pwr_tUInt32
tlog_fulltimestring
(
pwr_tTime
*
time
,
char
*
timestr
)
{
char
timstr
[
64
];
int
sts
;
/**********
unsigned short int len;
struct dsc$descriptor_s timstr_desc = {sizeof(timstr)-1,DSC$K_DTYPE_T,
DSC$K_CLASS_S,};
timstr_desc.dsc$a_pointer = timstr;
sys$asctim( &len, &timstr_desc, time, 0);
timstr[len] = 0 ;
strcpy( timestr, &timstr[0]);
**********/
sts
=
time_AtoAscii
(
time
,
time_eFormat_DateAndTime
,
timstr
,
sizeof
(
timstr
));
if
(
ODD
(
sts
))
strcpy
(
timestr
,
timstr
);
return
TLOG__SUCCESS
;
}
static
pwr_tUInt32
tlog_getfilename
(
pwr_tObjid
objid
,
char
*
filename
,
pwr_sClass_TLogConfigure
*
TLogConf
)
{
int
sts
;
pwr_tOName
name
;
char
*
s
;
sts
=
gdh_ObjidToName
(
objid
,
name
,
sizeof
(
name
),
cdh_mNName
);
if
(
EVEN
(
sts
))
return
sts
;
for
(
s
=
name
;
*
s
;
s
++
)
{
if
(
*
s
==
''
)
*
s
=
'a'
;
else
if
(
*
s
==
''
)
*
s
=
'a'
;
else
if
(
*
s
==
''
)
*
s
=
'o'
;
else
if
(
*
s
==
''
)
*
s
=
'A'
;
else
if
(
*
s
==
''
)
*
s
=
'A'
;
else
if
(
*
s
==
''
)
*
s
=
'O'
;
}
strcpy
(
filename
,
TLogConf
->
TLogDirectory
);
s
=
strrchr
(
name
,
'-'
);
if
(
s
==
0
)
strcat
(
filename
,
name
);
else
{
*
s
=
'_'
;
s
=
strrchr
(
name
,
'-'
);
if
(
s
==
0
)
strcat
(
filename
,
name
);
else
{
*
s
=
'_'
;
s
=
strrchr
(
name
,
'-'
);
if
(
s
==
0
)
strcat
(
filename
,
name
);
else
{
s
++
;
strcat
(
filename
,
s
);
}
}
}
strcat
(
filename
,
".tlog"
);
return
TLOG__SUCCESS
;
}
static
pwr_tUInt32
tlog_getconfigobject
(
pwr_sClass_TLogConfigure
**
TLogConf
,
pwr_sClass_User
**
UserObject
)
{
pwr_tObjid
node
;
pwr_tObjid
Objid
;
pwr_tClassId
class
;
int
sts
;
pwr_sAttrRef
attrref
;
int
found
;
gdh_tDlid
subid
;
/* Try to find a TLogConfigure object for the node */
sts
=
gdh_GetNodeObject
(
0
,
&
node
);
if
(
EVEN
(
sts
))
return
sts
;
/* Look for a User object as a child to the node object */
found
=
0
;
sts
=
gdh_GetChild
(
node
,
&
Objid
);
while
(
ODD
(
sts
))
{
sts
=
gdh_GetObjectClass
(
Objid
,
&
class
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
class
==
pwr_cClass_TLogConfigure
)
{
memset
(
&
attrref
,
0
,
sizeof
(
attrref
));
attrref
.
Objid
=
Objid
;
sts
=
gdh_DLRefObjectInfoAttrref
(
&
attrref
,
(
pwr_tAddress
*
)
TLogConf
,
&
subid
);
if
(
EVEN
(
sts
))
return
sts
;
found
=
1
;
break
;
}
sts
=
gdh_GetNextSibling
(
Objid
,
&
Objid
);
}
if
(
found
==
0
)
return
TLOG__CONFOBJNOTFOUND
;
/* Get the userobject */
memset
(
&
attrref
,
0
,
sizeof
(
attrref
));
attrref
.
Objid
=
(
*
TLogConf
)
->
UserObject
;
sts
=
gdh_DLRefObjectInfoAttrref
(
&
attrref
,
(
pwr_tAddress
*
)
UserObject
,
&
subid
);
if
(
EVEN
(
sts
))
return
TLOG__USEROBJNOTFOUND
;
return
TLOG__SUCCESS
;
}
/*************************************************************************
*
* Name: main()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
* Main program of rs_tlog.
*
**************************************************************************/
int
main
(
int
argc
,
char
**
argv
)
{
tlog_t_objectlist
*
TLogOpen_list
;
int
TLogOpen_count
;
int
TLogOpen_alloc
;
tlog_t_objectlist
*
TLogModify_list
;
int
TLogModify_count
;
int
TLogModify_alloc
;
tlog_t_objectlist
*
DtLog_list
;
int
DtLog_count
;
int
DtLog_alloc
;
tlog_t_objectlist
*
AtLog_list
;
int
AtLog_count
;
int
AtLog_alloc
;
tlog_t_objectlist
*
CAtLog_list
;
int
CAtLog_count
;
int
CAtLog_alloc
;
tlog_t_objectlist
*
CDtLog_list
;
int
CDtLog_count
;
int
CDtLog_alloc
;
tlog_t_objectlist
*
COtLog_list
;
int
COtLog_count
;
int
COtLog_alloc
;
tlog_t_objectlist
*
ChgAtLog_list
;
int
ChgAtLog_count
;
int
ChgAtLog_alloc
;
tlog_t_objectlist
*
ChgOtLog_list
;
int
ChgOtLog_count
;
int
ChgOtLog_alloc
;
tlog_t_objectlist
*
ExecOn_list
;
int
ExecOn_count
;
int
ExecOn_alloc
;
tlog_t_objectlist
*
ExecOff_list
;
int
ExecOff_count
;
int
ExecOff_alloc
;
int
sts
;
int
i
,
first
;
tlog_t_objectlist
*
list_ptr
;
char
filename
[
120
];
pwr_sClass_User
*
UserObject
;
char
timestr
[
64
];
pwr_tOName
name
;
char
text
[
120
];
double
scantime
;
filectx
.
outfile
=
0
;
filectx
.
open_time
.
tv_sec
=
0
;
filectx
.
open_time
.
tv_nsec
=
0
;
selectlist_count
=
0
;
#ifdef OS_ELN
/* Wait for the plcpgm has flagged initizated */
plc_UtlWaitForPlc
();
#endif
/* Init gdh */
sts
=
gdh_Init
(
"rs_tlog"
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
/* Get the config object */
sts
=
tlog_getconfigobject
(
&
tlog_TLogConf
,
&
UserObject
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
scantime
=
tlog_TLogConf
->
CycleTime
;
if
(
scantime
<
0
.
01
)
scantime
=
2
;
sts
=
tlog_alarm_connect
(
tlog_TLogConf
->
UserObject
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
/* Direct link to the TLogOpen, TLogModify, DtLog and AtLog */
TLogOpen_count
=
0
;
TLogModify_count
=
0
;
DtLog_count
=
0
;
AtLog_count
=
0
;
CAtLog_count
=
0
;
CDtLog_count
=
0
;
COtLog_count
=
0
;
ChgAtLog_count
=
0
;
ChgOtLog_count
=
0
;
ExecOn_count
=
0
;
ExecOff_count
=
0
;
sts
=
tlog_object_add
(
pwr_cClass_TLogOpen
,
&
TLogOpen_list
,
&
TLogOpen_count
,
&
TLogOpen_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
sts
=
tlog_object_add
(
pwr_cClass_TLogModify
,
&
TLogModify_list
,
&
TLogModify_count
,
&
TLogModify_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
sts
=
tlog_object_add
(
pwr_cClass_DtLog
,
&
DtLog_list
,
&
DtLog_count
,
&
DtLog_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
sts
=
tlog_object_add
(
pwr_cClass_AtLog
,
&
AtLog_list
,
&
AtLog_count
,
&
AtLog_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
sts
=
tlog_object_add
(
pwr_cClass_CAtLog
,
&
CAtLog_list
,
&
CAtLog_count
,
&
CAtLog_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
sts
=
tlog_object_add
(
pwr_cClass_CDtLog
,
&
CDtLog_list
,
&
CDtLog_count
,
&
CDtLog_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
sts
=
tlog_object_add
(
pwr_cClass_COtLog
,
&
COtLog_list
,
&
COtLog_count
,
&
COtLog_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
sts
=
tlog_object_add
(
pwr_cClass_ChgAtLog
,
&
ChgAtLog_list
,
&
ChgAtLog_count
,
&
ChgAtLog_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
sts
=
tlog_object_add
(
pwr_cClass_ChgOtLog
,
&
ChgOtLog_list
,
&
ChgOtLog_count
,
&
ChgOtLog_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
sts
=
tlog_object_add
(
pwr_cClass_TLogExecAllOn
,
&
ExecOn_list
,
&
ExecOn_count
,
&
ExecOn_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
sts
=
tlog_object_add
(
pwr_cClass_TLogExecAllOff
,
&
ExecOff_list
,
&
ExecOff_count
,
&
ExecOff_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
while
(
1
)
{
if
(
!
tlog_TLogConf
->
On
)
{
tlog_sleep
(
scantime
);
continue
;
}
/* Reset all Signals in the objects */
list_ptr
=
TLogOpen_list
;
for
(
i
=
0
;
i
<
TLogOpen_count
;
i
++
)
{
((
pwr_sClass_TLogOpen
*
)(
list_ptr
->
object_ptr
))
->
OpenSignal
=
0
;
((
pwr_sClass_TLogOpen
*
)(
list_ptr
->
object_ptr
))
->
CloseSignal
=
0
;
((
pwr_sClass_TLogOpen
*
)(
list_ptr
->
object_ptr
))
->
FileOpen
=
0
;
list_ptr
++
;
}
list_ptr
=
TLogModify_list
;
for
(
i
=
0
;
i
<
TLogModify_count
;
i
++
)
{
((
pwr_sClass_TLogModify
*
)(
list_ptr
->
object_ptr
))
->
ModifySignal
=
0
;
((
pwr_sClass_TLogModify
*
)(
list_ptr
->
object_ptr
))
->
UnModifySignal
=
0
;
list_ptr
++
;
}
list_ptr
=
DtLog_list
;
for
(
i
=
0
;
i
<
DtLog_count
;
i
++
)
{
((
pwr_sClass_DtLog
*
)(
list_ptr
->
object_ptr
))
->
UpSignal
=
0
;
((
pwr_sClass_DtLog
*
)(
list_ptr
->
object_ptr
))
->
DownSignal
=
0
;
list_ptr
++
;
}
list_ptr
=
AtLog_list
;
for
(
i
=
0
;
i
<
AtLog_count
;
i
++
)
{
((
pwr_sClass_AtLog
*
)(
list_ptr
->
object_ptr
))
->
UpSignal
=
0
;
((
pwr_sClass_AtLog
*
)(
list_ptr
->
object_ptr
))
->
DownSignal
=
0
;
list_ptr
++
;
}
list_ptr
=
CAtLog_list
;
for
(
i
=
0
;
i
<
CAtLog_count
;
i
++
)
{
((
pwr_sClass_CAtLog
*
)(
list_ptr
->
object_ptr
))
->
LogSignal
=
0
;
list_ptr
++
;
}
list_ptr
=
CDtLog_list
;
for
(
i
=
0
;
i
<
CDtLog_count
;
i
++
)
{
((
pwr_sClass_CDtLog
*
)(
list_ptr
->
object_ptr
))
->
LogSignal
=
0
;
list_ptr
++
;
}
list_ptr
=
COtLog_list
;
for
(
i
=
0
;
i
<
COtLog_count
;
i
++
)
{
((
pwr_sClass_COtLog
*
)(
list_ptr
->
object_ptr
))
->
LogSignal
=
0
;
list_ptr
++
;
}
list_ptr
=
ChgAtLog_list
;
for
(
i
=
0
;
i
<
ChgAtLog_count
;
i
++
)
{
((
pwr_sClass_ChgAtLog
*
)(
list_ptr
->
object_ptr
))
->
LogSignal
=
0
;
list_ptr
++
;
}
list_ptr
=
ChgOtLog_list
;
for
(
i
=
0
;
i
<
ChgOtLog_count
;
i
++
)
{
((
pwr_sClass_ChgOtLog
*
)(
list_ptr
->
object_ptr
))
->
LogSignal
=
0
;
list_ptr
++
;
}
list_ptr
=
ExecOn_list
;
for
(
i
=
0
;
i
<
ExecOn_count
;
i
++
)
{
((
pwr_sClass_TLogExecAllOn
*
)(
list_ptr
->
object_ptr
))
->
ExecOnSignal
=
0
;
list_ptr
++
;
}
list_ptr
=
ExecOff_list
;
for
(
i
=
0
;
i
<
ExecOff_count
;
i
++
)
{
((
pwr_sClass_TLogExecAllOff
*
)(
list_ptr
->
object_ptr
))
->
ExecOffSignal
=
0
;
list_ptr
++
;
}
sts
=
tlog_alarm_update
();
/* Start the main loop */
first
=
0
;
log_alloc
=
0
;
log_count
=
0
;
while
(
1
)
{
sts
=
tlog_extselectlist_reset
(
&
filectx
);
/* Check if its time to open or close file */
if
(
filectx
.
outfile
==
0
)
{
list_ptr
=
TLogOpen_list
;
for
(
i
=
0
;
i
<
TLogOpen_count
;
i
++
)
{
if
(((
pwr_sClass_TLogOpen
*
)(
list_ptr
->
object_ptr
))
->
OpenSignal
)
{
/* Open the file */
tlog_getfilename
(
list_ptr
->
objid
,
filename
,
tlog_TLogConf
);
dcli_translate_filename
(
filename
,
filename
);
filectx
.
outfile
=
fopen
(
filename
,
"w"
);
if
(
filectx
.
outfile
==
0
)
{
errh_CErrLog
(
TLOG__FILEOPEN
,
errh_ErrArgAF
(
filename
),
NULL
);
goto
fatal_error
;
}
else
{
filectx
.
object_ptr
=
(
pwr_sClass_TLogOpen
*
)
list_ptr
->
object_ptr
;
filectx
.
objid
=
list_ptr
->
objid
;
filectx
.
object_ptr
->
OpenSignal
=
0
;
filectx
.
object_ptr
->
OpenTime
.
tv_sec
=
0
;
filectx
.
object_ptr
->
OpenTime
.
tv_nsec
=
0
;
filectx
.
object_ptr
->
FileOpen
=
1
;
sts
=
tlog_extselectlist_modify
(
&
filectx
,
filectx
.
objid
,
UserObject
,
filectx
.
object_ptr
->
TLogSelectList
,
filectx
.
object_ptr
->
AlarmSelectList
);
first
=
1
;
}
break
;
}
list_ptr
++
;
}
}
else
{
if
(
first
)
{
if
(
filectx
.
object_ptr
->
OpenTime
.
tv_sec
!=
0
||
filectx
.
object_ptr
->
OpenTime
.
tv_nsec
!=
0
)
{
filectx
.
open_time
=
filectx
.
object_ptr
->
OpenTime
;
tlog_fulltimestring
(
&
filectx
.
object_ptr
->
OpenTime
,
timestr
);
fprintf
(
filectx
.
outfile
,
"TestLog started %s
\n\n
"
,
timestr
);
first
=
0
;
}
else
{
tlog_sleep
(
scantime
);
continue
;
}
}
/* Check if any modify object is active */
list_ptr
=
TLogModify_list
;
for
(
i
=
0
;
i
<
TLogModify_count
;
i
++
)
{
if
(((
pwr_sClass_TLogModify
*
)(
list_ptr
->
object_ptr
))
->
ModifySignal
)
{
/* Modify */
if
(
cdh_ObjidIsEqual
(
((
pwr_sClass_TLogModify
*
)
(
list_ptr
->
object_ptr
))
->
TLogOpenObject
,
filectx
.
objid
)
||
cdh_ObjidIsNull
(((
pwr_sClass_TLogModify
*
)
(
list_ptr
->
object_ptr
))
->
TLogOpenObject
))
{
sts
=
tlog_extselectlist_modify
(
&
filectx
,
list_ptr
->
objid
,
UserObject
,
((
pwr_sClass_TLogModify
*
)
(
list_ptr
->
object_ptr
))
->
TLogSelectList
,
((
pwr_sClass_TLogModify
*
)
(
list_ptr
->
object_ptr
))
->
AlarmSelectList
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
sts
=
gdh_ObjidToName
(
list_ptr
->
objid
,
name
,
sizeof
(
name
),
cdh_mNName
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
sts
=
tlog_loglist_add
(
&
filectx
,
list_ptr
->
objid
,
tlog_logtype_Modify
,
(
pwr_tString80
*
)
"TLogModify selectlist active"
,
NULL
,
(
pwr_tString80
*
)
name
,
&
((
pwr_sClass_TLogModify
*
)
(
list_ptr
->
object_ptr
))
->
ModifyTime
,
&
log_list
,
&
log_count
,
&
log_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
}
((
pwr_sClass_TLogModify
*
)(
list_ptr
->
object_ptr
))
->
ModifySignal
=
0
;
}
if
(((
pwr_sClass_TLogModify
*
)(
list_ptr
->
object_ptr
))
->
UnModifySignal
)
{
/* UnModify */
if
(
cdh_ObjidIsEqual
(((
pwr_sClass_TLogModify
*
)
(
list_ptr
->
object_ptr
))
->
TLogOpenObject
,
filectx
.
objid
)
||
cdh_ObjidIsNull
(((
pwr_sClass_TLogModify
*
)
(
list_ptr
->
object_ptr
))
->
TLogOpenObject
))
{
sts
=
tlog_extselectlist_unmodify
(
&
filectx
,
list_ptr
->
objid
);
sts
=
gdh_ObjidToName
(
list_ptr
->
objid
,
name
,
sizeof
(
name
),
cdh_mNName
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
sts
=
tlog_loglist_add
(
&
filectx
,
list_ptr
->
objid
,
tlog_logtype_UnModify
,
(
pwr_tString80
*
)
"TLogModify selectlist inactive"
,
NULL
,
(
pwr_tString80
*
)
name
,
&
((
pwr_sClass_TLogModify
*
)
(
list_ptr
->
object_ptr
))
->
UnModifyTime
,
&
log_list
,
&
log_count
,
&
log_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
}
((
pwr_sClass_TLogModify
*
)(
list_ptr
->
object_ptr
))
->
UnModifySignal
=
0
;
}
list_ptr
++
;
}
}
/* Check if any ExecOn to log and execute */
list_ptr
=
ExecOn_list
;
for
(
i
=
0
;
i
<
ExecOn_count
;
i
++
)
{
if
(((
pwr_sClass_TLogExecAllOn
*
)(
list_ptr
->
object_ptr
))
->
ExecOnSignal
)
{
sts
=
gdh_ObjidToName
(
list_ptr
->
objid
,
name
,
sizeof
(
name
),
cdh_mNName
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
sts
=
tlog_loglist_add
(
&
filectx
,
list_ptr
->
objid
,
tlog_logtype_ExecOn
,
(
pwr_tString80
*
)
"Execution all PlcPgms set on"
,
NULL
,
(
pwr_tString80
*
)
name
,
&
((
pwr_sClass_TLogExecAllOn
*
)(
list_ptr
->
object_ptr
))
->
LogTime
,
&
log_list
,
&
log_count
,
&
log_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
sts
=
tlog_exec_on_all
(
list_ptr
->
objid
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
((
pwr_sClass_TLogExecAllOn
*
)(
list_ptr
->
object_ptr
))
->
ExecOnSignal
=
0
;
((
pwr_sClass_TLogExecAllOn
*
)(
list_ptr
->
object_ptr
))
->
ExecOn
=
1
;
}
list_ptr
++
;
}
/* Check if any ExecOff to log and execute */
list_ptr
=
ExecOff_list
;
for
(
i
=
0
;
i
<
ExecOff_count
;
i
++
)
{
if
(((
pwr_sClass_TLogExecAllOff
*
)(
list_ptr
->
object_ptr
))
->
ExecOffSignal
)
{
sts
=
gdh_ObjidToName
(
list_ptr
->
objid
,
name
,
sizeof
(
name
),
cdh_mNName
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
sts
=
tlog_loglist_add
(
&
filectx
,
list_ptr
->
objid
,
tlog_logtype_ExecOff
,
(
pwr_tString80
*
)
"Execution all PlcPgms set off"
,
NULL
,
(
pwr_tString80
*
)
name
,
&
((
pwr_sClass_TLogExecAllOff
*
)(
list_ptr
->
object_ptr
))
->
LogTime
,
&
log_list
,
&
log_count
,
&
log_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
sts
=
tlog_exec_off_all
(
list_ptr
->
objid
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
((
pwr_sClass_TLogExecAllOff
*
)(
list_ptr
->
object_ptr
))
->
ExecOffSignal
=
0
;
((
pwr_sClass_TLogExecAllOff
*
)(
list_ptr
->
object_ptr
))
->
ExecOff
=
1
;
}
list_ptr
++
;
}
/* Check if any DtLog to log */
list_ptr
=
DtLog_list
;
for
(
i
=
0
;
i
<
DtLog_count
;
i
++
)
{
if
(((
pwr_sClass_DtLog
*
)(
list_ptr
->
object_ptr
))
->
UpSignal
)
{
if
(
((
pwr_sClass_DtLog
*
)(
list_ptr
->
object_ptr
))
->
UpText
[
0
]
!=
0
)
{
sts
=
tlog_loglist_add
(
&
filectx
,
list_ptr
->
objid
,
tlog_logtype_DtLogUp
,
(
pwr_tString80
*
)
((
pwr_sClass_DtLog
*
)(
list_ptr
->
object_ptr
))
->
UpText
,
&
((
pwr_sClass_DtLog
*
)(
list_ptr
->
object_ptr
))
->
Attribute
,
NULL
,
&
((
pwr_sClass_DtLog
*
)(
list_ptr
->
object_ptr
))
->
UpTime
,
&
log_list
,
&
log_count
,
&
log_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
}
((
pwr_sClass_DtLog
*
)(
list_ptr
->
object_ptr
))
->
UpSignal
=
0
;
}
if
(((
pwr_sClass_DtLog
*
)(
list_ptr
->
object_ptr
))
->
DownSignal
)
{
if
(
((
pwr_sClass_DtLog
*
)(
list_ptr
->
object_ptr
))
->
DownText
[
0
]
!=
0
)
{
sts
=
tlog_loglist_add
(
&
filectx
,
list_ptr
->
objid
,
tlog_logtype_DtLogDown
,
(
pwr_tString80
*
)
((
pwr_sClass_DtLog
*
)(
list_ptr
->
object_ptr
))
->
DownText
,
&
((
pwr_sClass_DtLog
*
)(
list_ptr
->
object_ptr
))
->
Attribute
,
NULL
,
&
((
pwr_sClass_DtLog
*
)(
list_ptr
->
object_ptr
))
->
DownTime
,
&
log_list
,
&
log_count
,
&
log_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
}
((
pwr_sClass_DtLog
*
)(
list_ptr
->
object_ptr
))
->
DownSignal
=
0
;
}
list_ptr
++
;
}
/* Check if any AtLog to log */
list_ptr
=
AtLog_list
;
for
(
i
=
0
;
i
<
AtLog_count
;
i
++
)
{
if
(((
pwr_sClass_AtLog
*
)(
list_ptr
->
object_ptr
))
->
UpSignal
)
{
if
(
((
pwr_sClass_AtLog
*
)(
list_ptr
->
object_ptr
))
->
UpText
[
0
]
!=
0
)
{
sts
=
tlog_loglist_add
(
&
filectx
,
list_ptr
->
objid
,
tlog_logtype_AtLogUp
,
(
pwr_tString80
*
)
((
pwr_sClass_AtLog
*
)(
list_ptr
->
object_ptr
))
->
UpText
,
&
((
pwr_sClass_AtLog
*
)(
list_ptr
->
object_ptr
))
->
Attribute
,
NULL
,
&
((
pwr_sClass_AtLog
*
)(
list_ptr
->
object_ptr
))
->
UpTime
,
&
log_list
,
&
log_count
,
&
log_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
}
((
pwr_sClass_AtLog
*
)(
list_ptr
->
object_ptr
))
->
UpSignal
=
0
;
}
if
(((
pwr_sClass_AtLog
*
)(
list_ptr
->
object_ptr
))
->
DownSignal
)
{
if
(
((
pwr_sClass_AtLog
*
)(
list_ptr
->
object_ptr
))
->
DownText
[
0
]
!=
0
)
{
sts
=
tlog_loglist_add
(
&
filectx
,
list_ptr
->
objid
,
tlog_logtype_AtLogDown
,
(
pwr_tString80
*
)
((
pwr_sClass_AtLog
*
)(
list_ptr
->
object_ptr
))
->
DownText
,
&
((
pwr_sClass_AtLog
*
)(
list_ptr
->
object_ptr
))
->
Attribute
,
NULL
,
&
((
pwr_sClass_AtLog
*
)(
list_ptr
->
object_ptr
))
->
DownTime
,
&
log_list
,
&
log_count
,
&
log_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
}
((
pwr_sClass_AtLog
*
)(
list_ptr
->
object_ptr
))
->
DownSignal
=
0
;
}
list_ptr
++
;
}
/* Check if any CAtLog to log */
list_ptr
=
CAtLog_list
;
for
(
i
=
0
;
i
<
CAtLog_count
;
i
++
)
{
if
(((
pwr_sClass_CAtLog
*
)(
list_ptr
->
object_ptr
))
->
LogSignal
)
{
sprintf
(
text
,
"%g "
,
((
pwr_sClass_CAtLog
*
)(
list_ptr
->
object_ptr
))
->
LogValue
);
strcat
(
text
,
((
pwr_sClass_CAtLog
*
)(
list_ptr
->
object_ptr
))
->
LogText
);
sts
=
tlog_loglist_add
(
&
filectx
,
list_ptr
->
objid
,
tlog_logtype_CAtLog
,
(
pwr_tString80
*
)
text
,
&
((
pwr_sClass_CAtLog
*
)(
list_ptr
->
object_ptr
))
->
Attribute
,
NULL
,
&
((
pwr_sClass_CAtLog
*
)(
list_ptr
->
object_ptr
))
->
LogTime
,
&
log_list
,
&
log_count
,
&
log_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
((
pwr_sClass_CAtLog
*
)(
list_ptr
->
object_ptr
))
->
LogSignal
=
0
;
}
list_ptr
++
;
}
/* Check if any CDtLog to log */
list_ptr
=
CDtLog_list
;
for
(
i
=
0
;
i
<
CDtLog_count
;
i
++
)
{
if
(((
pwr_sClass_CDtLog
*
)(
list_ptr
->
object_ptr
))
->
LogSignal
)
{
sprintf
(
text
,
"%1d "
,
((
pwr_sClass_CDtLog
*
)(
list_ptr
->
object_ptr
))
->
LogValue
);
strcat
(
text
,
((
pwr_sClass_CDtLog
*
)(
list_ptr
->
object_ptr
))
->
LogText
);
sts
=
tlog_loglist_add
(
&
filectx
,
list_ptr
->
objid
,
tlog_logtype_CDtLog
,
(
pwr_tString80
*
)
text
,
&
((
pwr_sClass_CDtLog
*
)(
list_ptr
->
object_ptr
))
->
Attribute
,
NULL
,
&
((
pwr_sClass_CDtLog
*
)(
list_ptr
->
object_ptr
))
->
LogTime
,
&
log_list
,
&
log_count
,
&
log_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
((
pwr_sClass_CDtLog
*
)(
list_ptr
->
object_ptr
))
->
LogSignal
=
0
;
}
list_ptr
++
;
}
/* Check if any COtLog to log */
list_ptr
=
COtLog_list
;
for
(
i
=
0
;
i
<
COtLog_count
;
i
++
)
{
if
(((
pwr_sClass_COtLog
*
)(
list_ptr
->
object_ptr
))
->
LogSignal
)
{
sts
=
gdh_ObjidToName
(
((
pwr_sClass_COtLog
*
)(
list_ptr
->
object_ptr
))
->
LogValue
,
text
,
sizeof
(
text
),
cdh_mNName
);
if
(
EVEN
(
sts
))
{
strcpy
(
text
,
"Undefined Objid"
);
}
strcat
(
text
,
" "
);
strcat
(
text
,
((
pwr_sClass_COtLog
*
)(
list_ptr
->
object_ptr
))
->
LogText
);
sts
=
tlog_loglist_add
(
&
filectx
,
list_ptr
->
objid
,
tlog_logtype_COtLog
,
(
pwr_tString80
*
)
text
,
&
((
pwr_sClass_COtLog
*
)(
list_ptr
->
object_ptr
))
->
Attribute
,
NULL
,
&
((
pwr_sClass_COtLog
*
)(
list_ptr
->
object_ptr
))
->
LogTime
,
&
log_list
,
&
log_count
,
&
log_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
((
pwr_sClass_COtLog
*
)(
list_ptr
->
object_ptr
))
->
LogSignal
=
0
;
}
list_ptr
++
;
}
/* Check if any ChgAtLog to log */
list_ptr
=
ChgAtLog_list
;
for
(
i
=
0
;
i
<
ChgAtLog_count
;
i
++
)
{
if
(((
pwr_sClass_ChgAtLog
*
)(
list_ptr
->
object_ptr
))
->
LogSignal
)
{
sprintf
(
text
,
"%g "
,
((
pwr_sClass_ChgAtLog
*
)(
list_ptr
->
object_ptr
))
->
LogValue
);
strcat
(
text
,
((
pwr_sClass_ChgAtLog
*
)(
list_ptr
->
object_ptr
))
->
LogText
);
sts
=
tlog_loglist_add
(
&
filectx
,
list_ptr
->
objid
,
tlog_logtype_ChgAtLog
,
(
pwr_tString80
*
)
text
,
&
((
pwr_sClass_ChgAtLog
*
)(
list_ptr
->
object_ptr
))
->
Attribute
,
NULL
,
&
((
pwr_sClass_ChgAtLog
*
)(
list_ptr
->
object_ptr
))
->
LogTime
,
&
log_list
,
&
log_count
,
&
log_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
((
pwr_sClass_ChgAtLog
*
)(
list_ptr
->
object_ptr
))
->
LogSignal
=
0
;
}
list_ptr
++
;
}
/* Check if any ChgOtLog to log */
list_ptr
=
ChgOtLog_list
;
for
(
i
=
0
;
i
<
ChgOtLog_count
;
i
++
)
{
if
(((
pwr_sClass_ChgOtLog
*
)(
list_ptr
->
object_ptr
))
->
LogSignal
)
{
sts
=
gdh_ObjidToName
(
((
pwr_sClass_ChgOtLog
*
)(
list_ptr
->
object_ptr
))
->
LogValue
,
text
,
sizeof
(
text
),
cdh_mNName
);
if
(
EVEN
(
sts
))
{
strcpy
(
text
,
"Undefined Objid"
);
}
strcat
(
text
,
" "
);
strcat
(
text
,
((
pwr_sClass_ChgOtLog
*
)(
list_ptr
->
object_ptr
))
->
LogText
);
sts
=
tlog_loglist_add
(
&
filectx
,
list_ptr
->
objid
,
tlog_logtype_ChgOtLog
,
(
pwr_tString80
*
)
text
,
&
((
pwr_sClass_ChgOtLog
*
)(
list_ptr
->
object_ptr
))
->
Attribute
,
NULL
,
&
((
pwr_sClass_ChgOtLog
*
)(
list_ptr
->
object_ptr
))
->
LogTime
,
&
log_list
,
&
log_count
,
&
log_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
((
pwr_sClass_ChgOtLog
*
)(
list_ptr
->
object_ptr
))
->
LogSignal
=
0
;
}
list_ptr
++
;
}
/* Receive alarms */
sts
=
tlog_alarm_update
();
if
(
filectx
.
outfile
!=
0
)
{
/* Check if file should be closed */
if
(
filectx
.
object_ptr
->
CloseSignal
)
{
/* Close */
sts
=
tlog_extselectlist_unmodify
(
&
filectx
,
filectx
.
objid
);
sts
=
tlog_loglist_add
(
&
filectx
,
filectx
.
objid
,
tlog_logtype_Close
,
(
pwr_tString80
*
)
"File closed"
,
NULL
,
(
pwr_tString80
*
)
""
,
&
filectx
.
object_ptr
->
CloseTime
,
&
log_list
,
&
log_count
,
&
log_alloc
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
filectx
.
object_ptr
->
CloseSignal
=
0
;
filectx
.
object_ptr
->
FileOpen
=
0
;
}
/* Print logging on log file */
sts
=
tlog_loglist_print
(
&
filectx
,
log_list
,
&
log_count
,
UserObject
);
if
(
EVEN
(
sts
))
LogAndExit
(
sts
);
}
tlog_sleep
(
scantime
);
}
fatal_error:
tlog_TLogConf
->
On
=
0
;
}
}
tlog/exe/rs_tlog_diff/src/rs_tlog_diff.c
0 → 100644
View file @
16ebc80d
/*
* Proview $Id: rs_tlog_diff.c,v 1.1 2006-01-10 14:38:36 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund 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.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <clidef.h>
#include <climsgdef.h>
#include <processes.h>
#include <smgdef.h>
#include <trmdef.h>
#include <ssdef.h>
#include <descrip.h>
#include <lib$routines.h>
#include <smg$routines.h>
#include "pwr.h"
#include "pwr_class.h"
int
cli
$
dcl_parse
();
int
cli
$
dispatch
();
int
*
tlog_cld
()
;
/* module name in tlog_cld.cld file */
/*************************************************************************
*
* Name: info_msg()
* Type void
*
* Type Parameter IOGF Description
* unsigned long sts I error message to print.
*
* Description:
* If the message is a error, warning or info message it is printed.
*
**************************************************************************/
void
sutil_msg
(
unsigned
long
sts
)
{
static
int
msgsts
;
static
int
msglen
;
static
char
msg
[
256
];
struct
dsc
$
descriptor_s
msgdesc
=
{
sizeof
(
msg
)
-
1
,
DSC
$
K_DTYPE_T
,
DSC
$
K_CLASS_S
,};
msgdesc
.
dsc
$
a_pointer
=
msg
;
if
(
(
EVEN
(
sts
))
||
((
sts
&
1
)
&&
(
sts
&
2
))
)
{
msgsts
=
sts
;
lib
$
sys_getmsg
(
&
msgsts
,
&
msglen
,
&
msgdesc
,
0
,
0
);
msg
[
msglen
]
=
'\0'
;
printf
(
"%s
\n
"
,
msg
);
}
}
main
(
int
argc
,
char
*
argv
[])
{
long
sts
;
int
i
;
char
str
[
256
]
;
int
key_id
;
unsigned
short
res_len
;
$
DESCRIPTOR
(
device_desc
,
"sys$input"
);
$
DESCRIPTOR
(
outdevice_desc
,
"sys$output"
);
$
DESCRIPTOR
(
prompt_desc
,
"tlog> "
);
struct
dsc
$
descriptor_s
str_desc
=
{
sizeof
(
str
)
-
1
,
DSC
$
K_DTYPE_T
,
DSC
$
K_CLASS_S
,};
str_desc
.
dsc
$
a_pointer
=
str
;
/* avanti */
/* If arguments, treat them as a command and then exit */
if
(
argc
>=
2
)
{
str
[
0
]
=
0
;
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
i
!=
1
)
strcat
(
str
,
" "
);
strcat
(
str
,
argv
[
i
]);
}
sts
=
cli
$
dcl_parse
(
&
str_desc
,
tlog_cld
,
0
,
0
,
0
)
;
/* send the command to the rtn associated */
if
(
sts
==
CLI
$
_NORMAL
)
sts
=
cli
$
dispatch
();
sutil_msg
(
sts
);
exit
(
sts
);
}
/* init input */
sts
=
smg
$
create_virtual_keyboard
(
&
key_id
,
&
device_desc
,
0
,
0
,
0
);
while
(
1
)
{
/* get and parse the command */
/* get input */
sts
=
smg
$
read_composed_line
(
&
key_id
,
0
,
&
str_desc
,
&
prompt_desc
,
&
res_len
);
if
(
res_len
==
0
)
continue
;
if
(
!
(
sts
&&
1
)
)
lib
$
signal
(
sts
)
;
str
[
res_len
]
=
0
;
sts
=
cli
$
dcl_parse
(
&
str_desc
,
tlog_cld
,
0
,
0
,
0
)
;
/* send the command to the rtn associated */
if
(
sts
==
CLI
$
_NORMAL
)
{
sts
=
cli
$
dispatch
(
)
;
sutil_msg
(
sts
);
}
}
}
tlog/exe/rs_tlog_diff/src/tlog_cld.cld
0 → 100644
View file @
16ebc80d
module tlog_cld
! to get help
define verb help , routine scli_help
! to stop the game
define verb exit , routine scli_exit
define verb quit , routine scli_quit
! tlog commands
define verb tlog,
parameter p1 , label =p1tlog , value ( required , type = p1tlogtype )
! associate syntax depending of the parameter value
define type p1tlogtype
keyword difference, syntax = p1tlogdifference_syntax
keyword save, syntax = p1tlogsave_syntax
define syntax p1tlogdifference_syntax
qualifier file, nonnegatable , value ( required )
qualifier output, nonnegatable , value ( required )
qualifier time, nonnegatable , value ( required )
qualifier since, nonnegatable , value
qualifier before, nonnegatable , value
qualifier parallell
qualifier attribute
qualifier text
qualifier ttext
qualifier noorder
qualifier exact
disallow attribute and not parallell
disallow text and not parallell
disallow text and attribute
disallow text and ttext
disallow ttext and attribute
disallow noorder and exact
routine scli_tlog_difference
define syntax p1tlogsave_syntax
qualifier file, nonnegatable , value ( required )
disallow not file
routine scli_tlog_save
tlog/exe/rs_tlog_diff/src/tlog_cli.c
0 → 100644
View file @
16ebc80d
/*
* Proview $Id: tlog_cli.c,v 1.1 2006-01-10 14:38:36 claes Exp $
* 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.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <clidef.h>
#include <climsgdef.h>
#include <ssdef.h>
#include <descrip.h>
#include <lib$routines.h>
#include <processes.h>
#include <smgdef.h>
#include <trmdef.h>
#include "pwr.h"
#include "tlog_diff.h"
/* What should be included to declare this ????? */
int
cli
$
get_value
();
int
cli
$
present
();
static
unsigned
long
userlist
=
0
;
int
sutil_get_qualval
(
qual
,
qual_val
,
sendlen
)
char
*
qual
;
char
*
qual_val
;
int
sendlen
;
/*
qual_val should be the address of the array of char and not a pointer to
char
*/
{
struct
dsc
$
descriptor_s
q1desc
;
struct
dsc
$
descriptor_s
q1strdesc
;
int
i
;
short
len
;
long
sts
;
/*
Notice that cli$get_value does not terminate the string with '\0' but
return his length instead.
*/
/* a descriptor is a complicated object ! */
q1desc
.
dsc
$
b_dtype
=
DSC
$
K_DTYPE_T
;
q1desc
.
dsc
$
b_class
=
DSC
$
K_CLASS_S
;
q1desc
.
dsc
$
a_pointer
=
qual
;
q1desc
.
dsc
$
w_length
=
strlen
(
qual
)
;
q1strdesc
.
dsc
$
b_dtype
=
DSC
$
K_DTYPE_T
;
q1strdesc
.
dsc
$
b_class
=
DSC
$
K_CLASS_S
;
q1strdesc
.
dsc
$
a_pointer
=
qual_val
;
q1strdesc
.
dsc
$
w_length
=
sendlen
;
/* I have not found a way to oblige the user to enter a qualifier
so you have to check here if there is one */
sts
=
cli
$
present
(
&
q1desc
)
;
if
(
sts
!=
CLI
$
_PRESENT
)
return
0
;
else
{
sts
=
cli
$
get_value
(
&
q1desc
,
&
q1strdesc
,
&
len
)
;
if
(
sts
==
CLI
$
_ABSENT
)
return
0
;
else
if
(
sts
==
CLI
$
_COMMA
)
{
while
(
sts
==
CLI
$
_COMMA
)
{
*
(
q1strdesc
.
dsc
$
a_pointer
+
len
)
=
','
;
q1strdesc
.
dsc
$
a_pointer
+=
len
+
1
;
q1strdesc
.
dsc
$
w_length
-=
len
+
1
;
sts
=
cli
$
get_value
(
&
q1desc
,
&
q1strdesc
,
&
len
)
;
}
if
(
sts
!=
SS
$
_NORMAL
)
{
printf
(
"sutil_getqual_val : ERROR no end of list of qual values
\n
"
);
return
0
;
}
}
*
(
q1strdesc
.
dsc
$
a_pointer
+
len
)
=
'\0'
;
}
return
1
;
}
int
sutil_get_qual
(
qual
,
condval_ptr
)
char
*
qual
;
long
*
condval_ptr
;
/*
check the presence of the qualifier which name is sended in the qual argument
in the last parsed command.
you should call this rtn to chack the presence of qualifier to which
there is no associated value.
the return status is true if
the qual is present (even by default ) and not negated in the last parsed command
(the condition value returned is not CLI$_ABSENT ).
false otherwise : in this case *condval_ptr contain the condition value :
CLI$_LOCPRES , CLI$_LOCNEG , CLI$_DEFAULTED
*/
{
struct
dsc
$
descriptor_s
q1desc
;
long
sts
;
/* a descriptor is a complicated object ! */
q1desc
.
dsc
$
b_dtype
=
DSC
$
K_DTYPE_T
;
q1desc
.
dsc
$
b_class
=
DSC
$
K_CLASS_S
;
q1desc
.
dsc
$
a_pointer
=
qual
;
q1desc
.
dsc
$
w_length
=
strlen
(
qual
)
;
/* I have not found a way to oblige the user to enter a qualifier
so you have to check here if there is one */
*
condval_ptr
=
cli
$
present
(
&
q1desc
)
;
if
(
*
condval_ptr
!=
CLI
$
_ABSENT
&&
*
condval_ptr
!=
CLI
$
_NEGATED
)
return
1
;
return
0
;
}
int
scli_help
(
)
{
char
command
[
120
];
strcpy
(
command
,
"help/libra=ssab_lib:ds_ssabutl_hlp ssab_utils ssab_utl"
);
system
(
command
);
return
1
;
}
int
scli_quit
()
{
/* Quit */
exit
(
1
);
return
1
;
}
int
scli_exit
()
{
exit
(
1
);
return
1
;
}
int
scli_tlog_difference
()
{
char
filestr
[
80
];
char
outputstr
[
80
];
char
*
outputstr_p
;
char
timestr
[
80
];
char
*
timestr_p
;
char
sincestr
[
80
];
char
*
sincestr_p
;
char
beforestr
[
80
];
char
*
beforestr_p
;
int
parallell
;
int
attribute
;
int
text
;
int
ttext
;
int
noorder
;
int
exact
;
int
sts
;
int
condval
;
if
(
!
sutil_get_qualval
(
"file"
,
filestr
,
80
))
strcpy
(
filestr
,
"*"
);
if
(
sutil_get_qualval
(
"output"
,
outputstr
,
80
))
outputstr_p
=
outputstr
;
else
outputstr_p
=
NULL
;
if
(
sutil_get_qualval
(
"time"
,
timestr
,
80
))
timestr_p
=
timestr
;
else
timestr_p
=
NULL
;
parallell
=
sutil_get_qual
(
"parallell"
,
&
sts
);
attribute
=
sutil_get_qual
(
"attribute"
,
&
sts
);
text
=
sutil_get_qual
(
"text"
,
&
sts
);
ttext
=
sutil_get_qual
(
"ttext"
,
&
sts
);
noorder
=
sutil_get_qual
(
"noorder"
,
&
sts
);
exact
=
sutil_get_qual
(
"exact"
,
&
sts
);
if
(
sutil_get_qual
(
"since"
,
&
sts
))
{
if
(
!
sutil_get_qualval
(
"since"
,
sincestr
,
80
))
strcpy
(
sincestr
,
""
);
sincestr_p
=
sincestr
;
}
else
sincestr_p
=
NULL
;
if
(
sutil_get_qual
(
"before"
,
&
sts
))
{
if
(
!
sutil_get_qualval
(
"before"
,
beforestr
,
80
))
strcpy
(
beforestr
,
""
);
beforestr_p
=
beforestr
;
}
else
beforestr_p
=
NULL
;
sts
=
tlog_diff
(
filestr
,
outputstr_p
,
timestr_p
,
parallell
,
attribute
,
text
,
ttext
,
noorder
,
exact
,
sincestr_p
,
beforestr_p
);
return
sts
;
}
int
scli_tlog_save
()
{
char
filestr
[
80
];
int
sts
;
int
condval
;
sutil_get_qualval
(
"file"
,
filestr
,
80
);
sts
=
tlog_save
(
filestr
);
return
sts
;
}
tlog/exe/rs_tlog_diff/src/tlog_diff.c
0 → 100644
View file @
16ebc80d
/*
* Proview $Id: tlog_diff.c,v 1.1 2006-01-10 14:38:36 claes Exp $
* 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.
*/
/*_Include files_________________________________________________________*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <descrip.h>
#include <processes.h>
#include <starlet.h>
#include <libdef.h>
#include <libdtdef.h>
#include <lib$routines.h>
#include "pwr.h"
#include "pwr_class.h"
#include "wb_dir.h"
#include "co_time.h"
#include "rs_tlog_msg.h"
#include "tlog_diff.h"
/* Nice functions */
#define ODD(a) (((int)(a) & 1) != 0)
#define EVEN(a) (((int)(a) & 1) == 0)
#define max(Dragon,Eagle) ((Dragon) > (Eagle) ? (Dragon) : (Eagle))
#define min(Dragon,Eagle) ((Dragon) < (Eagle) ? (Dragon) : (Eagle))
#ifndef __ALPHA
#define abs(Dragon) ((Dragon) >= 0 ? (Dragon) : (-(Dragon)))
#endif
#define TLOG_LINEALLOC 50
#define TLOG_TIME_EPSILON 0.05
#define TLOG_LINE_TEXT 56
#define TLOG_LINE_ATTRIBUTE 15
#define TLOG_LINE_TYPE 12
enum
tlog_ee_logtype
{
tlog_logtype_DtLogUp
,
tlog_logtype_DtLogDown
,
tlog_logtype_AtLogUp
,
tlog_logtype_AtLogDown
,
tlog_logtype_Info
,
tlog_logtype_AlarmA
,
tlog_logtype_AlarmB
,
tlog_logtype_AlarmC
,
tlog_logtype_AlarmD
,
tlog_logtype_Modify
,
tlog_logtype_UnModify
,
tlog_logtype_Close
,
tlog_logtype_CAtLog
,
tlog_logtype_CDtLog
,
tlog_logtype_COtLog
,
tlog_logtype_ExecOn
,
tlog_logtype_ExecOff
};
typedef
enum
tlog_ee_logtype
tlog_e_logtype
;
typedef
struct
{
pwr_tString132
line
;
pwr_tDeltaTime
time
;
tlog_e_logtype
logtype
;
float
value
;
int
line_nr
;
int
cmp_index
;
int
written
;
}
tlog_t_linelist
;
typedef
struct
{
tlog_t_linelist
*
new_list
;
tlog_t_linelist
*
old_list
;
int
new_list_count
;
int
old_list_count
;
int
current_new
;
int
current_old
;
float
max_difftime
;
FILE
*
outfile
;
int
diff_found
;
int
parallell
;
int
attribute
;
int
text
;
int
ttext
;
int
noorder
;
int
exact
;
char
new_filename
[
80
];
char
old_filename
[
80
];
}
*
diff_ctx
;
static
int
announce
=
0
;
static
int
tlog_get_defaultfilename
(
char
*
inname
,
char
*
outname
,
char
*
ext
,
char
*
disk
);
static
int
tlog_get_modulename
(
char
*
inname
,
char
*
outname
);
static
int
tlog_checktime
(
pwr_tDeltaTime
*
time_new
,
pwr_tDeltaTime
*
time_old
,
float
maxdiff
);
static
int
tlog_print_line
(
diff_ctx
ctx
,
tlog_t_linelist
*
list
,
int
index
,
int
old
);
static
int
tlog_print_linepar
(
diff_ctx
ctx
,
tlog_t_linelist
*
newlist
,
tlog_t_linelist
*
oldlist
,
int
newindex
,
int
oldindex
);
static
int
tlog_lists_cmp_line
(
diff_ctx
ctx
);
static
int
tlog_line_compare
(
tlog_t_linelist
*
newlist_ptr
,
tlog_t_linelist
*
oldlist_ptr
);
static
void
tlog_lists_cmp_printparseline
(
diff_ctx
ctx
);
static
int
tlog_lists_cmp_printnew
(
diff_ctx
ctx
,
int
index
,
int
*
lines
);
static
int
tlog_lists_cmp_printold
(
diff_ctx
ctx
,
int
index
,
int
*
lines
);
static
int
tlog_lists_cmp_printboth
(
diff_ctx
ctx
,
int
newindex
,
int
oldindex
,
int
*
newlines
,
int
*
oldlines
);
static
int
tlog_lists_cmp
(
diff_ctx
ctx
);
static
int
tlog_read_line
(
char
*
line
,
int
maxsize
,
FILE
*
file
);
static
pwr_tStatus
tlog_line_add
(
pwr_tString132
*
line
,
tlog_t_linelist
**
list
,
int
*
list_count
,
int
*
alloc
,
int
line_nr
);
static
pwr_tStatus
tlog_insert_file
(
char
*
filename
,
tlog_t_linelist
**
list
,
int
*
list_count
,
char
*
full_filename
);
static
pwr_tStatus
tlog_qual_to_time
(
char
*
in_str
,
pwr_tTime
*
time
);
/*************************************************************************
*
* Name: tlog_get_defaultfilename()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
*
**************************************************************************/
static
int
tlog_get_defaultfilename
(
char
*
inname
,
char
*
outname
,
char
*
ext
,
char
*
disk
)
{
char
*
s
;
char
*
s2
;
char
filename
[
80
];
/* Add default disk if no disk is suplied */
if
(
!
(
strchr
(
inname
,
':'
)
||
strchr
(
inname
,
'<'
)
||
strchr
(
inname
,
'['
)))
{
strcpy
(
filename
,
disk
);
strcat
(
filename
,
inname
);
strcpy
(
outname
,
filename
);
}
else
strcpy
(
outname
,
inname
);
/* Look for extention in filename */
if
(
ext
!=
NULL
)
{
s
=
strrchr
(
inname
,
':'
);
if
(
s
==
0
)
s
=
inname
;
s2
=
strrchr
(
s
,
'>'
);
if
(
s2
==
0
)
{
s2
=
strrchr
(
s
,
']'
);
if
(
s2
==
0
)
s2
=
s
;
}
s
=
strrchr
(
s2
,
'.'
);
if
(
s
==
0
)
{
/* No extention found, add extention */
strcat
(
outname
,
ext
);
}
}
return
TLOG__SUCCESS
;
}
/*************************************************************************
*
* Name: tlog_get_modulename()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
*
**************************************************************************/
static
int
tlog_get_modulename
(
char
*
inname
,
char
*
outname
)
{
char
*
s
;
char
*
s2
;
char
filename
[
80
];
s2
=
0
;
if
(
s
=
strchr
(
inname
,
':'
))
s2
=
s
;
if
(
s
=
strchr
(
inname
,
']'
))
s2
=
s
;
if
(
s
=
strchr
(
inname
,
'>'
))
s2
=
s
;
if
(
s2
)
strcpy
(
outname
,
s2
+
1
);
else
strcpy
(
outname
,
inname
);
if
(
s
=
strrchr
(
outname
,
'.'
))
*
s
=
0
;
return
TLOG__SUCCESS
;
}
/*************************************************************************
*
* Name: tlog_checktime
*
* Typ int
*
* Typ Parameter IOGF Beskrivning
*
* Beskrivning:
*
*
**************************************************************************/
static
int
tlog_checktime
(
pwr_tDeltaTime
*
time_new
,
pwr_tDeltaTime
*
time_old
,
float
maxdiff
)
{
pwr_tDeltaTime
tim_maxdiff
;
pwr_tDeltaTime
tim_limlow
;
pwr_tDeltaTime
tim_limhigh
;
int
sts
;
time_FloatToD
(
&
tim_maxdiff
,
maxdiff
);
time_Dadd
(
&
tim_limhigh
,
time_new
,
&
tim_maxdiff
);
time_Dsub
(
&
tim_limlow
,
time_new
,
&
tim_maxdiff
);
if
(
time_Dcomp
(
time_old
,
&
tim_limlow
)
==
-
1
)
return
TLOG__TIME_LT
;
if
(
time_Dcomp
(
time_old
,
&
tim_limhigh
)
==
1
)
return
TLOG__TIME_GT
;
return
TLOG__TIME_EQ
;
/*************
tim_maxdiff.high = -1;
tim_maxdiff.low = -maxdiff * 10000000;
if ( maxdiff == 0)
tim_maxdiff.low = -1;
sts = lib$add_times( time_new, &tim_maxdiff, &tim_limhigh);
sts = lib$sub_times( time_new, &tim_maxdiff, &tim_limlow);
if ( sts == LIB$_NEGTIM)
{
tim_limlow.high = -1;
tim_limlow.low = -1;
}
sts = lib$sub_times( time_old, &tim_limlow, &testtime);
if ( sts == LIB$_NEGTIM)
return TLOG__TIME_LT;
sts = lib$sub_times( &tim_limhigh, time_old, &testtime);
if ( sts == LIB$_NEGTIM)
return TLOG__TIME_GT;
return TLOG__TIME_EQ;
************/
}
/*************************************************************************
*
* Name: tlog_print_line
*
* Typ int
*
* Typ Parameter IOGF Beskrivning
*
* Beskrivning:
*
*
**************************************************************************/
static
int
tlog_print_line
(
diff_ctx
ctx
,
tlog_t_linelist
*
list
,
int
index
,
int
old
)
{
pwr_tString132
str
;
list
+=
index
;
if
(
ctx
->
parallell
)
{
if
(
ctx
->
attribute
)
{
sprintf
(
str
,
"%d "
,
list
->
line_nr
);
strncat
(
str
,
&
list
->
line
[
TLOG_LINE_ATTRIBUTE
],
TLOG_LINE_TEXT
-
TLOG_LINE_ATTRIBUTE
);
str
[
TLOG_LINE_TEXT
]
=
0
;
}
else
if
(
ctx
->
text
)
{
sprintf
(
str
,
"%d "
,
list
->
line_nr
);
strcat
(
str
,
&
list
->
line
[
TLOG_LINE_TEXT
]);
}
else
if
(
ctx
->
ttext
)
{
sprintf
(
str
,
"%d %*.*s"
,
list
->
line_nr
,
TLOG_LINE_ATTRIBUTE
,
TLOG_LINE_ATTRIBUTE
,
list
->
line
);
strcat
(
str
,
&
list
->
line
[
TLOG_LINE_TEXT
]);
}
else
sprintf
(
str
,
"%d %s"
,
list
->
line_nr
,
list
->
line
);
if
(
old
)
{
if
(
ctx
->
outfile
)
fprintf
(
ctx
->
outfile
,
" | %-38.38s
\n
"
,
str
);
else
printf
(
" | %-38.38s
\n
"
,
str
);
}
else
{
if
(
ctx
->
outfile
)
fprintf
(
ctx
->
outfile
,
" %-38.38s |
\n
"
,
str
);
else
printf
(
" %-38.38s |
\n
"
,
str
);
}
}
else
{
if
(
ctx
->
outfile
)
fprintf
(
ctx
->
outfile
,
"%d %s
\n
"
,
list
->
line_nr
,
list
->
line
);
else
printf
(
"%d %s
\n
"
,
list
->
line_nr
,
list
->
line
);
}
return
TLOG__SUCCESS
;
}
static
int
tlog_print_linepar
(
diff_ctx
ctx
,
tlog_t_linelist
*
newlist
,
tlog_t_linelist
*
oldlist
,
int
newindex
,
int
oldindex
)
{
pwr_tString132
strnew
;
pwr_tString132
strold
;
newlist
+=
newindex
;
oldlist
+=
oldindex
;
if
(
ctx
->
attribute
)
{
sprintf
(
strnew
,
"%d "
,
newlist
->
line_nr
);
strncat
(
strnew
,
&
newlist
->
line
[
TLOG_LINE_ATTRIBUTE
],
TLOG_LINE_TEXT
-
TLOG_LINE_ATTRIBUTE
);
strnew
[
TLOG_LINE_TEXT
]
=
0
;
sprintf
(
strold
,
"%d "
,
oldlist
->
line_nr
);
strncat
(
strold
,
&
oldlist
->
line
[
TLOG_LINE_ATTRIBUTE
],
TLOG_LINE_TEXT
-
TLOG_LINE_ATTRIBUTE
);
strold
[
TLOG_LINE_TEXT
]
=
0
;
}
else
if
(
ctx
->
text
)
{
sprintf
(
strnew
,
"%d "
,
newlist
->
line_nr
);
strcat
(
strnew
,
&
newlist
->
line
[
TLOG_LINE_TEXT
]);
sprintf
(
strold
,
"%d "
,
oldlist
->
line_nr
);
strcat
(
strold
,
&
oldlist
->
line
[
TLOG_LINE_TEXT
]);
}
else
if
(
ctx
->
ttext
)
{
sprintf
(
strnew
,
"%d %*.*s"
,
newlist
->
line_nr
,
TLOG_LINE_ATTRIBUTE
,
TLOG_LINE_ATTRIBUTE
,
newlist
->
line
);
strcat
(
strnew
,
&
newlist
->
line
[
TLOG_LINE_TEXT
]);
sprintf
(
strold
,
"%d %*.*s"
,
oldlist
->
line_nr
,
TLOG_LINE_ATTRIBUTE
,
TLOG_LINE_ATTRIBUTE
,
oldlist
->
line
);
strcat
(
strold
,
&
oldlist
->
line
[
TLOG_LINE_TEXT
]);
}
else
{
sprintf
(
strnew
,
"%d %s"
,
newlist
->
line_nr
,
newlist
->
line
);
sprintf
(
strold
,
"%d %s"
,
oldlist
->
line_nr
,
oldlist
->
line
);
}
if
(
ctx
->
outfile
)
fprintf
(
ctx
->
outfile
,
" %-38.38s | %-38.38s
\n
"
,
strnew
,
strold
);
else
printf
(
" %-38.38s | %-38.38s
\n
"
,
strnew
,
strold
);
return
TLOG__SUCCESS
;
}
/*************************************************************************
*
* Name: tlog_lists_cmp_line
*
* Typ int
*
* Typ Parameter IOGF Beskrivning
*
* Beskrivning:
* Compare two lines
*
**************************************************************************/
static
int
tlog_lists_cmp_line
(
diff_ctx
ctx
)
{
tlog_t_linelist
*
newlist_ptr
;
tlog_t_linelist
*
oldlist_ptr
;
int
i
;
int
sts
;
int
found
;
newlist_ptr
=
ctx
->
new_list
+
ctx
->
current_new
;
/* Start with current old and search forward */
found
=
0
;
for
(
i
=
ctx
->
current_old
;
i
<
ctx
->
old_list_count
;
i
++
)
{
oldlist_ptr
=
ctx
->
old_list
+
i
;
if
(
oldlist_ptr
->
cmp_index
==
-
1
)
{
sts
=
tlog_checktime
(
&
newlist_ptr
->
time
,
&
oldlist_ptr
->
time
,
ctx
->
max_difftime
);
if
(
sts
==
TLOG__TIME_GT
)
break
;
if
(
sts
==
TLOG__TIME_EQ
)
{
sts
=
tlog_line_compare
(
newlist_ptr
,
oldlist_ptr
);
if
(
ODD
(
sts
))
{
found
=
1
;
break
;
}
}
}
}
if
(
!
found
&&
ctx
->
noorder
)
{
/* Search backwards */
for
(
i
=
ctx
->
current_old
-
1
;
i
>=
0
;
i
--
)
{
oldlist_ptr
=
ctx
->
old_list
+
i
;
if
(
oldlist_ptr
->
cmp_index
==
-
1
)
{
sts
=
tlog_checktime
(
&
newlist_ptr
->
time
,
&
oldlist_ptr
->
time
,
ctx
->
max_difftime
);
if
(
sts
==
TLOG__TIME_LT
)
break
;
if
(
sts
==
TLOG__TIME_EQ
)
{
sts
=
tlog_line_compare
(
newlist_ptr
,
oldlist_ptr
);
if
(
ODD
(
sts
))
{
found
=
1
;
break
;
}
}
}
}
}
else
if
(
!
found
&&
!
ctx
->
exact
)
{
/* Search backwards as long as the time is the same*/
for
(
i
=
ctx
->
current_old
-
1
;
i
>=
0
;
i
--
)
{
oldlist_ptr
=
ctx
->
old_list
+
i
;
if
(
oldlist_ptr
->
cmp_index
==
-
1
)
{
sts
=
tlog_checktime
(
&
newlist_ptr
->
time
,
&
oldlist_ptr
->
time
,
TLOG_TIME_EPSILON
);
if
(
sts
==
TLOG__TIME_LT
)
break
;
sts
=
tlog_line_compare
(
newlist_ptr
,
oldlist_ptr
);
if
(
ODD
(
sts
))
{
found
=
1
;
break
;
}
}
}
}
if
(
!
found
)
return
TLOG__SUCCESS
;
/* Insert the index of the matching line */
newlist_ptr
->
cmp_index
=
i
;
oldlist_ptr
->
cmp_index
=
ctx
->
current_new
;
ctx
->
current_old
=
i
+
1
;
return
TLOG__SUCCESS
;
}
/*************************************************************************
*
* Name: tlog_line_compare
*
* Typ int
*
* Typ Parameter IOGF Beskrivning
*
* Beskrivning:
* Compare two lines
*
**************************************************************************/
static
int
tlog_line_compare
(
tlog_t_linelist
*
newlist_ptr
,
tlog_t_linelist
*
oldlist_ptr
)
{
/* Compare the text */
if
(
strcmp
(
&
newlist_ptr
->
line
[
TLOG_LINE_TEXT
],
&
oldlist_ptr
->
line
[
TLOG_LINE_TEXT
]))
return
TLOG__DIFFTEXT
;
if
(
strncmp
(
&
newlist_ptr
->
line
[
TLOG_LINE_ATTRIBUTE
],
&
oldlist_ptr
->
line
[
TLOG_LINE_ATTRIBUTE
],
TLOG_LINE_TEXT
-
TLOG_LINE_ATTRIBUTE
))
return
TLOG__DIFFATTR
;
return
TLOG__SUCCESS
;
}
/*************************************************************************
*
* Name: tlog_lists_cmp_linelist
*
* Typ int
*
* Typ Parameter IOGF Beskrivning
*
* Beskrivning:
* Print a lines in newlist.
*
**************************************************************************/
static
void
tlog_lists_cmp_printparseline
(
diff_ctx
ctx
)
{
if
(
ctx
->
parallell
)
{
if
(
ctx
->
outfile
)
fprintf
(
ctx
->
outfile
,
"----------------------------------------|---------------------------------------
\n
"
);
else
printf
(
"----------------------------------------|---------------------------------------
\n
"
);
}
else
{
if
(
ctx
->
outfile
)
fprintf
(
ctx
->
outfile
,
"*********************************************************
\n
"
);
else
printf
(
"*********************************************************
\n
"
);
}
}
static
int
tlog_lists_cmp_printnew
(
diff_ctx
ctx
,
int
index
,
int
*
lines
)
{
tlog_t_linelist
*
newlist_ptr
;
int
i
;
tlog_lists_cmp_printparseline
(
ctx
);
if
(
!
ctx
->
parallell
)
{
if
(
ctx
->
outfile
)
fprintf
(
ctx
->
outfile
,
"--New----------------------------------------
\n
"
);
else
printf
(
"--New----------------------------------------
\n
"
);
}
*
lines
=
0
;
for
(
i
=
index
;
i
<
ctx
->
new_list_count
;
i
++
)
{
newlist_ptr
=
ctx
->
new_list
+
i
;
if
(
newlist_ptr
->
cmp_index
!=
-
1
)
break
;
tlog_print_line
(
ctx
,
ctx
->
new_list
,
i
,
0
);
(
*
lines
)
++
;
}
ctx
->
diff_found
++
;
return
TLOG__SUCCESS
;
}
static
int
tlog_lists_cmp_printold
(
diff_ctx
ctx
,
int
index
,
int
*
lines
)
{
tlog_t_linelist
*
oldlist_ptr
;
int
i
;
tlog_lists_cmp_printparseline
(
ctx
);
if
(
!
ctx
->
parallell
)
{
if
(
ctx
->
outfile
)
fprintf
(
ctx
->
outfile
,
"--Old----------------------------------------
\n
"
);
else
printf
(
"--Old----------------------------------------
\n
"
);
}
*
lines
=
0
;
for
(
i
=
index
;
i
<
ctx
->
old_list_count
;
i
++
)
{
oldlist_ptr
=
ctx
->
old_list
+
i
;
if
(
oldlist_ptr
->
cmp_index
!=
-
1
)
break
;
tlog_print_line
(
ctx
,
ctx
->
old_list
,
i
,
1
);
(
*
lines
)
++
;
}
ctx
->
diff_found
++
;
return
TLOG__SUCCESS
;
}
static
int
tlog_lists_cmp_printboth
(
diff_ctx
ctx
,
int
newindex
,
int
oldindex
,
int
*
newlines
,
int
*
oldlines
)
{
tlog_t_linelist
*
newlist_ptr
;
tlog_t_linelist
*
oldlist_ptr
;
int
i
;
int
print_new
;
int
print_old
;
if
(
!
ctx
->
parallell
)
{
tlog_lists_cmp_printparseline
(
ctx
);
if
(
ctx
->
outfile
)
fprintf
(
ctx
->
outfile
,
"--New----------------------------------------
\n
"
);
else
printf
(
"--New----------------------------------------
\n
"
);
*
newlines
=
0
;
for
(
i
=
newindex
;
i
<
ctx
->
new_list_count
;
i
++
)
{
newlist_ptr
=
ctx
->
new_list
+
i
;
if
(
newlist_ptr
->
cmp_index
!=
-
1
)
break
;
tlog_print_line
(
ctx
,
ctx
->
new_list
,
i
,
0
);
(
*
newlines
)
++
;
}
if
(
ctx
->
outfile
)
fprintf
(
ctx
->
outfile
,
"--Old----------------------------------------
\n
"
);
else
printf
(
"--Old----------------------------------------
\n
"
);
*
oldlines
=
0
;
for
(
i
=
oldindex
;
i
<
ctx
->
old_list_count
;
i
++
)
{
oldlist_ptr
=
ctx
->
old_list
+
i
;
if
(
oldlist_ptr
->
cmp_index
!=
-
1
)
break
;
tlog_print_line
(
ctx
,
ctx
->
old_list
,
i
,
1
);
(
*
oldlines
)
++
;
}
ctx
->
diff_found
++
;
}
else
{
*
newlines
=
0
;
*
oldlines
=
0
;
tlog_lists_cmp_printparseline
(
ctx
);
print_old
=
1
;
print_new
=
1
;
for
(
i
=
0
;
;
i
++
)
{
oldlist_ptr
=
ctx
->
old_list
+
oldindex
+
i
;
newlist_ptr
=
ctx
->
new_list
+
newindex
+
i
;
if
(
print_old
&&
oldindex
+
i
<
ctx
->
old_list_count
&&
oldlist_ptr
->
cmp_index
==
-
1
)
print_old
=
1
;
else
print_old
=
0
;
if
(
print_new
&&
newindex
+
i
<
ctx
->
new_list_count
&&
newlist_ptr
->
cmp_index
==
-
1
)
print_new
=
1
;
else
print_new
=
0
;
if
(
print_new
&&
print_old
)
{
tlog_print_linepar
(
ctx
,
ctx
->
new_list
,
ctx
->
old_list
,
newindex
+
i
,
oldindex
+
i
);
(
*
oldlines
)
++
;
(
*
newlines
)
++
;
}
else
if
(
print_new
)
{
tlog_print_line
(
ctx
,
ctx
->
new_list
,
newindex
+
i
,
0
);
(
*
newlines
)
++
;
}
else
if
(
print_old
)
{
tlog_print_line
(
ctx
,
ctx
->
old_list
,
oldindex
+
i
,
1
);
(
*
oldlines
)
++
;
}
else
break
;
}
ctx
->
diff_found
++
;
}
return
TLOG__SUCCESS
;
}
/*************************************************************************
*
* Name: tlog_lists_cmp
*
* Typ int
*
* Typ Parameter IOGF Beskrivning
*
* Beskrivning:
* Compare to lists.
*
**************************************************************************/
static
int
tlog_lists_cmp
(
diff_ctx
ctx
)
{
int
sts
;
int
i
,
j
;
tlog_t_linelist
*
newlist_ptr
;
tlog_t_linelist
*
oldlist_ptr
;
char
filename
[
80
];
int
lines
,
newlines
,
oldlines
;
int
next_new
;
for
(
i
=
0
;
i
<
ctx
->
new_list_count
;
i
++
)
{
newlist_ptr
=
ctx
->
new_list
+
i
;
newlist_ptr
->
cmp_index
=
-
1
;
}
for
(
i
=
0
;
i
<
ctx
->
old_list_count
;
i
++
)
{
oldlist_ptr
=
ctx
->
old_list
+
i
;
oldlist_ptr
->
cmp_index
=
-
1
;
}
for
(
i
=
0
;
i
<
ctx
->
new_list_count
;
i
++
)
{
sts
=
tlog_lists_cmp_line
(
ctx
);
ctx
->
current_new
++
;
}
if
(
announce
)
{
printf
(
"Newlist
\n
"
);
for
(
i
=
0
;
i
<
ctx
->
new_list_count
;
i
++
)
{
newlist_ptr
=
ctx
->
new_list
+
i
;
printf
(
"%40s %d
\n
"
,
newlist_ptr
->
line
,
newlist_ptr
->
cmp_index
);
}
printf
(
"Oldlist
\n
"
);
for
(
i
=
0
;
i
<
ctx
->
old_list_count
;
i
++
)
{
oldlist_ptr
=
ctx
->
old_list
+
i
;
printf
(
"%40s %d
\n
"
,
oldlist_ptr
->
line
,
oldlist_ptr
->
cmp_index
);
}
}
/* Start Output */
ctx
->
current_old
=
0
;
for
(
i
=
0
;
i
<
ctx
->
new_list_count
;
i
++
)
{
newlist_ptr
=
ctx
->
new_list
+
i
;
if
(
newlist_ptr
->
cmp_index
==
-
1
)
{
next_new
=
0
;
while
(
!
next_new
)
{
/* Check if anything in oldlist should be written */
for
(
j
=
ctx
->
current_old
;
j
<
ctx
->
old_list_count
;
j
++
)
{
oldlist_ptr
=
ctx
->
old_list
+
j
;
if
(
oldlist_ptr
->
cmp_index
==
-
1
)
{
if
(
j
==
0
&&
i
==
0
)
{
next_new
=
1
;
tlog_lists_cmp_printboth
(
ctx
,
i
,
j
,
&
newlines
,
&
oldlines
);
i
+=
newlines
-
1
;
j
+=
oldlines
;
ctx
->
current_old
=
j
;
}
else
if
(
i
==
0
)
{
/* Print newlist */
tlog_lists_cmp_printnew
(
ctx
,
i
,
&
lines
);
i
+=
lines
-
1
;
next_new
=
1
;
}
else
if
(
j
==
0
)
{
/* Print oldlist */
tlog_lists_cmp_printold
(
ctx
,
j
,
&
lines
);
j
+=
lines
;
ctx
->
current_old
=
j
;
}
else
{
/* Compare the index of the previous old */
oldlist_ptr
--
;
if
(
oldlist_ptr
->
cmp_index
<
i
-
1
)
{
/* Print old */
tlog_lists_cmp_printold
(
ctx
,
j
,
&
lines
);
j
+=
lines
;
ctx
->
current_old
=
j
;
next_new
=
0
;
}
else
if
(
oldlist_ptr
->
cmp_index
>
i
-
1
)
{
/* Print new */
tlog_lists_cmp_printnew
(
ctx
,
i
,
&
lines
);
i
+=
lines
-
1
;
next_new
=
1
;
}
else
{
/* Equal, print both */
next_new
=
1
;
tlog_lists_cmp_printboth
(
ctx
,
i
,
j
,
&
newlines
,
&
oldlines
);
i
+=
newlines
-
1
;
j
+=
oldlines
;
ctx
->
current_old
=
j
;
}
}
break
;
}
}
if
(
j
==
ctx
->
old_list_count
)
{
tlog_lists_cmp_printnew
(
ctx
,
i
,
&
lines
);
i
+=
lines
-
1
;
next_new
=
1
;
}
}
}
}
for
(
j
=
ctx
->
current_old
;
j
<
ctx
->
old_list_count
;
j
++
)
{
oldlist_ptr
=
ctx
->
old_list
+
j
;
if
(
oldlist_ptr
->
cmp_index
==
-
1
)
{
if
(
j
==
0
)
{
/* Print oldlist */
tlog_lists_cmp_printold
(
ctx
,
j
,
&
lines
);
ctx
->
current_old
+=
lines
;
j
+=
lines
;
}
else
{
/* Print old */
tlog_lists_cmp_printold
(
ctx
,
j
,
&
lines
);
ctx
->
current_old
=
j
+
lines
;
j
+=
lines
;
next_new
=
0
;
}
}
}
if
(
ctx
->
diff_found
)
{
tlog_lists_cmp_printparseline
(
ctx
);
if
(
ctx
->
outfile
)
fprintf
(
ctx
->
outfile
,
"%d differences found
\n
"
,
ctx
->
diff_found
);
else
printf
(
"%d differences found
\n
"
,
ctx
->
diff_found
);
}
else
{
if
(
ctx
->
outfile
)
fprintf
(
ctx
->
outfile
,
"No differences found
\n
"
,
ctx
->
diff_found
);
else
printf
(
"No differences found
\n
"
,
ctx
->
diff_found
);
}
return
TLOG__SUCCESS
;
}
/*************************************************************************
*
* Name: tlog_read_line()
*
* Type void
*
* Type Parameter IOGF Description
*
* Description:
* Read a line in a file.
*
**************************************************************************/
static
int
tlog_read_line
(
char
*
line
,
int
maxsize
,
FILE
*
file
)
{
char
*
s
;
if
(
fgets
(
line
,
maxsize
,
file
)
==
NULL
)
return
0
;
s
=
strchr
(
line
,
10
);
if
(
s
!=
0
)
*
s
=
0
;
return
TLOG__SUCCESS
;
}
/*************************************************************************
*
* Name: tlog_line_add()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
* Allocate memory and insert a new line in the list.
*
**************************************************************************/
static
pwr_tStatus
tlog_line_add
(
pwr_tString132
*
line
,
tlog_t_linelist
**
list
,
int
*
list_count
,
int
*
alloc
,
int
line_nr
)
{
tlog_t_linelist
*
list_ptr
;
tlog_t_linelist
*
new_list
;
char
time_str
[
20
];
char
type_str
[
10
];
int
sts
;
if
(
*
list_count
==
0
)
{
*
list
=
calloc
(
TLOG_LINEALLOC
,
sizeof
(
tlog_t_linelist
));
if
(
*
list
==
0
)
return
TLOG__NOMEMORY
;
*
alloc
=
TLOG_LINEALLOC
;
}
else
if
(
*
alloc
<=
*
list_count
)
{
new_list
=
calloc
(
*
alloc
+
TLOG_LINEALLOC
,
sizeof
(
tlog_t_linelist
));
if
(
new_list
==
0
)
return
TLOG__NOMEMORY
;
memcpy
(
new_list
,
*
list
,
*
list_count
*
sizeof
(
tlog_t_linelist
));
free
(
*
list
);
*
list
=
new_list
;
(
*
alloc
)
+=
TLOG_LINEALLOC
;
}
list_ptr
=
*
list
+
*
list_count
;
/* Convert the time */
strncpy
(
time_str
,
(
char
*
)
line
,
11
);
time_str
[
11
]
=
0
;
sts
=
time_AsciiToD
(
time_str
,
&
list_ptr
->
time
);
/* Get the type */
strncpy
(
type_str
,
(
char
*
)
line
+
TLOG_LINE_TYPE
,
2
);
type_str
[
2
]
=
0
;
if
(
!
strcmp
(
type_str
,
"Du"
))
list_ptr
->
logtype
=
tlog_logtype_DtLogUp
;
else
if
(
!
strcmp
(
type_str
,
"Dd"
))
list_ptr
->
logtype
=
tlog_logtype_DtLogDown
;
else
if
(
!
strcmp
(
type_str
,
"Du"
))
list_ptr
->
logtype
=
tlog_logtype_DtLogUp
;
else
if
(
!
strcmp
(
type_str
,
"Au"
))
list_ptr
->
logtype
=
tlog_logtype_AtLogUp
;
else
if
(
!
strcmp
(
type_str
,
"Ad"
))
list_ptr
->
logtype
=
tlog_logtype_AtLogDown
;
else
if
(
!
strcmp
(
type_str
,
"Mi"
))
list_ptr
->
logtype
=
tlog_logtype_Info
;
else
if
(
!
strcmp
(
type_str
,
"Ma"
))
list_ptr
->
logtype
=
tlog_logtype_AlarmA
;
else
if
(
!
strcmp
(
type_str
,
"Mb"
))
list_ptr
->
logtype
=
tlog_logtype_AlarmB
;
else
if
(
!
strcmp
(
type_str
,
"Mc"
))
list_ptr
->
logtype
=
tlog_logtype_AlarmC
;
else
if
(
!
strcmp
(
type_str
,
"Md"
))
list_ptr
->
logtype
=
tlog_logtype_AlarmD
;
else
if
(
!
strcmp
(
type_str
,
"Sl"
))
list_ptr
->
logtype
=
tlog_logtype_Modify
;
else
if
(
!
strcmp
(
type_str
,
"Fc"
))
list_ptr
->
logtype
=
tlog_logtype_Close
;
else
if
(
!
strcmp
(
type_str
,
"Ca"
))
list_ptr
->
logtype
=
tlog_logtype_CAtLog
;
else
if
(
!
strcmp
(
type_str
,
"Cd"
))
list_ptr
->
logtype
=
tlog_logtype_CDtLog
;
else
if
(
!
strcmp
(
type_str
,
"Co"
))
list_ptr
->
logtype
=
tlog_logtype_COtLog
;
else
if
(
!
strcmp
(
type_str
,
"Ex"
))
list_ptr
->
logtype
=
tlog_logtype_ExecOn
;
list_ptr
->
line_nr
=
line_nr
;
strcpy
(
list_ptr
->
line
,
(
char
*
)
line
);
(
*
list_count
)
++
;
return
TLOG__SUCCESS
;
}
/*************************************************************************
*
* Name: tlog_insert_file()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
* Read a file and insert it into a list.
*
**************************************************************************/
static
pwr_tStatus
tlog_insert_file
(
char
*
filename
,
tlog_t_linelist
**
list
,
int
*
list_count
,
char
*
full_filename
)
{
int
sts
;
int
alloc
=
0
;
FILE
*
infile
;
pwr_tString132
line
;
int
line_nr
;
/* Open the infile */
infile
=
fopen
(
filename
,
"r"
);
if
(
!
infile
)
return
TLOG__FILEOPEN
;
line_nr
=
0
;
while
(
1
)
{
/* Read next line */
sts
=
tlog_read_line
(
line
,
sizeof
(
line
),
infile
);
if
(
EVEN
(
sts
))
break
;
line_nr
++
;
/* The two first line are comments */
if
(
line_nr
>
2
)
{
sts
=
tlog_line_add
(
(
pwr_tString132
*
)
line
,
list
,
list_count
,
&
alloc
,
line_nr
);
if
(
EVEN
(
sts
))
return
sts
;
}
}
fgetname
(
infile
,
full_filename
);
fclose
(
infile
);
return
TLOG__SUCCESS
;
}
/*************************************************************************
*
* Name: tlog_qual_to_time()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
* Convert a commandline input time to pwr-time.
*
**************************************************************************/
static
pwr_tStatus
tlog_qual_to_time
(
char
*
in_str
,
pwr_tTime
*
time
)
{
pwr_tStatus
sts
;
char
*
s
;
pwr_tDeltaTime
one_day_time
;
pwr_tTime
current_time
;
char
str
[
64
];
char
timstr
[
64
];
if
(
!
strcmp
(
in_str
,
""
)
||
!
strncmp
(
in_str
,
"TODAY"
,
strlen
(
in_str
)))
{
clock_gettime
(
CLOCK_REALTIME
,
&
current_time
);
time_AtoAscii
(
&
current_time
,
time_eFormat_DateAndTime
,
timstr
,
sizeof
(
timstr
));
timstr
[
12
]
=
0
;
strcat
(
timstr
,
" 00:00:00.00"
);
sts
=
time_AsciiToA
(
timstr
,
time
);
}
else
if
(
!
strncmp
(
in_str
,
"YESTERDAY"
,
strlen
(
in_str
)))
{
clock_gettime
(
CLOCK_REALTIME
,
&
current_time
);
time_AtoAscii
(
&
current_time
,
time_eFormat_DateAndTime
,
timstr
,
sizeof
(
timstr
));
timstr
[
12
]
=
0
;
strcat
(
timstr
,
" 00:00:00.00"
);
sts
=
time_AsciiToA
(
timstr
,
&
current_time
);
strcpy
(
timstr
,
"1 00:00:00"
);
sts
=
time_AsciiToD
(
timstr
,
&
one_day_time
);
time_Dneg
(
&
one_day_time
,
&
one_day_time
);
time_Aadd
(
time
,
&
current_time
,
&
one_day_time
);
}
else
{
strcpy
(
str
,
in_str
);
if
(
s
=
strchr
(
str
,
'-'
))
{
/* Date is supplied, replace ':' to space */
if
(
s
=
strchr
(
str
,
':'
))
*
s
=
' '
;
strcpy
(
timstr
,
str
);
}
else
{
/* No date is supplied, add current date as default */
clock_gettime
(
CLOCK_REALTIME
,
&
current_time
);
time_AtoAscii
(
&
current_time
,
time_eFormat_DateAndTime
,
timstr
,
sizeof
(
timstr
));
timstr
[
12
]
=
0
;
strcat
(
timstr
,
" "
);
strcat
(
timstr
,
str
);
}
sts
=
time_AsciiToA
(
timstr
,
time
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
TLOG__SUCCESS
;
}
/*************************************************************************
*
* Name: tlog_diff()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
* Examine the differens between the last and an old tlogfile.
*
**************************************************************************/
pwr_tStatus
tlog_diff
(
char
*
filestr
,
char
*
output
,
char
*
timestr
,
int
parallell
,
int
attribute
,
int
text
,
int
ttext
,
int
noorder
,
int
exact
,
char
*
since_str
,
char
*
before_str
)
{
char
saved_filename
[
80
];
char
filename
[
80
];
FILE
*
outfile
;
int
sts
;
tlog_t_linelist
*
new_list
;
tlog_t_linelist
*
old_list
;
int
new_list_count
;
int
old_list_count
;
float
time
;
int
nr
;
diff_ctx
ctx
;
char
modulestr
[
80
];
char
cmd
[
100
];
char
new_filename
[
80
];
char
old_filename
[
80
];
char
wild_filename
[
80
];
char
dev
[
80
];
char
dir
[
80
];
char
file
[
80
];
char
type
[
80
];
int
version
;
int
first
;
pwr_tTime
file_time
;
int
file_size
;
int
file_version
;
pwr_tTime
before_time
;
pwr_tTime
since_time
;
int
diff_count
;
unsigned
long
search_ctx
;
tlog_get_defaultfilename
(
filestr
,
wild_filename
,
".tlog"
,
"pwrp_tlog:"
);
diff_count
=
0
;
first
=
1
;
for
(;;)
{
if
(
first
)
{
/* Get the first file */
search_ctx
=
0
;
sts
=
dir_search_file
(
&
search_ctx
,
wild_filename
,
filename
);
if
(
EVEN
(
sts
))
return
sts
;
/* At least one file is found */
if
(
output
!=
NULL
)
{
/* Open the output file */
outfile
=
fopen
(
output
,
"w"
);
if
(
!
outfile
)
return
TLOG__FILEOPEN
;
}
else
outfile
=
0
;
if
(
timestr
!=
NULL
)
{
/* Convert to float */
nr
=
sscanf
(
timestr
,
"%f"
,
&
time
);
if
(
nr
!=
1
)
return
TLOG__TIMESYNTAX
;
}
else
time
=
0
.
5
;
if
(
before_str
!=
NULL
)
{
sts
=
tlog_qual_to_time
(
before_str
,
&
before_time
);
if
(
EVEN
(
sts
))
return
TLOG__BEFOREQUAL
;
}
if
(
since_str
!=
NULL
)
{
sts
=
tlog_qual_to_time
(
since_str
,
&
since_time
);
if
(
EVEN
(
sts
))
return
TLOG__SINCEQUAL
;
}
first
=
0
;
}
else
{
/* Get the next file */
sts
=
dir_search_file
(
&
search_ctx
,
wild_filename
,
filename
);
if
(
EVEN
(
sts
))
break
;
/* fprintf( outfile, ""); */
}
sts
=
dir_get_fileinfo
(
filename
,
(
pwr_tTime
*
)
&
file_time
,
&
file_size
,
&
file_version
,
NULL
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
since_str
!=
NULL
)
{
if
(
time_Acomp
(
&
file_time
,
&
since_time
)
<
0
)
continue
;
}
if
(
before_str
!=
NULL
)
{
if
(
time_Acomp
(
&
file_time
,
&
before_time
)
>
0
)
continue
;
}
sts
=
dir_parse_filename
(
filename
,
dev
,
dir
,
file
,
type
,
&
version
);
strcpy
(
saved_filename
,
"pwrp_stlog:"
);
strcat
(
saved_filename
,
file
);
strcat
(
saved_filename
,
type
);
/* Read the new file */
new_list_count
=
0
;
sts
=
tlog_insert_file
(
filename
,
&
new_list
,
&
new_list_count
,
new_filename
);
if
(
EVEN
(
sts
))
{
if
(
outfile
)
{
fprintf
(
outfile
,
"
\n\n\n
New file: %s
\n
"
,
new_filename
);
fprintf
(
outfile
,
"%%TLOG-E-NEWOPEN, Unable to open new file
\n
"
);
}
else
{
printf
(
"
\n\n\n
New file: %s
\n
"
,
new_filename
);
printf
(
"%%TLOG-E-NEWOPEN, Unable to open new file
\n
"
);
}
continue
;
}
if
(
outfile
)
fprintf
(
outfile
,
"
\n\n\n
New file: %s
\n
"
,
new_filename
);
else
printf
(
"
\n\n\n
New file: %s
\n
"
,
new_filename
);
/* Read the old file */
old_list_count
=
0
;
sts
=
tlog_insert_file
(
saved_filename
,
&
old_list
,
&
old_list_count
,
old_filename
);
if
(
EVEN
(
sts
))
{
if
(
outfile
)
{
fprintf
(
outfile
,
"Old file: %s
\n
"
,
old_filename
);
fprintf
(
outfile
,
"%%TLOG-E-OLDOPEN, Unable to open old file
\n
"
);
}
else
{
printf
(
"Old file: %s
\n
"
,
old_filename
);
printf
(
"%%TLOG-E-OLDOPEN, Unable to open old file
\n
"
);
}
free
(
new_list
);
continue
;
}
if
(
outfile
)
fprintf
(
outfile
,
"Old file: %s
\n
"
,
old_filename
);
else
printf
(
"Old file: %s
\n
"
,
old_filename
);
ctx
=
calloc
(
1
,
sizeof
(
*
ctx
));
ctx
->
max_difftime
=
time
;
ctx
->
new_list
=
new_list
;
ctx
->
old_list
=
old_list
;
ctx
->
old_list_count
=
old_list_count
;
ctx
->
new_list_count
=
new_list_count
;
ctx
->
outfile
=
outfile
;
ctx
->
parallell
=
parallell
;
ctx
->
attribute
=
attribute
;
ctx
->
text
=
text
;
ctx
->
ttext
=
ttext
;
ctx
->
noorder
=
noorder
;
ctx
->
exact
=
exact
;
strcpy
(
ctx
->
new_filename
,
new_filename
);
strcpy
(
ctx
->
old_filename
,
old_filename
);
sts
=
tlog_lists_cmp
(
ctx
);
if
(
EVEN
(
sts
))
return
sts
;
diff_count
++
;
free
(
new_list
);
free
(
old_list
);
free
(
ctx
);
}
if
(
outfile
)
fclose
(
outfile
);
sts
=
dir_search_file_end
(
&
search_ctx
);
if
(
diff_count
==
0
)
if
(
outfile
)
fprintf
(
outfile
,
"No files found
\n
"
);
else
printf
(
"No files found
\n
"
);
return
TLOG__SUCCESS
;
}
/*************************************************************************
*
* Name: tlog_save
*
* Typ int
*
* Typ Parameter IOGF Beskrivning
*
* Beskrivning:
* Save the tlog file in library
*
**************************************************************************/
int
tlog_save
(
char
*
filestr
)
{
char
cmd
[
100
];
char
filename
[
80
];
int
sts
;
char
saved_filename
[
80
];
char
wild_filename
[
80
];
char
dev
[
80
];
char
dir
[
80
];
char
file
[
80
];
char
type
[
80
];
int
version
;
int
first
;
char
*
s
;
unsigned
long
search_ctx
;
tlog_get_defaultfilename
(
filestr
,
wild_filename
,
".tlog"
,
"pwrp_tlog:"
);
first
=
1
;
for
(;;)
{
if
(
first
)
{
/* Get the first file */
search_ctx
=
0
;
sts
=
dir_search_file
(
&
search_ctx
,
wild_filename
,
filename
);
if
(
EVEN
(
sts
))
return
sts
;
first
=
0
;
}
else
{
/* Get the next file */
sts
=
dir_search_file
(
&
search_ctx
,
wild_filename
,
filename
);
if
(
EVEN
(
sts
))
break
;
}
sts
=
dir_parse_filename
(
filename
,
dev
,
dir
,
file
,
type
,
&
version
);
strcpy
(
saved_filename
,
"pwrp_stlog:"
);
strcat
(
saved_filename
,
file
);
strcat
(
saved_filename
,
type
);
if
(
s
=
strrchr
(
filename
,
';'
))
*
s
=
0
;
sprintf
(
cmd
,
"copy/log %s %s"
,
filename
,
saved_filename
);
sts
=
system
(
cmd
);
if
(
EVEN
(
sts
))
return
sts
;
}
dir_search_file_end
(
&
search_ctx
);
return
TLOG__SUCCESS
;
}
#ifdef TLOG_TEST
/*************************************************************************
*
* Name: main()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
* Main program of rs_tlog_diff.
*
**************************************************************************/
main
(
int
argc
,
char
*
argv
[])
{
char
filename
[
80
];
char
outputname
[
80
];
char
*
output_ptr
;
char
timestr
[
80
];
char
*
timestr_ptr
;
int
sts
;
int
parallell
=
1
;
int
attribute
=
0
;
int
text
=
0
;
int
ttext
=
0
;
int
order
=
0
;
/* Filename in first argument */
if
(
argc
>=
2
)
{
strcpy
(
filename
,
argv
[
1
]);
if
(
argc
>=
3
)
{
strcpy
(
timestr
,
argv
[
2
]);
timestr_ptr
=
&
timestr
;
if
(
argc
>=
4
)
{
strcpy
(
outputname
,
argv
[
3
]);
output_ptr
=
&
outputname
;
}
else
output_ptr
=
NULL
;
}
else
timestr_ptr
=
NULL
;
}
else
printf
(
"Usage: 'filename' 'output'
\n
"
);
sts
=
tlog_diff
(
filename
,
output_ptr
,
timestr_ptr
,
parallell
,
attribute
,
text
,
ttext
,
order
);
exit
(
sts
);
}
#endif
tlog/exe/rs_tlog_diff/src/tlog_diff.h
0 → 100644
View file @
16ebc80d
/*
* Proview $Id: tlog_diff.h,v 1.1 2006-01-10 14:38:36 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund 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.
*/
/************************************************************************
*
* Filename: rs_tlog_diff.h
* Date Pgm. Read. Remark
* Modified 950914 CS Initial creation
*
* Description:
* Include file for Test Logging difference function.
*
**************************************************************************/
pwr_tStatus
tlog_diff
(
char
*
filename
,
char
*
output
,
char
*
timestr
,
int
parallell
,
int
attribute
,
int
text
,
int
ttext
,
int
noorder
,
int
exact
,
char
*
since_str
,
char
*
before_str
);
int
tlog_save
(
char
*
filename
);
tlog/wbl/tlog/src/os_linux/hw_x86/makefile
0 → 100644
View file @
16ebc80d
# makefile -- <short description>
#
# PROVIEW/R
# Copyright (C) 1996 by Comator Process AB.
#
# <Description>.
#
include
$(pwre_dir_symbols)
ifndef
variables_mk
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/variables.mk
endif
ifndef
variables_mk
include
$(pwre_kroot)/tools/bld/src/$(os_name)/variables.mk
endif
ifndef
rules_mk
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk
endif
ifndef
rules_mk
include
$(pwre_kroot)/tools/bld/src/$(os_name)/rules.mk
endif
.PHONY
:
all init copy lib exe clean realclean
\
$(clean_wbl)
all
:
init copy exe
init
:
copy
:
$(inc_dir)/pwr_tlogclasses.h
\
$(inc_dir)/pwr_tlogclasses.hpp
lib
:
$(load_dir)/tlog.dbs
exe
:
$(doc_dir)/en_us/orm/tlog_allclasses.html
\
$(exe_dir)/tlog_xtthelp.dat
clean
:
realclean
:
clean $(clean_wbl)
$(load_dir)/tlog.dbs
:
@
echo
"Generating loadfile for tlog"
@
export
pwr_load
=
$(pwr_eload)
;
\
wb_cmd
-q
-i
create snapshot /file
=
\"
$(pwre_sroot)
/wbl/tlog/src/
\"
/out
=
\"
$(target)
\"
@
chmod
a+w
$(target)
$(inc_dir)/pwr_tlogclasses.h
:
@
echo
"Generating struct files for tlog classes..."
@
co_convert
-s
-d
$(inc_dir)
"
$(pwre_sroot)
/wbl/tlog/src/tlog_c_*.wb_load"
$(inc_dir)/pwr_tlogclasses.hpp
:
@
echo
"Generating hpp files for tlog classes..."
@
co_convert
-po
-d
$(inc_dir)
"
$(pwre_sroot)
/wbl/tlog/src/tlog_c_*.wb_load"
$(doc_dir)/en_us/orm/tlog_allclasses.html
:
@
echo
"Generating html files for tlog classes en_us..."
@
co_convert
-w
-d
$(doc_dir)
/en_us/orm
"
$(pwre_sroot)
/wbl/tlog/src/tlog_c_*.wb_load"
@
echo
"Generating html files for tlog structs en_us..."
@
co_convert
-c
-d
$(doc_dir)
/en_us/orm
$(inc_dir)
/pwr_tlogclasses.h
@
echo
"Generating html files for tlog code en_us..."
@
co_convert
-c
-d
$(doc_dir)
/en_us/orm
"
$(pwre_sroot)
/lib/rs/src/rs_plc_macro_tlog.h"
@
co_convert
-c
-d
$(doc_dir)
/en_us/orm
"
$(pwre_sroot)
/lib/rs/src/rs_plc_tlog*.c"
@
echo
"Generating html files for tlog classes sv_se..."
@
co_convert
-w
-l
sv_se
-d
$(doc_dir)
/sv_se/orm
"
$(pwre_sroot)
/wbl/tlog/src/tlog_c_*.wb_load"
@
echo
"Generating html files for tlog structs sv_se..."
@
co_convert
-c
-d
$(doc_dir)
/sv_se/orm
$(inc_dir)
/pwr_tlogclasses.h
@
echo
"Generating html files for tlog code sv_se..."
@
co_convert
-c
-d
$(doc_dir)
/sv_se/orm
"
$(pwre_sroot)
/lib/rs/src/rs_plc_macro_tlog.h"
@
co_convert
-c
-d
$(doc_dir)
/sv_se/orm
"
$(pwre_sroot)
/lib/rs/src/rs_plc_tlog*.c"
@
echo
"Generating postscript file for tlog classes..."
@
co_convert
-q
-d
$(doc_dir)
/en_us
"
$(pwre_sroot)
/wbl/tlog/src/tlog_*.wb_load"
$(exe_dir)/tlog_xtthelp.dat
:
@
echo
"Generating xtt help files for tlog classes"
@
co_convert
-x
-d
$(exe_dir)
"
$(pwre_sroot)
/wbl/tlog/src/tlog_c_*.wb_load"
clean_wbl
:
@
if
[
-e
$(load_dir)
/tlog.dbs
]
;
then
\
$(rm)
$(rmflags)
$(load_dir)
/tlog.dbs
;
\
fi
tlog/wbl/tlog/src/tlog_c_atlog.wb_load
0 → 100644
View file @
16ebc80d
!
! Proview $Id: tlog_c_atlog.wb_load,v 1.1 2006-01-10 14:38:36 claes Exp $
! 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.
!
! tlog_c_AtLog.wb_load -- Defines the class AtLog.
!
SObject TLog:Class
Object AtLog $ClassDef 1
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_RtConnectionsAndDevBodies
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "AtLog"
EndBody
Object In $Input 1
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object InOld $Intern 2
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object Limit $Intern 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object UpSignal $Intern 4
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object DownSignal $Intern 5
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object UpTime $Intern 6
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Time"
EndBody
EndObject
Object DownTime $Intern 7
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Time"
EndBody
EndObject
Object UpText $Intern 8
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
Attr NiNaAnnot = 2
Attr NiNaCond = 1
EndBody
EndObject
Object DownText $Intern 9
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
Object Attribute $Intern 10
Body SysBody
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object ShowUpText $Intern 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object PlcNode $Buffer 2
Body SysBody
Attr Class = pwr_eClass_PlcNode
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
Object GraphPlcNode $GraphPlcNode
Body SysBody
Attr object_type = 111
Attr parameters[0] = 1
Attr parameters[1] = 0
Attr parameters[2] = 0
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 7
Attr graphindex = 1
Attr default_mask[0] = 1
Attr default_mask[1] = 0
Attr segname_annotation = 1
Attr rtbody_annotation = 1
Attr compmethod = 47
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr objname = "AtLog"
Attr graphname = "AtLog"
Attr debugpar = ""
EndBody
EndObject
!
! Template object
!
Object Template AtLog
Body DevBody
Attr ShowUpText = 0
EndBody
EndObject
EndObject
EndSObject
tlog/wbl/tlog/src/tlog_c_catlog.wb_load
0 → 100644
View file @
16ebc80d
!
! Proview $Id: tlog_c_catlog.wb_load,v 1.1 2006-01-10 14:38:36 claes Exp $
! 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.
!
! tlog_c_CAtLog.wb_load -- Defines the class CAtLog.
!
SObject TLog:Class
Object CAtLog $ClassDef 3
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_RtConnectionsAndDevBodies
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "CAtLog"
EndBody
Object In $Input 1
Body SysBody
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object Cond $Input 2
Body SysBody
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "con"
EndBody
EndObject
Object CondOld $Intern 3
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object LogSignal $Intern 4
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object LogTime $Intern 5
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Time"
EndBody
EndObject
Object LogText $Intern 6
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
Attr NiNaAnnot = 2
Attr NiNaCond = 1
EndBody
EndObject
Object Attribute $Intern 7
Body SysBody
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
Object LogValue $Intern 8
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object ShowLogText $Intern 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object PlcNode $Buffer 2
Body SysBody
Attr Class = pwr_eClass_PlcNode
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
Object GraphPlcNode $GraphPlcNode
Body SysBody
Attr object_type = 107
Attr parameters[0] = 2
Attr parameters[1] = 0
Attr parameters[2] = 0
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 15
Attr graphindex = 1
Attr default_mask[0] = 3
Attr default_mask[1] = 0
Attr segname_annotation = 1
Attr rtbody_annotation = 1
Attr compmethod = 47
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr objname = "CAtLog"
Attr graphname = "CAtLog"
Attr debugpar = ""
EndBody
EndObject
!
! Template object
!
Object Template CAtLog
Body DevBody
Attr ShowLogText = 0
EndBody
EndObject
EndObject
EndSObject
tlog/wbl/tlog/src/tlog_c_cdtlog.wb_load
0 → 100644
View file @
16ebc80d
!
! Proview $Id: tlog_c_cdtlog.wb_load,v 1.1 2006-01-10 14:38:36 claes Exp $
! 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.
!
! tlog_c_CDtLog.wb_load -- Defines the class CDtLog.
!
SObject TLog:Class
Object CDtLog $ClassDef 5
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_RtConnectionsAndDevBodies
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "CDtLog"
EndBody
Object In $Input 1
Body SysBody
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object Cond $Input 2
Body SysBody
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "con"
EndBody
EndObject
Object CondOld $Intern 3
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object LogSignal $Intern 4
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object LogTime $Intern 5
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Time"
EndBody
EndObject
Object LogText $Intern 6
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
Attr NiNaAnnot = 2
Attr NiNaCond = 1
EndBody
EndObject
Object Attribute $Intern 7
Body SysBody
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
Object LogValue $Intern 8
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object ShowLogText $Intern 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object PlcNode $Buffer 2
Body SysBody
Attr Class = pwr_eClass_PlcNode
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
Object GraphPlcNode $GraphPlcNode
Body SysBody
Attr object_type = 108
Attr parameters[0] = 2
Attr parameters[1] = 0
Attr parameters[2] = 0
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 15
Attr graphindex = 1
Attr default_mask[0] = 3
Attr default_mask[1] = 0
Attr segname_annotation = 1
Attr rtbody_annotation = 1
Attr compmethod = 47
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr objname = "CDtLog"
Attr graphname = "CDtLog"
Attr debugpar = ""
EndBody
EndObject
!
! Template object
!
Object Template CDtLog
Body DevBody
Attr ShowLogText = 1
EndBody
EndObject
EndObject
EndSObject
tlog/wbl/tlog/src/tlog_c_chgatlog.wb_load
0 → 100644
View file @
16ebc80d
!
! Proview $Id: tlog_c_chgatlog.wb_load,v 1.1 2006-01-10 14:38:36 claes Exp $
! 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.
!
! tlog_c_ChgAtLog.wb_load -- Defines the class ChgAtLog.
!
SObject TLog:Class
Object ChgAtLog $ClassDef 7
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_RtConnectionsAndDevBodies
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "ChgAtLog"
EndBody
Object In $Input 1
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object InOld $Intern 2
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object LogSignal $Intern 3
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object LogTime $Intern 4
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Time"
EndBody
EndObject
Object LogText $Intern 5
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
Attr NiNaAnnot = 2
Attr NiNaCond = 1
EndBody
EndObject
Object LogValue $Intern 6
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object Attribute $Intern 7
Body SysBody
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object ShowLogText $Intern 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object PlcNode $Buffer 2
Body SysBody
Attr Class = pwr_eClass_PlcNode
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
Object GraphPlcNode $GraphPlcNode
Body SysBody
Attr object_type = 11
Attr parameters[0] = 1
Attr parameters[1] = 0
Attr parameters[2] = 0
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 7
Attr graphindex = 1
Attr default_mask[0] = 1
Attr default_mask[1] = 0
Attr segname_annotation = 1
Attr rtbody_annotation = 1
Attr compmethod = 47
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr objname = "ChgAtLog"
Attr graphname = "ChgAtLog"
Attr debugpar = ""
EndBody
EndObject
!
! Template object
!
Object Template ChgAtLog
Body DevBody
Attr ShowLogText = 0
EndBody
EndObject
EndObject
EndSObject
tlog/wbl/tlog/src/tlog_c_chgotlog.wb_load
0 → 100644
View file @
16ebc80d
!
! Proview $Id: tlog_c_chgotlog.wb_load,v 1.1 2006-01-10 14:38:36 claes Exp $
! 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.
!
! tlog_c_ChgOtLog.wb_load -- Defines the class ChgOtLog.
!
SObject TLog:Class
Object ChgOtLog $ClassDef 9
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_RtConnectionsAndDevBodies
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "ChgOtLog"
EndBody
Object In $Input 1
Body SysBody
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
Object InOld $Intern 2
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
Object LogSignal $Intern 3
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object LogTime $Intern 4
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Time"
EndBody
EndObject
Object LogText $Intern 5
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
Attr NiNaAnnot = 2
Attr NiNaCond = 1
EndBody
EndObject
Object Attribute $Intern 6
Body SysBody
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
Object LogValue $Intern 7
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object ShowLogText $Intern 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object PlcNode $Buffer 2
Body SysBody
Attr Class = pwr_eClass_PlcNode
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
Object GraphPlcNode $GraphPlcNode
Body SysBody
Attr object_type = 11
Attr parameters[0] = 1
Attr parameters[1] = 0
Attr parameters[2] = 0
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 7
Attr graphindex = 1
Attr default_mask[0] = 1
Attr default_mask[1] = 0
Attr segname_annotation = 1
Attr rtbody_annotation = 1
Attr compmethod = 47
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr objname = "ChgOtLog"
Attr graphname = "ChgOtLog"
Attr debugpar = ""
EndBody
EndObject
!
! Template object
!
Object Template ChgOtLog
Body DevBody
Attr ShowLogText = 0
EndBody
EndObject
EndObject
EndSObject
tlog/wbl/tlog/src/tlog_c_cotlog.wb_load
0 → 100644
View file @
16ebc80d
!
! Proview $Id: tlog_c_cotlog.wb_load,v 1.1 2006-01-10 14:38:36 claes Exp $
! 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.
!
! tlog_c_COtLog.wb_load -- Defines the class COtLog.
!
SObject TLog:Class
Object COtLog $ClassDef 11
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_RtConnectionsAndDevBodies
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "COtLog"
EndBody
Object In $Input 1
Body SysBody
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
Object Cond $Input 2
Body SysBody
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "con"
EndBody
EndObject
Object CondOld $Intern 3
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object LogSignal $Intern 4
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object LogTime $Intern 5
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Time"
EndBody
EndObject
Object LogText $Intern 6
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
Attr NiNaAnnot = 2
Attr NiNaCond = 1
EndBody
EndObject
Object Attribute $Intern 7
Body SysBody
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
Object LogValue $Intern 8
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object ShowLogText $Intern 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object PlcNode $Buffer 2
Body SysBody
Attr Class = pwr_eClass_PlcNode
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
Object GraphPlcNode $GraphPlcNode
Body SysBody
Attr object_type = 106
Attr parameters[0] = 2
Attr parameters[1] = 0
Attr parameters[2] = 0
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 15
Attr graphindex = 1
Attr default_mask[0] = 3
Attr default_mask[1] = 0
Attr segname_annotation = 1
Attr rtbody_annotation = 1
Attr compmethod = 47
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr objname = "COtLog"
Attr graphname = "COtLog"
Attr debugpar = ""
EndBody
EndObject
!
! Template object
!
Object Template COtLog
Body DevBody
Attr ShowLogText = 0
EndBody
EndObject
EndObject
EndSObject
tlog/wbl/tlog/src/tlog_c_dtlog.wb_load
0 → 100644
View file @
16ebc80d
!
! Proview $Id: tlog_c_dtlog.wb_load,v 1.1 2006-01-10 14:38:36 claes Exp $
! 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.
!
! tlog_c_DtLog.wb_load -- Defines the class DtLog.
!
SObject TLog:Class
Object DtLog $ClassDef 13
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_RtConnectionsAndDevBodies
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "DtLog"
EndBody
Object In $Input 1
Body SysBody
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object InOld $Intern 2
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object UpSignal $Intern 3
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object DownSignal $Intern 4
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object UpTime $Intern 5
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Time"
EndBody
EndObject
Object DownTime $Intern 6
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Time"
EndBody
EndObject
Object UpText $Intern 7
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
Attr NiNaAnnot = 2
Attr NiNaCond = 1
EndBody
EndObject
Object DownText $Intern 8
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
Object Attribute $Intern 9
Body SysBody
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object ShowUpText $Intern 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object PlcNode $Buffer 2
Body SysBody
Attr Class = pwr_eClass_PlcNode
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
Object GraphPlcNode $GraphPlcNode
Body SysBody
Attr object_type = 112
Attr parameters[0] = 1
Attr parameters[1] = 0
Attr parameters[2] = 0
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 7
Attr graphindex = 1
Attr default_mask[0] = 1
Attr default_mask[1] = 0
Attr segname_annotation = 1
Attr rtbody_annotation = 1
Attr compmethod = 47
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr objname = "DtLog"
Attr graphname = "DtLog"
Attr debugpar = ""
EndBody
EndObject
!
! Template object
!
Object Template DtLog
Body DevBody
Attr ShowUpText = 1
EndBody
EndObject
EndObject
EndSObject
tlog/wbl/tlog/src/tlog_c_execplcoff.wb_load
0 → 100644
View file @
16ebc80d
!
! Proview $Id: tlog_c_execplcoff.wb_load,v 1.1 2006-01-10 14:38:36 claes Exp $
! 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.
!
! tlog_c_ExecPlcOff.wb_load -- Defines the class ExecPlcOff.
!
SObject TLog:Class
Object ExecPlcOff $ClassDef 15
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_RtConnectionsAndDevBodies
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "ExecPlcOff"
EndBody
Object In $Input 1
Body SysBody
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object SetOff $Output 2
Body SysBody
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object InOld $Intern 3
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcPgmObject $Intern 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
Attr NiNaAnnot = 1
Attr NiNaSegments = 1
EndBody
EndObject
Object PlcPgmObjectSegments $Intern 2
Body SysBody
Attr TypeRef = "pwrs:Type-$Int32"
EndBody
EndObject
Object PlcNode $Buffer 3
Body SysBody
Attr Class = pwr_eClass_PlcNode
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
Object GraphPlcNode $GraphPlcNode
Body SysBody
Attr object_type = 102
Attr parameters[0] = 1
Attr parameters[1] = 0
Attr parameters[2] = 1
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 7
Attr graphindex = 1
Attr default_mask[0] = 1
Attr default_mask[1] = 0
Attr segname_annotation = 0
Attr devbody_annotation = 1
Attr compmethod = 48
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr objname = "EXPOFF"
Attr graphname = "EXPOFF"
Attr debugpar = ""
EndBody
EndObject
!
! Template object
!
Object Template ExecPlcOff
Body DevBody
Attr PlcPgmObjectSegments = 2
EndBody
EndObject
EndObject
EndSObject
tlog/wbl/tlog/src/tlog_c_execplcon.wb_load
0 → 100644
View file @
16ebc80d
!
! Proview $Id: tlog_c_execplcon.wb_load,v 1.1 2006-01-10 14:38:36 claes Exp $
! 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.
!
! tlog_c_ExecPlcOn.wb_load -- Defines the class ExecPlcOn.
!
SObject TLog:Class
Object ExecPlcOn $ClassDef 17
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_RtConnectionsAndDevBodies
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "ExecPlcOn"
EndBody
Object In $Input 1
Body SysBody
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object SetOn $Output 2
Body SysBody
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object InOld $Intern 3
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcPgmObject $Intern 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
Attr NiNaAnnot = 1
Attr NiNaSegments = 1
EndBody
EndObject
Object PlcPgmObjectSegments $Intern 2
Body SysBody
Attr TypeRef = "pwrs:Type-$Int32"
EndBody
EndObject
Object PlcNode $Buffer 3
Body SysBody
Attr Class = pwr_eClass_PlcNode
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
Object GraphPlcNode $GraphPlcNode
Body SysBody
Attr object_type = 103
Attr parameters[0] = 1
Attr parameters[1] = 0
Attr parameters[2] = 1
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 7
Attr graphindex = 1
Attr default_mask[0] = 1
Attr default_mask[1] = 0
Attr segname_annotation = 0
Attr devbody_annotation = 1
Attr compmethod = 48
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr objname = "EXPON"
Attr graphname = "EXPON"
Attr debugpar = ""
EndBody
EndObject
!
! Template object
!
Object Template ExecPlcOn
Body DevBody
Attr PlcPgmObjectSegments = 2
EndBody
EndObject
EndObject
EndSObject
tlog/wbl/tlog/src/tlog_c_tlogconfigure.wb_load
0 → 100644
View file @
16ebc80d
!
! Proview $Id: tlog_c_tlogconfigure.wb_load,v 1.1 2006-01-10 14:38:36 claes Exp $
! 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.
!
! tlog_c_TLogConfigure.wb_load -- Defines the class TLogConfigure.
!
SObject TLog:Class
Object TLogConfigure $ClassDef 19
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "TLogConfigure"
EndBody
Object TLogDirectory $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
Object UserObject $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
Object On $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object CycleTime $Attribute 4
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object AutoAck $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
EndObject
!
! Template object
!
Object Template TLogConfigure
Body RtBody
Attr TLogDirectory = "pwrp_tlog:"
Attr On = 1
Attr AutoAck = 1
EndBody
EndObject
EndObject
EndSObject
tlog/wbl/tlog/src/tlog_c_tlogexecalloff.wb_load
0 → 100644
View file @
16ebc80d
!
! Proview $Id: tlog_c_tlogexecalloff.wb_load,v 1.1 2006-01-10 14:38:36 claes Exp $
! 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.
!
! tlog_c_TLogExecAllOff.wb_load -- Defines the class TLogExecAllOff.
!
SObject TLog:Class
Object TLogExecAllOff $ClassDef 22
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_Connections
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "TLogExecAllOff"
EndBody
Object In $Input 1
Body SysBody
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object ExecOff $Output 2
Body SysBody
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object InOld $Intern 3
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object ExecOffOld $Intern 4
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object ExecOffSignal $Intern 5
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object LogTime $Intern 6
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Time"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcNode $Buffer 1
Body SysBody
Attr Class = pwr_eClass_PlcNode
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
Object GraphPlcNode $GraphPlcNode
Body SysBody
Attr object_type = 104
Attr parameters[0] = 1
Attr parameters[1] = 0
Attr parameters[2] = 1
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 7
Attr graphindex = 1
Attr default_mask[0] = 1
Attr default_mask[1] = 1
Attr segname_annotation = 1
Attr compmethod = 5
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr objname = "EXOFF"
Attr graphname = "EXOFF"
Attr debugpar = ""
EndBody
EndObject
!
! Template object
!
Object Template TLogExecAllOff
EndObject
EndObject
EndSObject
tlog/wbl/tlog/src/tlog_c_tlogexecallon.wb_load
0 → 100644
View file @
16ebc80d
!
! Proview $Id: tlog_c_tlogexecallon.wb_load,v 1.1 2006-01-10 14:38:36 claes Exp $
! 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.
!
! tlog_c_TLogExecAllOn.wb_load -- Defines the class TLogExecAllOn.
!
SObject TLog:Class
Object TLogExecAllOn $ClassDef 24
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_Connections
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "TLogExecAllOn"
EndBody
Object In $Input 1
Body SysBody
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object ExecOn $Output 2
Body SysBody
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object InOld $Intern 3
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object ExecOnOld $Intern 4
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object ExecOnSignal $Intern 5
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object LogTime $Intern 6
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Time"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcNode $Buffer 1
Body SysBody
Attr Class = pwr_eClass_PlcNode
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
Object GraphPlcNode $GraphPlcNode
Body SysBody
Attr object_type = 105
Attr parameters[0] = 1
Attr parameters[1] = 0
Attr parameters[2] = 1
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 7
Attr graphindex = 1
Attr default_mask[0] = 1
Attr default_mask[1] = 1
Attr segname_annotation = 1
Attr compmethod = 5
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr objname = "EXON"
Attr graphname = "EXON"
Attr debugpar = ""
EndBody
EndObject
!
! Template object
!
Object Template TLogExecAllOn
EndObject
EndObject
EndSObject
tlog/wbl/tlog/src/tlog_c_tlogmodify.wb_load
0 → 100644
View file @
16ebc80d
!
! Proview $Id: tlog_c_tlogmodify.wb_load,v 1.1 2006-01-10 14:38:36 claes Exp $
! 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.
!
! tlog_c_TLogModify.wb_load -- Defines the class TLogModify.
!
SObject TLog:Class
Object TLogModify $ClassDef 26
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_Connections
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "TLogModify"
EndBody
Object In $Input 1
Body SysBody
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object InOld $Intern 2
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object ModifySignal $Intern 3
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object UnModifySignal $Intern 4
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object ModifyTime $Intern 5
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Time"
EndBody
EndObject
Object UnModifyTime $Intern 6
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Time"
EndBody
EndObject
Object TLogOpenObject $Intern 7
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
Object TLogSelectList $Intern 8
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 10
EndBody
EndObject
Object AlarmSelectList $Intern 9
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 10
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcNode $Buffer 1
Body SysBody
Attr Class = pwr_eClass_PlcNode
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
Object GraphPlcNode $GraphPlcNode
Body SysBody
Attr object_type = 109
Attr parameters[0] = 1
Attr parameters[1] = 0
Attr parameters[2] = 0
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 7
Attr graphindex = 1
Attr default_mask[0] = 1
Attr default_mask[1] = 0
Attr segname_annotation = 1
Attr compmethod = 5
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr objname = "TLMOD"
Attr graphname = "TLMOD"
Attr debugpar = ""
EndBody
EndObject
!
! Template object
!
Object Template TLogModify
EndObject
EndObject
EndSObject
tlog/wbl/tlog/src/tlog_c_tlogopen.wb_load
0 → 100644
View file @
16ebc80d
!
! Proview $Id: tlog_c_tlogopen.wb_load,v 1.1 2006-01-10 14:38:36 claes Exp $
! 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.
!
! tlog_c_TLogOpen.wb_load -- Defines the class TLogOpen.
!
SObject TLog:Class
Object TLogOpen $ClassDef 28
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_Connections
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "TLogOpen"
EndBody
Object In $Input 1
Body SysBody
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object FileOpen $Output 2
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object FileOpenOld $Intern 3
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object InOld $Intern 4
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object OpenSignal $Intern 5
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object CloseSignal $Intern 6
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object OpenTime $Intern 7
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Time"
EndBody
EndObject
Object CloseTime $Intern 8
Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Time"
EndBody
EndObject
Object TLogSelectList $Intern 9
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 10
EndBody
EndObject
Object AlarmSelectList $Intern 10
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 10
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcNode $Buffer 1
Body SysBody
Attr Class = pwr_eClass_PlcNode
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
Object GraphPlcNode $GraphPlcNode
Body SysBody
Attr object_type = 110
Attr parameters[0] = 1
Attr parameters[1] = 0
Attr parameters[2] = 1
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 7
Attr graphindex = 1
Attr default_mask[0] = 1
Attr default_mask[1] = 0
Attr segname_annotation = 1
Attr compmethod = 5
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr objname = "TLOPEN"
Attr graphname = "TLOPEN"
Attr debugpar = ""
EndBody
EndObject
!
! Template object
!
Object Template TLogOpen
EndObject
EndObject
EndSObject
tlog/wbl/tlog/src/tlog_ch_tlogclasses.wb_load
0 → 100644
View file @
16ebc80d
!
! Proview $Id: tlog_ch_tlogclasses.wb_load,v 1.1 2006-01-10 14:38:36 claes Exp $
! Copyright (C) 2005 SSAB Oxelösund 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.
!
! tlog_ch_tlogclasses.wb_load -- TLog:Class hierarchy.
!
SObject TLog:
Object Class $ClassHier
EndObject
EndSObject
tlog/wbl/tlog/src/tlog_l_base.wb_load
0 → 100644
View file @
16ebc80d
!
! Proview $Id: tlog_l_base.wb_load,v 1.1 2006-01-10 14:38:36 claes Exp $
! 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.
!
SObject wb:layout-Configurator-w1-AllClasses
Object TLog $GroupRef
EndObject
EndSObject
!
!
SObject wb:layout-PlcEditor-w1-Simulate
Object TLog $Group
Object AtLog $Group
EndObject
Object CAtLog $Group
EndObject
Object CDtLog $Group
EndObject
Object ChgAtLog $Group
EndObject
Object ChgOtLog $Group
EndObject
Object COtLog $Group
EndObject
Object DtLog $Group
EndObject
Object ExecPlcOn $Group
EndObject
Object ExecPlcOff $Group
EndObject
Object TLogExecAllOn $Group
EndObject
Object TLogExecAllOff $Group
EndObject
Object TLogOpen $Group
EndObject
Object TLogModify $Group
EndObject
EndObject
EndSObject
tlog/wbl/tlog/src/tlog_v.wb_load
0 → 100644
View file @
16ebc80d
!
! Proview $Id: tlog_v.wb_load,v 1.1 2006-01-10 14:38:36 claes Exp $
! Copyright (C) 2005 SSAB Oxelösund 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.
!
! tlog_v.wb_load -- Loads the tlog volume
!
Volume TLog pwr_eClass_ClassVolume 0.0.1.2
EndVolume
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment