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

Report server, display needed when reporting GeGraphs can be configured

parent 606c9d72
...@@ -62,6 +62,7 @@ rt_report::rt_report() : scan_time(1), conf(0), first_scan(1), ...@@ -62,6 +62,7 @@ rt_report::rt_report() : scan_time(1), conf(0), first_scan(1),
now_sec(0), now_min(0), now_hour(0), now_mday(0), now_sec(0), now_min(0), now_hour(0), now_mday(0),
now_wday(0), now_yday(0) now_wday(0), now_yday(0)
{ {
strcpy( display, "");
} }
void rt_report::open() void rt_report::open()
...@@ -941,7 +942,18 @@ int rt_report::parse( char *line) ...@@ -941,7 +942,18 @@ int rt_report::parse( char *line)
fout << "wait 2 " << endl; fout << "wait 2 " << endl;
fout << "export graph /graph=" << line_array[2] << " /file=\"" << line_array[3] << "\"" << endl; fout << "export graph /graph=" << line_array[2] << " /file=\"" << line_array[3] << "\"" << endl;
sprintf( cmd, "rt_xtt_cmd -i -q @%s", fname); strcpy( cmd, "rt_xtt_cmd ");
if ( strcmp( display, "") != 0) {
strcpy( cmd, "export DISPLAY=");
strcat( cmd, display);
strcat( cmd, ";");
}
else
strcpy( cmd, "");
strcat( cmd, "rt_xtt_cmd ");
strcat( cmd, " -i -q @");
strcat( cmd, fname);
system( cmd); system( cmd);
sprintf( cmd, "rm %s", fname); sprintf( cmd, "rm %s", fname);
system( cmd); system( cmd);
...@@ -955,7 +967,7 @@ int rt_report::parse( char *line) ...@@ -955,7 +967,7 @@ int rt_report::parse( char *line)
return 1; return 1;
} }
int main() int main( int argc, char *argv[])
{ {
pwr_tStatus sts; pwr_tStatus sts;
int tmo; int tmo;
...@@ -968,6 +980,11 @@ int main() ...@@ -968,6 +980,11 @@ int main()
report = new rt_report(); report = new rt_report();
report->init( &qid); report->init( &qid);
if ( argc > 1) {
if ( strcmp( argv[1], "-d") == 0 && argc > 2)
strcpy( report->display, argv[2]);
}
try { try {
report->open(); report->open();
} }
......
...@@ -88,6 +88,7 @@ class rt_report { ...@@ -88,6 +88,7 @@ class rt_report {
GeUser *udb; GeUser *udb;
char nodename[80]; char nodename[80];
char systemgroup[80]; char systemgroup[80];
char display[80];
int first_scan; int first_scan;
int old_sec; int old_sec;
int old_min; int old_min;
......
...@@ -176,6 +176,16 @@ SObject pwrb:Class ...@@ -176,6 +176,16 @@ SObject pwrb:Class
Attr TypeRef = "pwrb:Type-PostOptionsMask" Attr TypeRef = "pwrb:Type-PostOptionsMask"
EndBody EndBody
EndObject EndObject
!/**
! A valid display is needed to print out Ge graphs. By default the local
! screen is used, but if the local screen is not logged in another display
! can be set in this attribute.
!*/
Object Display $Attribute 11
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
EndObject EndObject
Object Template ReportConfig Object Template ReportConfig
Body RtBody Body RtBody
......
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