Commit 4623f998 authored by claes's avatar claes

Process status and classgraphs for servers

parent 8804c1b2
/* rt_proc_cmn.c -- <short description>
PROVIEW/R
Copyright (C) 1996-98 by Mandator AB.
Process routines common for all platforms. */
#include "pwr.h"
#include "co_cdh.h"
#include "co_time.h"
#include "pwr_class.h"
#include "rt_gdh.h"
#include "rt_errh.h"
#include "rt_aproc.h"
#include "rt_proc_msg.h"
static pwr_sNode *proc_np = 0;
pwr_tStatus aproc_RegisterObject(
pwr_tOid oid
)
{
pwr_tStatus sts;
errh_eAnix anix = errh_Anix();
if ( !anix)
return PROC__ANIX;
if ( !proc_np) {
pwr_tOid noid;
sts = gdh_GetNodeObject( 0, &noid);
if ( EVEN(sts)) return sts;
sts = gdh_ObjidToPointer( noid, (void **)&proc_np);
if ( EVEN(sts)) return sts;
}
proc_np->ProcObject[anix-1] = oid;
return PROC__SUCCESS;
}
pwr_tStatus aproc_TimeStamp()
{
pwr_tStatus sts;
pwr_tTime t;
errh_eAnix anix = errh_Anix();
if ( !anix)
return PROC__ANIX;
if ( !proc_np) {
pwr_tOid noid;
sts = gdh_GetNodeObject( 0, &noid);
if ( EVEN(sts)) return sts;
sts = gdh_ObjidToPointer( noid, (void **)&proc_np);
if ( EVEN(sts)) return sts;
}
clock_gettime( CLOCK_REALTIME, &t);
proc_np->ProcTimeStamp[anix-1] = t;
return PROC__SUCCESS;
}
#ifndef rt_aproc_h
#define rt_aproc_h
/* rt_aproc.h -- <short description>
PROVIEW/R
Copyright (C) 1999 by Mandator AB.
. */
#include "pwr.h"
#include "rt_errh.h"
pwr_tStatus aproc_RegisterObject(pwr_tOid);
pwr_tStatus aproc_TimeStamp();
#endif
/* rt_c_node.c -- <short description>
PROVIEW/R
Copyright (C) 1997-98 by Mandator AB.
Functions for the class $Node.
*/
#include <stdio.h>
#include <string.h>
#include "pwr.h"
#include "pwr_class.h"
#include "co_time.h"
#include "rt_errh.h"
#include "rt_gdh.h"
#include "rt_pwr_msg.h"
#include "pwrs_c_node.h"
static pwr_sNode *np = 0;
/**
@aref node Node
*/
void
pwrs_Node_Exec (
)
{
int i;
pwr_tTime current_time;
pwr_tDeltaTime diff;
int severity;
int system_severity;
int new_idx = -1;
static float timeout[40] = {
0,0,0,0,3,5,5,0,60,5,
5,5,5,0,0,0,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5};
if ( !np) {
pwr_tOid oid;
pwr_tStatus sts;
sts = gdh_GetNodeObject( 0, &oid);
if ( ODD(sts))
gdh_ObjidToPointer( oid, (void **) &np);
if ( EVEN(sts)) return;
}
if ( !np)
return;
if ( !np->SystemStatus)
system_severity = - 1;
else
system_severity = np->SystemStatus & 7;
clock_gettime( CLOCK_REALTIME, &current_time);
for ( i = 0; i < sizeof(np->ProcStatus)/sizeof(np->ProcStatus[0]); i++) {
severity = np->ProcStatus[i] & 7;
if ( np->ProcStatus[i] != 0 && timeout[i] != 0.0) {
time_Adiff( &diff, &current_time, &np->ProcTimeStamp[i]);
if ( time_DToFloat( 0, &diff) > timeout[i]) {
np->ProcStatus[i] = PWR__PTIMEOUT;
}
else if ( np->ProcStatus[i] == PWR__PTIMEOUT) {
np->ProcStatus[i] = (i < errh_cAnix_SrvSize) ? PWR__SRUN : PWR__ARUN;
}
}
severity = np->ProcStatus[i] & 7;
if ( !(np->ProcStatus[i] == 0 || ODD(np->ProcStatus[i]))) {
if ( severity >= system_severity) {
new_idx = i;
system_severity = severity;
}
}
}
if ( new_idx != -1)
np->SystemStatus = np->ProcStatus[new_idx];
else if ( EVEN(np->SystemStatus))
np->SystemStatus = PWR__RUNNING;
}
/* rt_c_node.h -- <short description>
PROVIEW/R
Copyright (C) 1997,99 by Mandator AB.
Functions for the class PlcThread.
*/
#include "pwr.h"
#include "pwr_class.h"
void
pwrs_Node_Exec (
);
! rt_pwr_msg.msg -- <short description>
!
! PROVIEW/R
! Copyright (C) 1996,98 by Mandator AB.
!
! <Description>.
!
! NOTE !!! Put new message last, msg numbers are hardcoded in Errh.java
!
.facility PWR,4 /prefix = PWR__ ! Proview messages
success <Successful completion> /succ
startup <Proview starting up> /info
running <Proview running> /succ
swap <Proview soft restart> /warning
nettimeout <Network timeout> /fatal
srverror <Server reported error> /error
srvfatal <Server reported fatal error> /fatal
srvwarning <Server reported warning> /warning
srvinfo <Server reported info> /info
srvstartup <Server starting up> /warning
srun <Server running> /info
srvrestart <Server restarting> /warning
srvterm <Server terminated> /fatal
applerror <Application reported error> /error
applfatal <Application reported fatal error> /fatal
applwarning <Application reported warning> /warning
applinfo <Application reported info> /info
applstartup <Application starting up> /info
arun <Application running> /info
applrestart <Application restarting> /info
ptimeout <Process timeout> /fatal
.end
This diff is collapsed.
1
100 20
135 20
101 20
102 145
103 9
104 5.85652
136 5.85652
105 100
106 7
107 2
108 30.7632
109 1.25
110 4.71052
111 2
116 35
117 0
118 200
119 128
120 1
121 Claes context
122 0
126 1
127 1
128 0
129 0.3
130 1.5
131 0.8
132 3
133 2
137 4001
134
22
2200 0
2201 57
2202 pwr_c_dsfastconf
2203 51
2205 0
2204
2206 0
2207
2208
2209 0.7
2210 1.65
2211 31.5
2212 5.2
2213 4
2214
pwrp_pop:
pwrp_exe:
ssab_exe:
pwr_exe:
2215 0
2236 0
2216 0
2221 0
2237 0
2238 0
2239 0
2240 0
2241 0
2242 0
2217 0
2218 0
2219 0
2220
2230 0
2231 0
2222
2223 1
2224 0.5
2232 0.5
2225 0.5
2226 0
2227
2228 0
2229 0
2233 1
2234 3
2235 1
2243 0
99
123
2
3
300 pwr_valuelong
301
2
19
1904
1900 26.6
1901 0
1902 0.7
1903 0
1908 0
1909 41
1910 41
1911 1
1915 0
1913 5
1916 2
1914 0
1917 0
1907 0
1906
1905
5
500 0
501 1
504 1
505 1
502
7
700 0
701 0
99
503
7
700 26.6
701 0.7
99
99
1912
28
2800 1
2801 0
2802 0
2803 0
2804 1
2805 0
2806 0
99
99
29
2907
13
1300 1
1301 304
1306 0
1302 1
1305 1
1303
7
700 1
701 1.35
99
1304 0
99
2908
28
2800 1
2801 0
2802 -0.715333
2803 0
2804 1
2805 -0.771778
2806 0
99
99
99
302 0
304 0
303
305 0
306
307
308 1024
321 0
309 0
313 0
322 0
323 0
324 0
325 0
326 0
327 0
310 0
311 0
312
314
315 1
316 1
317 0
318 0
319 0
320 0
328 0
99
3
300 pwr_indsquare
301
2
19
1904
1900 0.75
1901 0.15
1902 0.75
1903 0.1
1908 0
1909 293
1910 293
1911 1
1915 0
1913 15
1916 2
1914 0
1917 0
1907 0
1906
1905
5
500 0
501 1
504 1
505 1
502
7
700 0.15
701 0.1
99
503
7
700 0.75
701 0.75
99
99
1912
28
2800 1
2801 0
2802 0
2803 0
2804 1
2805 0
2806 0
99
99
99
302 0
304 0
303
305 0
306
307
308 4
321 0
309 29
313 0
322 0
323 0
324 0
325 0
326 0
327 0
310 0
311 0
312
314
315 1
316 1
317 0
318 0
319 0
320 0
328 0
99
3
300 pwr_valuesmall
301
2
19
1904
1900 2.3
1901 0
1902 0.7
1903 0
1908 0
1909 41
1910 41
1911 1
1915 0
1913 5
1916 2
1914 0
1917 0
1907 0
1906
1905
5
500 0
501 1
504 1
505 1
502
7
700 0
701 0
99
503
7
700 2.3
701 0.7
99
99
1912
28
2800 1
2801 0
2802 0
2803 0
2804 1
2805 0
2806 0
99
99
29
2907
13
1300 1
1301 304
1306 0
1302 1
1305 1
1303
7
700 1
701 1.35
99
1304 0
99
2908
28
2800 1
2801 0
2802 -0.715333
2803 0
2804 1
2805 -0.771778
2806 0
99
99
99
302 0
304 0
303
305 0
306
307
308 1024
321 0
309 0
313 0
322 0
323 0
324 0
325 0
326 0
327 0
310 0
311 0
312
314
315 1
316 1
317 0
318 0
319 0
320 0
328 0
99
99
124
2
99
125
2
30
3004
3000 3.25
3001 1.25
3002 3.71052
3003 3.01052
3008 103
3007 0
3006
3005
9
900 2
901 304
904 0
902 Status
903
7
700 1.1
701 2.5
99
99
3009
28
2800 1
2801 0
2802 0.15
2803 0
2804 1
2805 1.06052
2806 0
99
99
27
2703 10000
2704 10000
2722 10000
2705 10000
2723 10000
2706 10000
2708 0
2709 0
2710 0
2711 0
2712 0
2713 0
2714 0
2715 0
2720 0
2702 0
2701
2700
10
1000 pwr_indsquare
1002 O50
1005
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1006 7.15
1007 6.55
1008 3.7
1009 3.05
1013 7.15
1014 6.55
1015 3.7
1016 3.05
1003
0
0
0
0
0
0
0
0
0
0
1004
1001
7
700 5.95
701 8.95
99
1010
1011
1018
1019
1020
1021
1022
1023
1024
1025
1012 0
1017 9999
1027 9999
1026 65532
1028 0
1029
99
2707
28
2800 1
2801 0
2802 6.4
2803 0
2804 1
2805 2.95
2806 0
99
2716 0
2718
2717
2719 0
2724 0
2721
1
100 33554432
101 0
102 65532
103 0
31
3100 $node.ProcStatus[11]##status
3101 38
99
99
99
27
2703 10000
2704 10000
2722 10000
2705 10000
2723 10000
2706 10000
2708 0
2709 0
2710 0
2711 0
2712 0
2713 0
2714 0
2715 0
2720 0
2702 0
2701
2700
10
1000 pwr_indsquare
1002 O51
1005
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1006 7.15
1007 6.55
1008 4.6
1009 3.95
1013 7.15
1014 6.55
1015 4.6
1016 3.95
1003
0
0
0
0
0
0
0
0
0
0
1004
1001
7
700 5.95
701 8.95
99
1010
1011
1018
1019
1020
1021
1022
1023
1024
1025
1012 0
1017 9999
1027 9999
1026 65532
1028 0
1029
99
2707
28
2800 1
2801 0
2802 6.4
2803 0
2804 1
2805 3.85
2806 0
99
2716 0
2718
2717
2719 0
2724 0
2721
1
100 33554432
101 0
102 65532
103 0
31
3100 $node.ProcMsgSeverity[11]##status
3101 38
99
99
99
30
3004
3000 4.95
3001 1.25
3002 4.71052
3003 4.01052
3008 103
3007 0
3006
3005
9
900 2
901 304
904 0
902 LogMessage
903
7
700 1.1
701 2.5
99
99
3009
28
2800 1
2801 0
2802 0.15
2803 0
2804 1
2805 2.06052
2806 0
99
99
30
3004
3000 5.85
3001 1.25
3002 2.71052
3003 2.01052
3008 103
3007 0
3006
3005
9
900 2
901 304
904 0
902 BaseFrequency
903
7
700 1.1
701 2.5
99
99
3009
28
2800 1
2801 0
2802 0.15
2803 0
2804 1
2805 0.06052
2806 0
99
99
27
2703 33
2704 31
2722 10000
2705 31
2723 10000
2706 33
2708 0
2709 0
2710 0
2711 0
2712 0
2713 0
2714 0
2715 0
2720 0
2702 0
2701
2700
10
1000 pwr_valuesmall
1002 O53
1005
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1006 8.8
1007 6.5
1008 2.7
1009 2
1013 8.8
1014 6.5
1015 2.7
1016 2
1003
0
0
0
0
0
0
0
0
0
0
1004
1001
7
700 10.25
701 2.1
99
1010
1011
1018
1019
1020
1021
1022
1023
1024
1025
1012 0
1017 9999
1027 9999
1026 65532
1028 0
1029
99
2707
28
2800 1
2801 0
2802 6.5
2803 0
2804 1
2805 2
2806 0
99
2716 0
2718
2717
2719 0
2724 0
2721
1
100 1
101 1
102 65532
103 0
12
1200 $object.BaseFrequency##Int32
1201 %d
1202 1
1203 1
99
99
99
27
2703 33
2704 10000
2722 10000
2705 10000
2723 10000
2706 33
2708 0
2709 0
2710 0
2711 0
2712 0
2713 0
2714 0
2715 0
2720 0
2702 0
2701
2700
10
1000 pwr_valuelong
1002 O55
1005
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1006 30.756
1007 7.35
1008 3.7
1009 3
1013 30.756
1014 7.35
1015 3.7
1016 3
1003
0
0
0
0
0
0
0
0
0
0
1004
1001
7
700 6.75
701 5.6
99
1010
1011
1018
1019
1020
1021
1022
1023
1024
1025
1012 0
1017 9999
1027 9999
1026 65532
1028 0
1029
99
2707
28
2800 0.879925
2801 0
2802 7.35
2803 0
2804 1
2805 3
2806 0
99
2716 0
2718
2717
2719 0
2724 0
2721
1
100 1
101 1
102 65532
103 0
12
1200 $node.ProcStatus[11]##Status
1201 %1m
1202 1
1203 1
99
99
99
27
2703 33
2704 10000
2722 10000
2705 10000
2723 10000
2706 33
2708 0
2709 0
2710 0
2711 0
2712 0
2713 0
2714 0
2715 0
2720 0
2702 0
2701
2700
10
1000 pwr_valuelong
1002 O56
1005
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1006 30.7632
1007 7.35
1008 4.65
1009 3.95
1013 30.7632
1014 7.35
1015 4.65
1016 3.95
1003
0
0
0
0
0
0
0
0
0
0
1004
1001
7
700 6.75
701 5.6
99
1010
1011
1018
1019
1020
1021
1022
1023
1024
1025
1012 0
1017 9999
1027 9999
1026 65532
1028 0
1029
99
2707
28
2800 0.880194
2801 0
2802 7.35
2803 0
2804 1
2805 3.95
2806 0
99
2716 0
2718
2717
2719 0
2724 0
2721
1
100 1
101 1
102 65532
103 0
12
1200 $node.ProcMessage[11]##String80
1201 %s
1202 1
1203 1
99
99
99
99
99
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment