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
0448a367
Commit
0448a367
authored
May 11, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New Status Monitor
parent
4469e089
Changes
15
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
2775 additions
and
0 deletions
+2775
-0
xtt/exe/rt_statusmon/gtk/os_linux/hw_x86/makefile
xtt/exe/rt_statusmon/gtk/os_linux/hw_x86/makefile
+15
-0
xtt/exe/rt_statusmon/gtk/os_linux/link_rule.mk
xtt/exe/rt_statusmon/gtk/os_linux/link_rule.mk
+19
-0
xtt/exe/rt_statusmon/gtk/rt_statusmon_gtk.cpp
xtt/exe/rt_statusmon/gtk/rt_statusmon_gtk.cpp
+60
-0
xtt/exe/rt_statusmon/gtk/statusmon_nodelist_gtk.cpp
xtt/exe/rt_statusmon/gtk/statusmon_nodelist_gtk.cpp
+394
-0
xtt/exe/rt_statusmon/gtk/statusmon_nodelist_gtk.h
xtt/exe/rt_statusmon/gtk/statusmon_nodelist_gtk.h
+75
-0
xtt/exe/rt_statusmon/gtk/statusmon_nodelistnav_gtk.cpp
xtt/exe/rt_statusmon/gtk/statusmon_nodelistnav_gtk.cpp
+108
-0
xtt/exe/rt_statusmon/gtk/statusmon_nodelistnav_gtk.h
xtt/exe/rt_statusmon/gtk/statusmon_nodelistnav_gtk.h
+54
-0
xtt/exe/rt_statusmon/src/os_linux/hw_x86/makefile
xtt/exe/rt_statusmon/src/os_linux/hw_x86/makefile
+15
-0
xtt/exe/rt_statusmon/src/os_linux/hw_x86/special.mk
xtt/exe/rt_statusmon/src/os_linux/hw_x86/special.mk
+9
-0
xtt/exe/rt_statusmon/src/os_linux/link_rule.mk
xtt/exe/rt_statusmon/src/os_linux/link_rule.mk
+7
-0
xtt/exe/rt_statusmon/src/rt_statusmon.cpp
xtt/exe/rt_statusmon/src/rt_statusmon.cpp
+63
-0
xtt/exe/rt_statusmon/src/statusmon_nodelist.cpp
xtt/exe/rt_statusmon/src/statusmon_nodelist.cpp
+106
-0
xtt/exe/rt_statusmon/src/statusmon_nodelist.h
xtt/exe/rt_statusmon/src/statusmon_nodelist.h
+72
-0
xtt/exe/rt_statusmon/src/statusmon_nodelistnav.cpp
xtt/exe/rt_statusmon/src/statusmon_nodelistnav.cpp
+1528
-0
xtt/exe/rt_statusmon/src/statusmon_nodelistnav.h
xtt/exe/rt_statusmon/src/statusmon_nodelistnav.h
+250
-0
No files found.
xtt/exe/rt_statusmon/gtk/os_linux/hw_x86/makefile
0 → 100644
View file @
0448a367
include
$(pwre_dir_symbols)
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq
($($(type_name)_generic_mk),)
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq
($($(type_name)_generic_mk),)
include
$(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include
../../special.mk
-include
../special.mk
-include
special.mk
xtt/exe/rt_statusmon/gtk/os_linux/link_rule.mk
0 → 100644
View file @
0448a367
ifndef
link_rule_mk
link_rule_mk
:=
1
link
=
$(ldxx)
$(elinkflags)
$(domap)
-o
$(pwr_exe)
/rt_statusmon_gtk
\
$(bld_dir)
/rt_statusmon_gtk.o
\
$(bld_dir)
/statusmon_nodelist_gtk.o
$(bld_dir)
/statusmon_nodelistnav_gtk.o
\
$(bld_dir)
/statusmon_nodelist.o
$(bld_dir)
/statusmon_nodelistnav.o
\
$(pwr_eobj)
/stdsoap2.o
\
$(wb_msg_eobjs)
$(rt_msg_eobjs)
\
-L
/usr/X11R6/lib
\
-L
/opt/gnome/lib
\
-lpwr_statussrv
-lpwr_ge_gtk
-lpwr_ge
-lpwr_wb_gtk
-lpwr_wb
-lpwr_wb_gtk
-l
pwr_wb
-lpwr_ge_gtk
-lpwr_ge
\
-lpwr_flow_gtk
-lpwr_flow
-lpwr_glow_gtk
-lpwr_glow
-lpwr_rt_gtk
-lpwr_rt
\
-lpwr_co_gtk
-lpwr_co
-lpwr_flow_gtk
-lpwr_flow
\
`
pkg-config
--libs
gtk+-2.0
`
\
-lpwr_msg_dummy
-lantlr
\
-lrpcsvc
-lpthread
-lm
-ldb_cxx
-lz
endif
xtt/exe/rt_statusmon/gtk/rt_statusmon_gtk.cpp
0 → 100644
View file @
0448a367
/*
* Proview $Id: rt_statusmon_gtk.cpp,v 1.1 2007-05-11 15:04:14 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.
*/
/* rt_statusmon_gtk.cpp -- Status Monitor */
#include <stdio.h>
#include <stdlib.h>
#include <gtk/gtk.h>
#include "pwr.h"
#include "statusmon_nodelist_gtk.h"
static
void
usage
()
{
printf
(
"
\n
Usage: rt_statusmonitor
\n\n
$HOME/rt_statusmon.dat : file with reqested nodes"
);
}
static
void
statusmon_close
(
void
*
ctx
)
{
exit
(
0
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
sts
;
if
(
argc
>
1
)
{
for
(
int
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
strcmp
(
argv
[
i
],
"-h"
)
==
0
)
{
usage
();
exit
(
0
);
}
}
}
gtk_init
(
&
argc
,
&
argv
);
Nodelist
*
nl
=
new
NodelistGtk
(
NULL
,
NULL
,
"Status Monitor"
,
&
sts
);
nl
->
close_cb
=
statusmon_close
;
nl
->
set_scantime
(
3
);
gtk_main
();
return
(
0
);
}
xtt/exe/rt_statusmon/gtk/statusmon_nodelist_gtk.cpp
0 → 100644
View file @
0448a367
This diff is collapsed.
Click to expand it.
xtt/exe/rt_statusmon/gtk/statusmon_nodelist_gtk.h
0 → 100644
View file @
0448a367
/*
* Proview $Id: statusmon_nodelist_gtk.h,v 1.1 2007-05-11 15:04:14 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.
*/
#ifndef statusmon_nodelist_gtk_h
#define statusmon_nodelist_gtk_h
/* statusmon_nodelist_gtk.h -- Alarm and event windows in statusmon */
#ifndef statusmon_nodelist_h
# include "statusmon_nodelist.h"
#endif
class
NodelistGtk
:
public
Nodelist
{
public:
NodelistGtk
(
void
*
nodelist_parent_ctx
,
GtkWidget
*
nodelist_parent_wid
,
char
*
nodelist_name
,
pwr_tStatus
*
status
);
~
NodelistGtk
();
GtkWidget
*
parent_wid
;
GtkWidget
*
parent_wid_nodelist
;
GtkWidget
*
toplevel
;
GtkWidget
*
form_nodelist
;
GtkWidget
*
nodelistnav_widget
;
GdkCursor
*
clock_cursor
;
GtkWidget
*
india_widget
;
GtkWidget
*
india_label
;
GtkWidget
*
india_text
;
void
pop
();
void
set_clock_cursor
();
void
reset_cursor
();
void
free_cursor
();
void
create_input_dialog
();
void
open_input_dialog
(
char
*
text
,
char
*
title
,
char
*
init_text
,
void
(
*
ok_cb
)(
Nodelist
*
,
char
*
));
static
gboolean
action_inputfocus
(
GtkWidget
*
w
,
GdkEvent
*
event
,
gpointer
data
);
static
void
activate_exit
(
GtkWidget
*
w
,
gpointer
data
);
static
void
activate_add_node
(
GtkWidget
*
w
,
gpointer
data
);
static
void
activate_remove_node
(
GtkWidget
*
w
,
gpointer
data
);
static
void
activate_save
(
GtkWidget
*
w
,
gpointer
data
);
static
void
activate_show_events
(
GtkWidget
*
w
,
gpointer
data
);
static
void
activate_zoom_in
(
GtkWidget
*
w
,
gpointer
data
);
static
void
activate_zoom_out
(
GtkWidget
*
w
,
gpointer
data
);
static
void
activate_zoom_reset
(
GtkWidget
*
w
,
gpointer
data
);
static
void
activate_help
(
GtkWidget
*
w
,
gpointer
data
);
static
void
activate_india_ok
(
GtkWidget
*
w
,
gpointer
data
);
static
void
activate_india_cancel
(
GtkWidget
*
w
,
gpointer
data
);
};
#endif
xtt/exe/rt_statusmon/gtk/statusmon_nodelistnav_gtk.cpp
0 → 100644
View file @
0448a367
/*
* Proview $Id: statusmon_nodelistnav_gtk.cpp,v 1.1 2007-05-11 15:04:14 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.
*/
/* statusmon_nodelistnav_gtk.cpp -- Console message window. */
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <gtk/gtk.h>
#include "co_cdh.h"
#include "co_dcli.h"
#include "co_time.h"
#include "co_wow_gtk.h"
#include "pwr_baseclasses.h"
#include "rt_gdh.h"
#include "rt_syi.h"
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget_gtk.h"
#include "statusmon_nodelistnav_gtk.h"
NodelistNavGtk
::
NodelistNavGtk
(
void
*
nodelist_parent_ctx
,
GtkWidget
*
nodelist_parent_wid
,
GtkWidget
**
w
)
:
NodelistNav
(
nodelist_parent_ctx
),
parent_wid
(
nodelist_parent_wid
)
{
form_widget
=
scrolledbrowwidgetgtk_new
(
init_brow_cb
,
this
,
&
brow_widget
);
gtk_widget_show_all
(
brow_widget
);
*
w
=
form_widget
;
wow
=
new
CoWowGtk
(
parent_wid
);
}
//
// Delete ev
//
NodelistNavGtk
::~
NodelistNavGtk
()
{
if
(
trace_started
)
g_source_remove
(
trace_timerid
);
delete
brow
;
gtk_widget_destroy
(
form_widget
);
}
void
NodelistNavGtk
::
beep
()
{
gdk_display_beep
(
gtk_widget_get_display
(
form_widget
));
}
void
NodelistNavGtk
::
set_input_focus
()
{
gtk_widget_grab_focus
(
brow_widget
);
}
void
NodelistNavGtk
::
trace_start
()
{
NodelistNavGtk
::
trace_scan
(
this
);
}
static
gboolean
nodelistnavgtk_trace_scan
(
void
*
data
)
{
NodelistNavGtk
::
trace_scan
(
(
NodelistNav
*
)
data
);
return
FALSE
;
}
void
NodelistNavGtk
::
trace_scan
(
NodelistNav
*
nodelistnav
)
{
if
(
nodelistnav
->
trace_started
)
{
nodelistnav
->
update_nodes
();
brow_TraceScan
(
nodelistnav
->
brow
->
ctx
);
((
NodelistNavGtk
*
)
nodelistnav
)
->
trace_timerid
=
g_timeout_add
(
nodelistnav
->
scantime
,
nodelistnavgtk_trace_scan
,
nodelistnav
);
}
}
xtt/exe/rt_statusmon/gtk/statusmon_nodelistnav_gtk.h
0 → 100644
View file @
0448a367
/*
* Proview $Id: statusmon_nodelistnav_gtk.h,v 1.1 2007-05-11 15:04:14 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.
*/
#ifndef statusmon_nodelistnav_gtk_h
#define statusmon_nodelistnav_gtk_h
/* statusmon_nodelistnav_gtk.h -- Console message window. */
// Status is defined as int i xlib...
#ifndef statusmon_nodelistnav_h
# include "statusmon_nodelistnav.h"
#endif
class
NodelistNavGtk
:
public
NodelistNav
{
public:
NodelistNavGtk
(
void
*
ev_parent_ctx
,
GtkWidget
*
ev_parent_wid
,
GtkWidget
**
w
);
~
NodelistNavGtk
();
GtkWidget
*
parent_wid
;
GtkWidget
*
brow_widget
;
GtkWidget
*
form_widget
;
GtkWidget
*
toplevel
;
gint
trace_timerid
;
void
start_trace
(
pwr_tObjid
Objid
,
char
*
object_str
);
void
set_input_focus
();
void
trace_start
();
void
beep
();
static
void
trace_scan
(
NodelistNav
*
nodelistnav
);
};
#endif
xtt/exe/rt_statusmon/src/os_linux/hw_x86/makefile
0 → 100644
View file @
0448a367
include
$(pwre_dir_symbols)
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq
($($(type_name)_generic_mk),)
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq
($($(type_name)_generic_mk),)
include
$(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include
../../special.mk
-include
../special.mk
-include
special.mk
xtt/exe/rt_statusmon/src/os_linux/hw_x86/special.mk
0 → 100644
View file @
0448a367
copy
:
$(inc_dir)/statusmon_nodelist.h
\
$(inc_dir)/statusmon_nodelistnav.h
$(inc_dir)/statusmon_nodelist.h
:
\
../../statusmon_nodelist.h
$(inc_dir)/statusmon_nodelistnav.h
:
\
../../statusmon_nodelistnav.h
xtt/exe/rt_statusmon/src/os_linux/link_rule.mk
0 → 100644
View file @
0448a367
ifndef
link_rule_mk
link_rule_mk
:=
1
link
=
$(ldxx)
$(elinkflags)
$(domap)
-o
$(export_exe)
\
$(export_obj)
-lpwr_co
endif
xtt/exe/rt_statusmon/src/rt_statusmon.cpp
0 → 100644
View file @
0448a367
/*
* Proview $Id: rt_statusmon.cpp,v 1.1 2007-05-11 15:04:14 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.
*/
/* rt_statusmon.cpp Status Monitor */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "pwr.h"
static
void
usage
()
{
printf
(
"
\n
Usage: rt_statusmon [-f windowmanager]"
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
i
;
int
found
=
0
;
char
wmg
[
80
];
pwr_tFileName
file
;
if
(
argc
>
1
)
{
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
strcmp
(
argv
[
i
],
"-f"
)
==
0
)
{
if
(
i
+
1
>=
argc
)
{
usage
();
exit
(
0
);
}
found
=
1
;
strcpy
(
wmg
,
argv
[
i
+
1
]);
i
++
;
}
}
}
if
(
!
found
)
strcpy
(
wmg
,
"gtk"
);
strcpy
(
file
,
argv
[
0
]);
strcat
(
file
,
"_"
);
strcat
(
file
,
wmg
);
execvp
(
file
,
argv
);
}
xtt/exe/rt_statusmon/src/statusmon_nodelist.cpp
0 → 100644
View file @
0448a367
/*
* Proview $Id: statusmon_nodelist.cpp,v 1.1 2007-05-11 15:04:14 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.
*/
/* xtt_nodelist.cpp -- Console log in xtt */
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
#include "co_cdh.h"
#include "co_time.h"
#include "pwr_baseclasses.h"
#include "rt_gdh.h"
#include "co_lng.h"
#include "co_wow.h"
#include "statusmon_nodelist.h"
#include "rt_xnav_msg.h"
Nodelist
::
Nodelist
(
void
*
nodelist_parent_ctx
,
char
*
nodelist_name
,
pwr_tStatus
*
status
)
:
parent_ctx
(
nodelist_parent_ctx
),
nodelistnav
(
NULL
),
nodelist_displayed
(
0
),
help_cb
(
0
),
close_cb
(
0
)
{
*
status
=
1
;
}
//
// Delete nodelist
//
Nodelist
::~
Nodelist
()
{
}
void
Nodelist
::
activate_help
()
{
if
(
help_cb
)
(
help_cb
)(
parent_ctx
,
"consolelog"
);
}
void
Nodelist
::
find_node_cb
(
void
*
ctx
,
pwr_tOid
oid
)
{
Nodelist
*
nodelist
=
(
Nodelist
*
)
ctx
;
if
(
nodelist
->
nodelistnav
->
select_node
(
oid
.
oix
))
nodelist
->
pop
();
}
void
Nodelist
::
add_node_ok
(
Nodelist
*
nodelist
,
char
*
node_name
)
{
nodelist
->
nodelistnav
->
add_node
(
node_name
);
}
void
Nodelist
::
activate_add_node
()
{
open_input_dialog
(
"Enter node name"
,
"Add Node"
,
""
,
add_node_ok
);
}
void
remove_node_ok
(
void
*
ctx
,
void
*
data
)
{
Nodelist
*
nodelist
=
(
Nodelist
*
)
ctx
;
nodelist
->
nodelistnav
->
remove_node
(
(
char
*
)
data
);
}
void
Nodelist
::
activate_remove_node
()
{
static
char
node_name
[
80
];
char
msg
[
100
];
int
sts
;
sts
=
nodelistnav
->
get_selected_node
(
node_name
);
if
(
EVEN
(
sts
))
{
nodelistnav
->
wow
->
DisplayError
(
"Remove Node"
,
"Select a node"
);
return
;
}
sprintf
(
msg
,
"Do you want to remove node %s"
,
node_name
);
nodelistnav
->
wow
->
DisplayQuestion
(
this
,
"Remove Node"
,
msg
,
remove_node_ok
,
NULL
,
node_name
);
}
void
Nodelist
::
activate_save
()
{
nodelistnav
->
save
();
}
xtt/exe/rt_statusmon/src/statusmon_nodelist.h
0 → 100644
View file @
0448a367
/*
* Proview $Id: statusmon_nodelist.h,v 1.1 2007-05-11 15:04:14 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.
*/
#ifndef statusmon_nodelist_h
#define statusmon_nodelist_h
/* statusmon_nodelist.h -- Status Monitor node list */
#ifndef pwr_h
# include "pwr.h"
#endif
#ifndef statusmon_nodelistnav
# include "statusmon_nodelistnav.h"
#endif
class
CoWow
;
class
Nodelist
{
public:
Nodelist
(
void
*
nodelist_parent_ctx
,
char
*
nodelist_name
,
pwr_tStatus
*
status
);
virtual
~
Nodelist
();
void
*
parent_ctx
;
char
name
[
80
];
NodelistNav
*
nodelistnav
;
int
nodelist_displayed
;
void
(
*
help_cb
)(
void
*
,
char
*
);
void
(
*
close_cb
)(
void
*
);
void
(
*
india_ok_cb
)(
Nodelist
*
,
char
*
);
CoWow
*
wow
;
virtual
void
pop
()
{}
virtual
void
set_clock_cursor
()
{}
virtual
void
reset_cursor
()
{}
virtual
void
free_cursor
()
{}
virtual
void
open_input_dialog
(
char
*
text
,
char
*
title
,
char
*
init_text
,
void
(
*
ok_cb
)(
Nodelist
*
,
char
*
))
{}
void
set_scantime
(
float
scantime
)
{
nodelistnav
->
scantime
=
int
(
scantime
*
1000
);}
void
activate_help
();
void
activate_add_node
();
void
activate_remove_node
();
void
activate_save
();
static
void
find_node_cb
(
void
*
ctx
,
pwr_tOid
oid
);
static
void
add_node_ok
(
Nodelist
*
nodelist
,
char
*
node_name
);
};
#endif
xtt/exe/rt_statusmon/src/statusmon_nodelistnav.cpp
0 → 100644
View file @
0448a367
This diff is collapsed.
Click to expand it.
xtt/exe/rt_statusmon/src/statusmon_nodelistnav.h
0 → 100644
View file @
0448a367
/*
* Proview $Id: statusmon_nodelistnav.h,v 1.1 2007-05-11 15:04:14 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.
*/
#ifndef statusmon_nodelistnav_h
#define statusmon_nodelistnav_h
/* statusmon_nodelistnav.h -- Console message window. */
// Status is defined as int i xlib...
#include <vector>
#include "statussrv_utl.h"
using
namespace
std
;
#ifndef pwr_h
# include "pwr.h"
#endif
#ifndef rt_errh_h
# include "rt_errh.h"
#endif
#ifndef flow_h
#include "flow.h"
#endif
#ifndef flow_browctx_h
#include "flow_browctx.h"
#endif
#ifndef flow_browapi_h
#include "flow_browapi.h"
#endif
typedef
enum
{
nodelistnav_eItemType_Node
,
nodelistnav_eItemType_Attr
,
nodelistnav_eItemType_AttrSts
,
nodelistnav_eItemType_AttrSysSts
}
nodelistnav_eItemType
;
class
NodelistNavBrow
{
public:
NodelistNavBrow
(
BrowCtx
*
brow_ctx
,
void
*
evl
)
:
ctx
(
brow_ctx
),
nodelistnav
(
evl
)
{};
~
NodelistNavBrow
();
BrowCtx
*
ctx
;
void
*
nodelistnav
;
brow_tNodeClass
nc_event
;
brow_tNodeClass
nc_node
;
brow_tNodeClass
nc_attr
;
brow_tNodeClass
nc_sys_sts_attr
;
brow_tNodeClass
nc_sts_attr
;
flow_sAnnotPixmap
*
pixmap_leaf
;
flow_sAnnotPixmap
*
pixmap_map
;
flow_sAnnotPixmap
*
pixmap_openmap
;
flow_sAnnotPixmap
*
pixmap_attr
;
void
free_pixmaps
();
void
allocate_pixmaps
();
void
create_nodeclasses
();
void
brow_setup
();
};
class
NodeData
{
public:
NodeData
()
:
SystemStatus
(
0
),
SystemTime
(
pwr_cNTime
),
BootTime
(
pwr_cNTime
),
RestartTime
(
pwr_cNTime
),
Restarts
(
0
)
{
strcpy
(
Description
,
""
);
strcpy
(
SystemStatusStr
,
""
);
}
pwr_tStatus
SystemStatus
;
char
SystemStatusStr
[
120
];
pwr_tString80
Description
;
pwr_tTime
SystemTime
;
pwr_tTime
BootTime
;
pwr_tTime
RestartTime
;
int
Restarts
;
char
Version
[
20
];
};
class
ItemNode
;
class
CoWow
;
class
NodelistNode
{
public:
NodelistNode
(
char
*
name
)
:
item
(
0
),
connection_sts
(
0
),
init_done
(
0
)
{
strncpy
(
node_name
,
name
,
sizeof
(
node_name
));
}
char
node_name
[
80
];
ItemNode
*
item
;
pwr_tStatus
connection_sts
;
int
init_done
;
};
class
NodelistNav
{
public:
NodelistNav
(
void
*
ev_parent_ctx
);
virtual
~
NodelistNav
();
void
*
parent_ctx
;
NodelistNavBrow
*
brow
;
int
nodelist_size
;
int
max_size
;
vector
<
NodelistNode
>
node_list
;
int
trace_started
;
int
scantime
;
int
first_scan
;
CoWow
*
wow
;
static
const
char
config_file
[
40
];
virtual
void
set_input_focus
()
{}
virtual
void
trace_start
()
{}
virtual
void
beep
()
{}
void
zoom
(
double
zoom_factor
);
void
unzoom
();
void
set_nodraw
();
void
reset_nodraw
();
void
read
();
void
draw
();
int
update_nodes
();
void
force_trace_scan
();
void
message
(
pwr_tStatus
sts
,
char
*
node
,
int
idx
,
char
*
text
);
int
select_node
(
int
idx
);
void
remove_node
(
char
*
name
);
int
get_selected_node
(
char
*
name
);
void
save
();
void
add_node
(
char
*
name
);
static
void
attrvalue_to_string
(
int
type_id
,
void
*
value_ptr
,
char
*
str
,
int
size
,
int
*
len
,
char
*
format
);
static
int
init_brow_cb
(
FlowCtx
*
fctx
,
void
*
client_data
);
static
int
brow_cb
(
FlowCtx
*
ctx
,
flow_tEvent
event
);
static
int
trace_scan_bc
(
brow_tObject
object
,
void
*
p
);
static
int
trace_connect_bc
(
brow_tObject
object
,
char
*
name
,
char
*
attr
,
flow_eTraceType
type
,
void
**
p
);
static
int
trace_disconnect_bc
(
brow_tObject
object
);
};
class
ItemBase
{
public:
ItemBase
(
NodelistNav
*
item_nodelistnav
,
char
*
item_name
)
:
nodelistnav
(
item_nodelistnav
)
{
strcpy
(
name
,
item_name
);
}
virtual
~
ItemBase
()
{}
nodelistnav_eItemType
type
;
NodelistNav
*
nodelistnav
;
brow_tNode
node
;
char
name
[
120
];
virtual
int
open_children
(
NodelistNav
*
nodelistnav
,
double
x
,
double
y
)
{
return
1
;}
virtual
int
close
(
NodelistNav
*
nodelistnav
,
double
x
,
double
y
)
{
return
1
;}
};
class
ItemNode
:
public
ItemBase
{
public:
ItemNode
(
NodelistNav
*
item_nodelistnav
,
char
*
item_name
,
brow_tNode
dest
,
flow_eDest
dest_code
);
NodeData
data
;
statussrv_sGetExtStatus
xdata
;
int
syssts_open
;
int
open_children
(
NodelistNav
*
nodelistnav
,
double
x
,
double
y
);
int
close
(
NodelistNav
*
nodelistnav
,
double
x
,
double
y
);
int
update_color
(
NodelistNav
*
nodelistnav
,
pwr_tStatus
sts
);
};
//! Item for a normal attribute.
class
ItemAttr
:
public
ItemBase
{
public:
ItemAttr
(
NodelistNav
*
item_nodelistnav
,
char
*
item_name
,
char
*
attr
,
int
attr_type
,
int
attr_size
,
void
*
attr_value_p
,
brow_tNode
dest
,
flow_eDest
dest_code
);
void
*
value_p
;
char
old_value
[
120
];
int
first_scan
;
int
type_id
;
int
size
;
};
//! Item for a system status attribute.
class
ItemAttrSysSts
:
public
ItemBase
{
public:
ItemAttrSysSts
(
NodelistNav
*
item_nodelistnav
,
char
*
item_name
,
char
*
attr
,
int
attr_type
,
int
attr_size
,
void
*
attr_value_p
,
void
*
attr_status_p
,
ItemNode
*
attr_parent
,
brow_tNode
dest
,
flow_eDest
dest_code
);
void
*
value_p
;
void
*
status_p
;
char
old_value
[
120
];
int
first_scan
;
int
type_id
;
int
size
;
ItemNode
*
parent
;
virtual
int
open_children
(
NodelistNav
*
nodelistnav
,
double
x
,
double
y
);
virtual
int
close
(
NodelistNav
*
nodelistnav
,
double
x
,
double
y
);
};
//! Item for a server status attribute.
class
ItemAttrSts
:
public
ItemBase
{
public:
ItemAttrSts
(
NodelistNav
*
item_nodelistnav
,
char
*
item_name
,
char
*
attr
,
char
*
attr_value_p
,
pwr_tStatus
*
attr_status_p
,
char
*
attr_name_p
,
ItemAttrSysSts
*
attr_parent
,
brow_tNode
dest
,
flow_eDest
dest_code
);
char
*
value_p
;
pwr_tStatus
*
status_p
;
char
*
name_p
;
char
old_value
[
120
];
char
old_name
[
120
];
int
first_scan
;
int
type_id
;
int
size
;
ItemAttrSysSts
*
parent
;
};
#endif
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