Commit 1d3cdc79 authored by Claes Sjofors's avatar Claes Sjofors

New configuration of operator window, and new menu

parent 18f9fbbf
wb/mmi/wb/src/wtt_ge.png

520 Bytes | W: | H:

wb/mmi/wb/src/wtt_ge.png

431 Bytes | W: | H:

wb/mmi/wb/src/wtt_ge.png
wb/mmi/wb/src/wtt_ge.png
wb/mmi/wb/src/wtt_ge.png
wb/mmi/wb/src/wtt_ge.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -555,8 +555,6 @@ int main( int argc, char *argv[])
{
int sts;
gtk_init( &argc, &argv);
setlocale( LC_TIME, "en_US");
new XttGtk( argc, argv, &sts);
......@@ -585,7 +583,7 @@ static void destroy_event( GtkWidget *w, gpointer data)
}
XttGtk::XttGtk( int argc, char *argv[], int *return_sts) :
Xtt( argc, argv, return_sts)
Xtt( &argc, &argv, return_sts)
{
const int window_width = 400;
const int window_height = 700;
......@@ -594,6 +592,8 @@ XttGtk::XttGtk( int argc, char *argv[], int *return_sts) :
char title[120] = "Xtt ";
char nodename[80];
gtk_init( &argc, &argv);
syi_NodeName( &sts, nodename, sizeof(nodename));
if ( ODD(sts))
strcat( title, nodename);
......
......@@ -67,7 +67,7 @@ class Xtt {
int op_close_button;
int no_advanceduser;
Xtt( int argc, char *argv[], int *return_sts);
Xtt( int *argc, char **argv[], int *return_sts);
virtual ~Xtt() {}
virtual void message( char severity, const char *msg) {}
virtual void open_input_dialog( const char *text, const char *title,
......
......@@ -34,6 +34,7 @@
#include "co_time.h"
#include "co_dcli.h"
#include "co_lng.h"
#include "co_syi.h"
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
......@@ -453,7 +454,7 @@ void Xtt::activate_help_proview()
CoXHelp::dhelp( "version", "", navh_eHelpFile_Other, "$pwr_exe/xtt_version_help.dat", 0);
}
Xtt::Xtt( int argc, char *argv[], int *return_sts) :
Xtt::Xtt( int *argc, char **argv[], int *return_sts) :
root_item(0), input_open(0), command_open(0), india_ok_cb(0), queid(qcom_cNQid), quiet(0), attach_audio(0), select_opplace(0), op_close_button(0), no_advanceduser(0)
{
pwr_tStatus sts;
......@@ -462,6 +463,9 @@ Xtt::Xtt( int argc, char *argv[], int *return_sts) :
pwr_tObjid op_objid;
qcom_sQattr qAttr;
qcom_sQid qini;
char language[20] = "";
static char display[80];
static char display_opt[20] = "--display";
strcpy( opplace_str, "");
hot_xtt = this;
......@@ -493,25 +497,23 @@ Xtt::Xtt( int argc, char *argv[], int *return_sts) :
}
// Set language
for ( i = 1; i < argc; i++) {
if ( strcmp( argv[i], "-l") == 0 && i + 1 < argc)
Lng::set( argv[i+1]);
else if ( strcmp( argv[i], "-q") == 0) {
CoWow::HideWarranty();
for ( i = 1; i < *argc; i++) {
if ( strcmp( (*argv)[i], "-l") == 0 && i + 1 < *argc)
strncpy( language, (*argv)[i+1], sizeof(language));
else if ( strcmp( (*argv)[i], "-q") == 0)
quiet = 1;
}
else if ( strcmp( argv[i], "-a") == 0)
else if ( strcmp( (*argv)[i], "-a") == 0)
attach_audio = 1;
else if ( strcmp( argv[i], "-s") == 0)
else if ( strcmp( (*argv)[i], "-s") == 0)
select_opplace = 1;
else if ( strcmp( argv[i], "-c") == 0)
else if ( strcmp( (*argv)[i], "-c") == 0)
op_close_button = 1;
else if ( strcmp( argv[i], "-d") == 0)
else if ( strcmp( (*argv)[i], "-d") == 0)
no_advanceduser = 1;
else if ( strcmp( argv[i], "-u") == 0 && i + 1 < argc) {
else if ( strcmp( (*argv)[i], "-u") == 0 && i + 1 < *argc) {
char oname[80];
strcpy( opplace_str, argv[i+1]);
strcpy( opplace_str, (*argv)[i+1]);
sts = gdh_GetClassList( pwr_cClass_OpPlace, &op_objid);
while (ODD(sts)) {
......@@ -530,11 +532,11 @@ Xtt::Xtt( int argc, char *argv[], int *return_sts) :
}
}
if ( !opplace_found && argc >= 2 && strncmp( argv[1], "-", 1) != 0) {
if ( !opplace_found && *argc >= 2 && strncmp( (*argv)[1], "-", 1) != 0) {
pwr_tClassId op_class;
// First argument is opplace object
strcpy( opplace_str, argv[1]);
strcpy( opplace_str, (*argv)[1]);
sts = gdh_NameToObjid( opplace_str, &op_objid);
if ( EVEN(sts)) {
......@@ -552,6 +554,82 @@ Xtt::Xtt( int argc, char *argv[], int *return_sts) :
opplace_found = 1;
}
else {
// Look for default opplace
pwr_tOid oid;
pwr_tOName name;
for ( sts = gdh_GetClassList( pwr_cClass_OpPlace, &oid);
ODD(sts);
sts = gdh_GetNextObject( oid, &oid)) {
sts = gdh_ObjidToName( oid, name, sizeof(name), cdh_mName_object);
if ( ODD(sts) && cdh_NoCaseStrcmp( name, "opdefault") == 0) {
sts = gdh_ObjidToName( oid, name, sizeof(name), cdh_mNName);
if ( EVEN(sts)) exit(sts);
strcpy( opplace_str, name);
opplace_found = 1;
break;
}
}
}
if ( opplace_found) {
pwr_sClass_OpPlace *opp;
char opsys_user[40];
sts = gdh_NameToPointer( opplace_str, (void **)&opp);
if ( EVEN(sts)) exit(sts);
if ( strcmp( opp->DedicatedOpsysUser, "") != 0) {
sts = syi_UserName( opsys_user, sizeof(opsys_user));
if ( EVEN(sts)) exit(sts);
if ( strcmp( opp->DedicatedOpsysUser, opsys_user) != 0) {
printf( "Operator place is dedicated for another user\n");
exit(0);
}
}
if ( strcmp( language, "") == 0) {
switch ( opp->Language) {
case pwr_eLanguageEnum_Swedish:
strcpy( language, "sv_se");
break;
case pwr_eLanguageEnum_German:
strcpy( language, "de_de");
break;
case pwr_eLanguageEnum_French:
strcpy( language, "fr_fr");
break;
default:
strcpy( language, "");
}
}
if ( strcmp( opp->Display, "") != 0) {
strncpy( display, opp->Display, sizeof(display));
char **argv1 = (char **)calloc( *argc + 3, sizeof(*argv1));
for ( int i = 0; i < *argc; i++)
argv1[i] = (*argv)[i];
argv1[*argc] = display_opt;
argv1[*argc+1] = display;
argv1[*argc+2] = 0;
(*argc) += 2;
*argv = argv1;
}
if ( opp->OpWindLayout & pwr_mOpWindLayoutMask_HideLicenceWindow)
quiet = 1;
if ( opp->AttachAudio)
attach_audio = 1;
}
if ( quiet)
CoWow::HideWarranty();
if ( strcmp( language, "") != 0)
Lng::set( language);
}
void Xtt::opplace_selected_cb( void *ctx, char *text)
......
......@@ -58,7 +58,7 @@ CLogGtk::CLogGtk( void *clog_parent_ctx,
toplevel = (GtkWidget *) g_object_new( GTK_TYPE_WINDOW,
"default-height", 800,
"default-width", 1000,
"title", clog_name,
"title", CoWowGtk::translate_utf8(clog_name),
NULL);
g_signal_connect( toplevel, "delete_event", G_CALLBACK(delete_event), this);
......@@ -156,7 +156,7 @@ CLogGtk::CLogGtk( void *clog_parent_ctx,
// Menu Help
GtkWidget *help_help = gtk_image_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Help on ConsoleLog"));
GtkWidget *help_help = gtk_image_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Help on System Messages"));
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(help_help),
gtk_image_new_from_stock( "gtk-help", GTK_ICON_SIZE_MENU));
g_signal_connect(help_help, "activate", G_CALLBACK(activate_help), this);
......
......@@ -81,13 +81,14 @@ EvGtk::EvGtk( void *ev_parent_ctx,
int display_return,
int display_ack,
int ev_beep,
pwr_tMask ev_pop_mask,
pwr_tStatus *status) :
Ev( ev_parent_ctx, eve_name, ala_name, blk_name, ev_user, display_ala, display_eve,
display_blk, display_return, display_ack, ev_beep, status),
display_blk, display_return, display_ack, ev_beep, ev_pop_mask, status),
parent_wid(ev_parent_wid), parent_wid_eve(NULL), parent_wid_ala(NULL)
{
pwr_tStatus sts;
pwr_sClass_User *userobject_ptr;
pwr_sClass_OpPlace *userobject_ptr;
const int eve_width = 700;
const int eve_height = 600;
const int ala_width = 700;
......
......@@ -41,6 +41,7 @@ class EvGtk : public Ev {
int display_return,
int display_ack,
int ev_beep,
pwr_tMask ev_pop_mask,
pwr_tStatus *status);
~EvGtk();
......
......@@ -27,6 +27,7 @@ typedef void *Widget;
#include "glow.h"
#include "xtt_xnav.h"
#include "rt_gdh.h"
#include "rt_gdh_msg.h"
#include "co_cdh.h"
......@@ -39,7 +40,6 @@ typedef void *Widget;
#include "co_lng.h"
#include "xtt_ge_gtk.h"
#include "ge_graph_gtk.h"
#include "xtt_xnav.h"
gboolean XttGeGtk::action_inputfocus( GtkWidget *w, GdkEvent *event, gpointer data)
{
......
......@@ -261,65 +261,277 @@ OpGtk::OpGtk( void *op_parent_ctx,
gtk_box_pack_start( GTK_BOX(vbox_ala), gtk_hseparator_new(), FALSE, FALSE, 2);
gtk_box_pack_end( GTK_BOX(vbox_ala), hbox_b, FALSE, FALSE, 0);
// Menu
// Accelerators
GtkAccelGroup *accel_g = (GtkAccelGroup *) g_object_new(GTK_TYPE_ACCEL_GROUP, NULL);
gtk_window_add_accel_group(GTK_WINDOW(toplevel), accel_g);
menu_bar = (GtkMenuBar *) g_object_new(GTK_TYPE_MENU_BAR, NULL);
// Functions entry
// Submenu Alarm
GtkWidget *functions_alarm_alarmlist = gtk_image_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_AlarmList"));
dcli_translate_filename( fname, "$pwr_exe/xtt_alarmlist.png");
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(functions_alarm_alarmlist),
gtk_image_new_from_file( fname));
g_signal_connect( functions_alarm_alarmlist, "activate",
G_CALLBACK(activate_alarmlist), this);
GtkWidget *functions_alarm_eventlist = gtk_image_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_EventList"));
dcli_translate_filename( fname, "$pwr_exe/xtt_eventlist.png");
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(functions_alarm_eventlist),
gtk_image_new_from_file( fname));
g_signal_connect( functions_alarm_eventlist, "activate",
G_CALLBACK(activate_eventlist), this);
GtkWidget *functions_alarm_eventlog = gtk_image_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("Event_Log"));
dcli_translate_filename( fname, "$pwr_exe/xtt_eventlog.png");
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(functions_alarm_eventlog),
gtk_image_new_from_file( fname));
g_signal_connect( functions_alarm_eventlog, "activate",
G_CALLBACK(activate_eventlog), this);
GtkWidget *functions_alarm_blocklist = gtk_image_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_BlockList"));
dcli_translate_filename( fname, "$pwr_exe/xtt_blocklist.png");
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(functions_alarm_blocklist),
gtk_image_new_from_file( fname));
g_signal_connect( functions_alarm_blocklist, "activate",
G_CALLBACK(activate_blocklist), this);
GtkWidget *functions_alarm = gtk_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_Alarm"));
GtkMenu *functions_alarm_menu = (GtkMenu *) g_object_new( GTK_TYPE_MENU, NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_alarm_menu), functions_alarm_alarmlist);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_alarm_menu), functions_alarm_eventlist);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_alarm_menu), functions_alarm_eventlog);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_alarm_menu), functions_alarm_blocklist);
gtk_menu_item_set_submenu(GTK_MENU_ITEM(functions_alarm),
GTK_WIDGET(functions_alarm_menu));
// End Alarm submenu
// Submenu Curves
GtkWidget *functions_curves_trend = gtk_image_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_Trends"));
dcli_translate_filename( fname, "$pwr_exe/xtt_meth_trend.png");
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(functions_curves_trend),
gtk_image_new_from_file( fname));
g_signal_connect( functions_curves_trend, "activate",
G_CALLBACK(activate_trend), this);
GtkWidget *functions_curves_fast = gtk_image_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_Fast"));
dcli_translate_filename( fname, "$pwr_exe/xtt_meth_fast.png");
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(functions_curves_fast),
gtk_image_new_from_file( fname));
g_signal_connect( functions_curves_fast, "activate",
G_CALLBACK(activate_fast), this);
GtkWidget *functions_curves_history = gtk_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_Process History"));
g_signal_connect( functions_curves_history, "activate",
G_CALLBACK(activate_history), this);
GtkWidget *functions_curves = gtk_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_Curves"));
GtkMenu *functions_curves_menu = (GtkMenu *) g_object_new( GTK_TYPE_MENU, NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_curves_menu), functions_curves_trend);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_curves_menu), functions_curves_fast);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_curves_menu), functions_curves_history);
gtk_menu_item_set_submenu(GTK_MENU_ITEM(functions_curves),
GTK_WIDGET(functions_curves_menu));
// End Curves submenu
// Submenu View
GtkWidget *functions_view_incr = gtk_image_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_Larger Text"));
dcli_translate_filename( fname, "$pwr_exe/xtt_zoom_in.png");
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(functions_view_incr),
gtk_image_new_from_file( fname));
g_signal_connect( functions_view_incr, "activate",
G_CALLBACK(activate_zoom_in), this);
GtkWidget *functions_view_decr = gtk_image_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_Smaller Text"));
dcli_translate_filename( fname, "$pwr_exe/xtt_zoom_out.png");
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(functions_view_decr),
gtk_image_new_from_file( fname));
g_signal_connect( functions_view_decr, "activate",
G_CALLBACK(activate_zoom_out), this);
GtkWidget *functions_view = gtk_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_View"));
GtkMenu *functions_view_menu = (GtkMenu *) g_object_new( GTK_TYPE_MENU, NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_view_menu), functions_view_incr);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_view_menu), functions_view_decr);
gtk_menu_item_set_submenu(GTK_MENU_ITEM(functions_view),
GTK_WIDGET(functions_view_menu));
// End View submenu
// Submenu User
GtkWidget *functions_user_switch = gtk_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("S_witch User"));
g_signal_connect( functions_user_switch, "activate",
G_CALLBACK(activate_switch_user), this);
GtkWidget *functions_user_show = gtk_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_Show User"));
g_signal_connect( functions_user_show, "activate",
G_CALLBACK(activate_show_user), this);
GtkWidget *functions_user_logout = gtk_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_Return"));
g_signal_connect( functions_user_logout, "activate",
G_CALLBACK(activate_logout), this);
GtkWidget *functions_user = gtk_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_User"));
GtkMenu *functions_user_menu = (GtkMenu *) g_object_new( GTK_TYPE_MENU, NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_user_menu), functions_user_switch);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_user_menu), functions_user_show);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_user_menu), functions_user_logout);
gtk_menu_item_set_submenu(GTK_MENU_ITEM(functions_user),
GTK_WIDGET(functions_user_menu));
// End User submenu
GtkWidget *functions_navigator = gtk_image_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_Navigator"));
dcli_translate_filename( fname, "$pwr_exe/xtt_navigator.png");
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(functions_navigator),
gtk_image_new_from_file( fname));
g_signal_connect( functions_navigator, "activate",
G_CALLBACK(activate_navigator), this);
gtk_widget_add_accelerator( functions_navigator, "activate", accel_g,
'd', GdkModifierType(GDK_CONTROL_MASK), GTK_ACCEL_VISIBLE);
GtkWidget *functions_graph = gtk_image_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_Process Graphics"));
dcli_translate_filename( fname, "$pwr_exe/wtt_ge.png"); //TODO
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(functions_graph),
gtk_image_new_from_file( fname));
g_signal_connect( functions_graph, "activate",
G_CALLBACK(activate_graph), this);
gtk_widget_add_accelerator( functions_graph, "activate", accel_g,
'g', GdkModifierType(GDK_CONTROL_MASK), GTK_ACCEL_VISIBLE);
// Submenu Help
GtkWidget *functions_help_project = gtk_image_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_Project"));
dcli_translate_filename( fname, "$pwr_exe/xtt_help.png");
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(functions_help_project),
gtk_image_new_from_file( fname));
g_signal_connect( functions_help_project, "activate",
G_CALLBACK(activate_help), this);
GtkWidget *functions_help_overview = gtk_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_Overview"));
g_signal_connect( functions_help_overview, "activate",
G_CALLBACK(activate_help_overview), this);
GtkWidget *functions_help_opwin = gtk_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_OperatorWindow"));
g_signal_connect( functions_help_opwin, "activate",
G_CALLBACK(activate_help_opwin), this);
GtkWidget *functions_help_proview = gtk_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_About Proview"));
g_signal_connect( functions_help_proview, "activate",
G_CALLBACK(activate_help_proview), this);
GtkWidget *functions_help = gtk_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_Help"));
GtkMenu *functions_help_menu = (GtkMenu *) g_object_new( GTK_TYPE_MENU, NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_help_menu), functions_help_project);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_help_menu), functions_help_overview);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_help_menu), functions_help_opwin);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_help_menu), functions_help_proview);
gtk_menu_item_set_submenu(GTK_MENU_ITEM(functions_help),
GTK_WIDGET(functions_help_menu));
// End Help submenu
GtkWidget *functions_close = gtk_image_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_Close"));
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(functions_close),
gtk_image_new_from_stock( "gtk-close", GTK_ICON_SIZE_MENU));
g_signal_connect(functions_close, "activate", G_CALLBACK(activate_exit), this);
gtk_widget_add_accelerator( functions_close, "activate", accel_g,
'w', GdkModifierType(GDK_CONTROL_MASK), GTK_ACCEL_VISIBLE);
GtkMenu *functions_menu = (GtkMenu *) g_object_new( GTK_TYPE_MENU, NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), functions_alarm);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), functions_curves);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), functions_graph);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), functions_navigator);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), functions_view);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), functions_user);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), functions_help);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), functions_close);
GtkWidget *functions = gtk_image_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Functions"));
dcli_translate_filename( fname, "$pwr_exe/xtt_down.png");
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(functions),
gtk_image_new_from_file( fname));
gtk_menu_shell_append(GTK_MENU_SHELL(menu_bar), functions);
gtk_menu_item_set_submenu(GTK_MENU_ITEM(functions), GTK_WIDGET(functions_menu));
// Toolbar
GtkWidget *tools = (GtkWidget *) g_object_new(GTK_TYPE_TOOLBAR, NULL);
GtkWidget *tools2 = (GtkWidget *) g_object_new(GTK_TYPE_TOOLBAR, NULL);
GtkWidget *tools_zoom_in = gtk_button_new();
dcli_translate_filename( fname, "$pwr_exe/xtt_zoom_in.png");
gtk_container_add( GTK_CONTAINER(tools_zoom_in),
gtk_image_new_from_file( fname));
g_signal_connect(tools_zoom_in, "clicked", G_CALLBACK(activate_zoom_in), this);
gtk_toolbar_append_widget( GTK_TOOLBAR(tools), tools_zoom_in, "Zoom in", "");
gtk_toolbar_append_widget( GTK_TOOLBAR(tools), tools_zoom_in, CoWowGtk::translate_utf8("Larger Text"), "");
GtkWidget *tools_zoom_out = gtk_button_new();
dcli_translate_filename( fname, "$pwr_exe/xtt_zoom_out.png");
gtk_container_add( GTK_CONTAINER(tools_zoom_out),
gtk_image_new_from_file( fname));
g_signal_connect(tools_zoom_out, "clicked", G_CALLBACK(activate_zoom_out), this);
gtk_toolbar_append_widget( GTK_TOOLBAR(tools), tools_zoom_out, "Zoom out", "");
gtk_toolbar_append_widget( GTK_TOOLBAR(tools), tools_zoom_out, CoWowGtk::translate_utf8("Smaller Text"), "");
GtkWidget *tools_help = gtk_button_new();
dcli_translate_filename( fname, "$pwr_exe/xtt_help.png");
gtk_container_add( GTK_CONTAINER(tools_help),
gtk_image_new_from_stock( "gtk-help", GTK_ICON_SIZE_SMALL_TOOLBAR));
g_signal_connect(tools_help, "clicked", G_CALLBACK(activate_help_overview), this);
gtk_toolbar_append_widget( GTK_TOOLBAR(tools), tools_help, "Help", "");
GtkWidget *tools_navigator = gtk_button_new();
dcli_translate_filename( fname, "$pwr_exe/xtt_navigator.png");
gtk_container_add( GTK_CONTAINER( tools_navigator),
gtk_image_new_from_file( fname));
g_signal_connect(tools_navigator, "clicked", G_CALLBACK(activate_navigator), this);
gtk_toolbar_append_widget( GTK_TOOLBAR(tools), tools_navigator, "Open Navigator", "");
g_signal_connect(tools_help, "clicked", G_CALLBACK(activate_help), this);
gtk_toolbar_append_widget( GTK_TOOLBAR(tools), tools_help, CoWowGtk::translate_utf8("Help"), "");
tools_close = gtk_button_new();
dcli_translate_filename( fname, "$pwr_exe/xtt_close.png");
gtk_container_add( GTK_CONTAINER(tools_close),
gtk_image_new_from_stock( "gtk-close", GTK_ICON_SIZE_SMALL_TOOLBAR));
gtk_image_new_from_file( fname));
g_signal_connect(tools_close, "clicked", G_CALLBACK(activate_exit), this);
gtk_toolbar_append_widget( GTK_TOOLBAR(tools), tools_close, "Close", "");
gtk_toolbar_append_widget( GTK_TOOLBAR(tools), tools_close, CoWowGtk::translate_utf8("Close"), "");
// System pushbuttons
GtkWidget *alarmlist_button = gtk_button_new_with_label( CoWowGtk::translate_utf8("Alarmlist"));
gtk_widget_set_size_request( alarmlist_button, 90, 25);
g_signal_connect( alarmlist_button, "clicked", G_CALLBACK(activate_alarmlist), this);
GtkWidget *tools_alarmlist = gtk_button_new();
dcli_translate_filename( fname, "$pwr_exe/xtt_alarmlist.png");
gtk_container_add( GTK_CONTAINER(tools_alarmlist),
gtk_image_new_from_file( fname));
g_signal_connect(tools_alarmlist, "clicked", G_CALLBACK(activate_alarmlist), this);
gtk_toolbar_append_widget( GTK_TOOLBAR(tools2), tools_alarmlist, CoWowGtk::translate_utf8("AlarmList"), "");
GtkWidget *tools_eventlist = gtk_button_new();
dcli_translate_filename( fname, "$pwr_exe/xtt_eventlist.png");
gtk_container_add( GTK_CONTAINER(tools_eventlist),
gtk_image_new_from_file( fname));
g_signal_connect(tools_eventlist, "clicked", G_CALLBACK(activate_eventlist), this);
gtk_toolbar_append_widget( GTK_TOOLBAR(tools2), tools_eventlist, CoWowGtk::translate_utf8("EventList"), "");
GtkWidget *tools_eventlog = gtk_button_new();
dcli_translate_filename( fname, "$pwr_exe/xtt_eventlog.png");
gtk_container_add( GTK_CONTAINER(tools_eventlog),
gtk_image_new_from_file( fname));
g_signal_connect(tools_eventlog, "clicked", G_CALLBACK(activate_eventlog), this);
gtk_toolbar_append_widget( GTK_TOOLBAR(tools2), tools_eventlog, CoWowGtk::translate_utf8("EventLog"), "");
GtkWidget *eventlist_button = gtk_button_new_with_label( CoWowGtk::translate_utf8("Eventlist"));
gtk_widget_set_size_request( eventlist_button, 90, 25);
g_signal_connect( eventlist_button, "clicked", G_CALLBACK(activate_eventlist), this);
GtkWidget *tools_blocklist = gtk_button_new();
dcli_translate_filename( fname, "$pwr_exe/xtt_blocklist.png");
gtk_container_add( GTK_CONTAINER(tools_blocklist),
gtk_image_new_from_file( fname));
g_signal_connect(tools_blocklist, "clicked", G_CALLBACK(activate_blocklist), this);
gtk_toolbar_append_widget( GTK_TOOLBAR(tools2), tools_blocklist, CoWowGtk::translate_utf8("Blocked Alarms"), "");
eventlog_button = gtk_button_new_with_label( CoWowGtk::translate_utf8("Eventlog"));
gtk_widget_set_size_request( eventlog_button, 90, 25);
g_signal_connect( eventlog_button, "clicked", G_CALLBACK(activate_eventlog), this);
GtkWidget *tools_navigator = gtk_button_new();
dcli_translate_filename( fname, "$pwr_exe/xtt_navigator.png");
gtk_container_add( GTK_CONTAINER( tools_navigator),
gtk_image_new_from_file( fname));
g_signal_connect(tools_navigator, "clicked", G_CALLBACK(activate_navigator), this);
gtk_toolbar_append_widget( GTK_TOOLBAR(tools2), tools_navigator, CoWowGtk::translate_utf8("Navigator"), "");
help_button = gtk_button_new_with_label( CoWowGtk::translate_utf8("Help"));
gtk_widget_set_size_request( help_button, 90, 25);
g_signal_connect( help_button, "clicked", G_CALLBACK(activate_help), this);
// System pushbuttons
GtkWidget *sysbutton_box = gtk_vbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX(sysbutton_box), GTK_WIDGET(menu_bar), FALSE, FALSE, 0);
gtk_box_pack_start( GTK_BOX(sysbutton_box), GTK_WIDGET(tools), FALSE, FALSE, 0);
gtk_box_pack_start( GTK_BOX(sysbutton_box), alarmlist_button, FALSE, FALSE, 0);
gtk_box_pack_start( GTK_BOX(sysbutton_box), eventlist_button, FALSE, FALSE, 0);
gtk_box_pack_start( GTK_BOX(sysbutton_box), eventlog_button, FALSE, FALSE, 0);
gtk_box_pack_start( GTK_BOX(sysbutton_box), help_button, FALSE, FALSE, 0);
gtk_box_pack_start( GTK_BOX(sysbutton_box), GTK_WIDGET(tools2), FALSE, FALSE, 0);
gtk_widget_set_size_request( sysbutton_box, 160, -1);
// Main window
......@@ -356,11 +568,19 @@ OpGtk::OpGtk( void *op_parent_ctx,
g_object_set( aalarm_box[3], "visible", FALSE, NULL);
g_object_set( aalarm_box[4], "visible", FALSE, NULL);
g_object_set( balarm_box, "visible", FALSE, NULL);
g_object_set( help_button, "visible", FALSE, NULL);
g_object_set( eventlog_button, "visible", FALSE, NULL);
// g_object_set( help_button, "visible", FALSE, NULL);
// g_object_set( eventlog_button, "visible", FALSE, NULL);
g_object_set( decr_button, "visible", FALSE, NULL);
g_object_set( tools_close, "visible", FALSE, NULL);
if ( a_height == 5)
activate_aalarm_decr( 0, this);
if ( a_height == 4) {
// g_object_set( decr_button, "visible", TRUE, NULL);
activate_aalarm_decr( 0, this);
activate_aalarm_decr( 0, this);
}
int width, height;
GdkWindow *rootwindow = gtk_widget_get_root_window( toplevel);
gdk_drawable_get_size( rootwindow, &width, &height);
......@@ -403,6 +623,27 @@ void OpGtk::add_close_button()
g_object_set( tools_close, "visible", TRUE, NULL);
}
int OpGtk::create_menu_item( const char *name, int pixmap, int append, const char *cmd)
{
GtkWidget *w;
int sts;
sts = wow->CreateMenuItem( name, (void *) menu_bar, pixmap, append, (void *)&w);
if ( EVEN(sts)) return sts;
OpCmd opcmd( w, cmd);
cmd_vect.push_back(opcmd);
g_signal_connect(w, "activate", G_CALLBACK(activate_cmd_menu_item), this);
return 1;
}
int OpGtk::delete_menu_item( const char *name)
{
return wow->DeleteMenuItem( "Functions-View", (void *) menu_bar);
}
void OpGtk::update_alarm_info()
{
evlist_sAlarmInfo info;
......@@ -564,9 +805,7 @@ int OpGtk::configure( char *opplace_str)
int sts;
unsigned int i;
pwr_tObjid opplace;
pwr_tObjid user;
pwr_sClass_OpPlace *opplace_p;
pwr_sClass_User *user_p;
pwr_sAttrRef attrref;
pwr_tTid tid;
......@@ -576,31 +815,18 @@ int OpGtk::configure( char *opplace_str)
sts = gdh_ObjidToPointer( opplace, (void **) &opplace_p);
if ( EVEN(sts)) return sts;
// Fix
if ( strncmp( opplace_p->OpWinProgram, "Jop", 3) == 0)
if ( opplace_p->StartJavaProcess)
start_jop = 1;
// Find matching user object
sts = gdh_GetClassList( pwr_cClass_User, &user);
while ( ODD (sts)) {
sts = gdh_ObjidToPointer( user, (void **) &user_p);
if ( EVEN(sts)) return sts;
if ( user_p->OpNumber == opplace_p->OpNumber)
break;
sts = gdh_GetNextObject( user, &user);
}
if ( EVEN(sts)) return sts;
// Examine Graph objects
for ( i = 0; i < sizeof(user_p->FastAvail)/sizeof(user_p->FastAvail[0]); i++) {
for ( i = 0; i < sizeof(opplace_p->FastAvail)/sizeof(opplace_p->FastAvail[0]); i++) {
button_aref[i].Objid = pwr_cNOid;
if ( cdh_ObjidIsNull( user_p->FastAvail[i].Objid))
if ( cdh_ObjidIsNull( opplace_p->FastAvail[i].Objid))
continue;
sts = gdh_GetAttrRefTid( &user_p->FastAvail[i], &tid);
sts = gdh_GetAttrRefTid( &opplace_p->FastAvail[i], &tid);
if ( EVEN(sts))continue;
if ( tid != pwr_cClass_XttGraph)
......@@ -610,24 +836,24 @@ int OpGtk::configure( char *opplace_str)
sts = gdh_ClassAttrToAttrref( pwr_cClass_XttGraph, ".ButtonText", &attrref);
if ( EVEN(sts)) return sts;
attrref = cdh_ArefAdd( &user_p->FastAvail[i], &attrref);
attrref = cdh_ArefAdd( &opplace_p->FastAvail[i], &attrref);
sts = gdh_GetObjectInfoAttrref( &attrref, (void *)button_title[i],
sizeof(button_title[0]));
if ( EVEN(sts)) continue;
if ( strcmp( button_title[i], "") == 0) {
// Take object name instead
sts = gdh_AttrrefToName( &user_p->FastAvail[i], button_title[i], sizeof(button_title[0]),
sts = gdh_AttrrefToName( &opplace_p->FastAvail[i], button_title[i], sizeof(button_title[0]),
cdh_mName_object);
if ( EVEN(sts)) continue;
}
button_aref[i] = user_p->FastAvail[i];
button_aref[i] = opplace_p->FastAvail[i];
}
// Create the application buttons
GtkWidget *b[15];
for ( i = 0; i < sizeof(user_p->FastAvail)/sizeof(user_p->FastAvail[0]); i++) {
GtkWidget *b[25];
for ( i = 0; i < sizeof(opplace_p->FastAvail)/sizeof(opplace_p->FastAvail[0]); i++) {
if ( cdh_ObjidIsNull( button_aref[i].Objid))
continue;
......@@ -681,36 +907,85 @@ int OpGtk::configure( char *opplace_str)
case 14:
g_signal_connect( b[i], "clicked", G_CALLBACK(activate_appl15), this);
break;
case 15:
g_signal_connect( b[i], "clicked", G_CALLBACK(activate_appl16), this);
break;
case 16:
g_signal_connect( b[i], "clicked", G_CALLBACK(activate_appl17), this);
break;
case 17:
g_signal_connect( b[i], "clicked", G_CALLBACK(activate_appl18), this);
break;
case 18:
g_signal_connect( b[i], "clicked", G_CALLBACK(activate_appl19), this);
break;
case 19:
g_signal_connect( b[i], "clicked", G_CALLBACK(activate_appl20), this);
break;
case 20:
g_signal_connect( b[i], "clicked", G_CALLBACK(activate_appl21), this);
break;
case 21:
g_signal_connect( b[i], "clicked", G_CALLBACK(activate_appl22), this);
break;
case 22:
g_signal_connect( b[i], "clicked", G_CALLBACK(activate_appl23), this);
break;
case 23:
g_signal_connect( b[i], "clicked", G_CALLBACK(activate_appl24), this);
break;
case 24:
g_signal_connect( b[i], "clicked", G_CALLBACK(activate_appl25), this);
break;
}
}
appl_form = gtk_vbox_new( FALSE, 0);
GtkWidget *bbox[3];
for ( i = 0; i < sizeof(user_p->FastAvail)/sizeof(user_p->FastAvail[0]); i++) {
for ( i = 0; i < sizeof(opplace_p->FastAvail)/sizeof(opplace_p->FastAvail[0]); i++) {
if ( i == 0) {
bbox[0] = gtk_hbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX(appl_form), bbox[0], FALSE, FALSE, 0);
funcbox[0] = gtk_hbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX(appl_form), funcbox[0], FALSE, FALSE, 0);
}
else if ( i == 4) {
bbox[1] = gtk_hbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX(appl_form), bbox[1], FALSE, FALSE, 0);
funcbox[1] = gtk_hbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX(appl_form), funcbox[1], FALSE, FALSE, 0);
}
else if ( i == 9) {
bbox[2] = gtk_hbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX(appl_form), bbox[2], FALSE, FALSE, 0);
funcbox[2] = gtk_hbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX(appl_form), funcbox[2], FALSE, FALSE, 0);
}
else if ( i == 14) {
funcbox[3] = gtk_hbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX(appl_form), funcbox[3], FALSE, FALSE, 0);
}
else if ( i == 19) {
funcbox[4] = gtk_hbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX(appl_form), funcbox[4], FALSE, FALSE, 0);
}
if ( i < 5) {
if ( cdh_ObjidIsNotNull( button_aref[i].Objid))
gtk_box_pack_start( GTK_BOX(bbox[0]), b[i], TRUE, TRUE, 0);
gtk_box_pack_start( GTK_BOX(funcbox[0]), b[i], TRUE, TRUE, 0);
}
else if ( i < 10) {
if ( cdh_ObjidIsNotNull( button_aref[i].Objid))
gtk_box_pack_start( GTK_BOX(bbox[1]), b[i], TRUE, TRUE, 0);
gtk_box_pack_start( GTK_BOX(funcbox[1]), b[i], TRUE, TRUE, 0);
}
else if ( i < 15) {
if ( cdh_ObjidIsNotNull( button_aref[i].Objid))
gtk_box_pack_start( GTK_BOX(bbox[2]), b[i], TRUE, TRUE, 0);
gtk_box_pack_start( GTK_BOX(funcbox[2]), b[i], TRUE, TRUE, 0);
}
else if ( i < 20) {
if ( cdh_ObjidIsNotNull( button_aref[i].Objid)) {
gtk_box_pack_start( GTK_BOX(funcbox[3]), b[i], TRUE, TRUE, 0);
a_height = 4;
}
}
else if ( i < 25) {
if ( cdh_ObjidIsNotNull( button_aref[i].Objid)) {
gtk_box_pack_start( GTK_BOX(funcbox[4]), b[i], TRUE, TRUE, 0);
a_height = 5;
}
}
}
......@@ -777,10 +1052,10 @@ void OpGtk::activate_aalarm_incr( GtkWidget *w, gpointer data)
g_object_set( op->decr_button, "visible", TRUE, NULL);
}
else if ( op->a_height == 4) {
g_object_set( op->eventlog_button, "visible", TRUE, NULL);
g_object_set( op->funcbox[3], "visible", TRUE, NULL);
}
else if ( op->a_height == 5) {
g_object_set( op->help_button, "visible", TRUE, NULL);
g_object_set( op->funcbox[4], "visible", TRUE, NULL);
}
for ( int i = 2; i < 5; i++) {
if ( i < op->a_height) {
......@@ -815,10 +1090,10 @@ void OpGtk::activate_aalarm_decr( GtkWidget *w, gpointer data)
g_object_set( op->decr_button, "visible", FALSE, NULL);
}
else if ( op->a_height == 3) {
g_object_set( op->eventlog_button, "visible", FALSE, NULL);
g_object_set( op->funcbox[3], "visible", FALSE, NULL);
}
else if ( op->a_height == 4) {
g_object_set( op->help_button, "visible", FALSE, NULL);
g_object_set( op->funcbox[4], "visible", FALSE, NULL);
}
for ( int i = 2; i < 5; i++) {
if ( i >= op->a_height) {
......@@ -852,6 +1127,13 @@ void OpGtk::activate_eventlog( GtkWidget *w, gpointer data)
op->activate_eventlog();
}
void OpGtk::activate_blocklist( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->activate_blocklist();
}
void OpGtk::activate_navigator( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
......@@ -873,6 +1155,83 @@ void OpGtk::activate_help_overview( GtkWidget *w, gpointer data)
op->activate_help_overview();
}
void OpGtk::activate_help_opwin( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->activate_help_opwin();
}
void OpGtk::activate_help_proview( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->activate_help_proview();
}
void OpGtk::activate_trend( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->activate_trend();
}
void OpGtk::activate_fast( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->activate_fast();
}
void OpGtk::activate_history( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->activate_history();
}
void OpGtk::activate_graph( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->activate_graph();
}
void OpGtk::activate_switch_user( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->activate_switch_user();
}
void OpGtk::activate_show_user( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->activate_show_user();
}
void OpGtk::activate_logout( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->activate_logout();
}
void OpGtk::activate_cmd_menu_item( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
pwr_tCmd cmd;
int sts;
sts = ((OpGtk *)op)->get_cmd( w, cmd);
if ( ODD(sts)) {
op->activate_cmd_menu_item( cmd);
if ( op->command_cb)
op->command_cb( op->parent_ctx, cmd);
}
}
void OpGtk::activate_appl1( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
......@@ -978,4 +1337,83 @@ void OpGtk::activate_appl15( GtkWidget *w, gpointer data)
op->appl_action(14);
}
void OpGtk::activate_appl16( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->appl_action(15);
}
void OpGtk::activate_appl17( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->appl_action(16);
}
void OpGtk::activate_appl18( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->appl_action(17);
}
void OpGtk::activate_appl19( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->appl_action(18);
}
void OpGtk::activate_appl20( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->appl_action(19);
}
void OpGtk::activate_appl21( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->appl_action(20);
}
void OpGtk::activate_appl22( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->appl_action(21);
}
void OpGtk::activate_appl23( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->appl_action(22);
}
void OpGtk::activate_appl24( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->appl_action(23);
}
void OpGtk::activate_appl25( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->appl_action(24);
}
int OpGtk::get_cmd( GtkWidget *w, char *cmd)
{
for ( unsigned int i = 0; i < cmd_vect.size(); i++) {
if ( w == cmd_vect[i].w) {
strcpy( cmd, cmd_vect[i].cmd);
return 1;
}
}
return 0;
}
......@@ -30,6 +30,17 @@
# include "co_wow_gtk.h"
#endif
#include <vector>
class OpCmd {
public:
GtkWidget *w;
pwr_tCmd cmd;
OpCmd( GtkWidget *widget, const char *command) : w(widget)
{ strncpy( cmd, command, sizeof(cmd));}
};
class OpGtk : public Op {
public:
OpGtk( void *op_parent_ctx,
......@@ -51,20 +62,24 @@ class OpGtk : public Op {
GtkWidget *balarm_ebox;
GtkWidget *balarm_mark;
GtkWidget *appl_form;
GtkWidget *eventlog_button;
GtkWidget *help_button;
GtkWidget *decr_button;
GtkWidget *tools_close;
GtkWidget *funcbox[5];
GtkMenuBar *menu_bar;
int a_height;
int a_exist[5];
int a_active[5];
int text_size;
CoWowFocusTimerGtk poptimer;
vector<OpCmd> cmd_vect;
void map();
int configure( char *opplace_str);
void update_alarm_info();
void add_close_button();
int get_cmd( GtkWidget *w, char *cmd);
int create_menu_item( const char *name, int pixmap, int append, const char *cmd);
int delete_menu_item( const char *name);
static void activate_exit( GtkWidget *w, gpointer data);
static void activate_aalarm_ack( GtkWidget *w, gpointer data);
......@@ -76,9 +91,20 @@ class OpGtk : public Op {
static void activate_alarmlist( GtkWidget *w, gpointer data);
static void activate_eventlist( GtkWidget *w, gpointer data);
static void activate_eventlog( GtkWidget *w, gpointer data);
static void activate_blocklist( GtkWidget *w, gpointer data);
static void activate_navigator( GtkWidget *w, gpointer data);
static void activate_help( GtkWidget *w, gpointer data);
static void activate_help_overview( GtkWidget *w, gpointer data);
static void activate_help_opwin( GtkWidget *w, gpointer data);
static void activate_help_proview( GtkWidget *w, gpointer data);
static void activate_trend( GtkWidget *w, gpointer data);
static void activate_fast( GtkWidget *w, gpointer data);
static void activate_history( GtkWidget *w, gpointer data);
static void activate_switch_user( GtkWidget *w, gpointer data);
static void activate_show_user( GtkWidget *w, gpointer data);
static void activate_logout( GtkWidget *w, gpointer data);
static void activate_cmd_menu_item( GtkWidget *w, gpointer data);
static void activate_graph( GtkWidget *w, gpointer data);
static void activate_appl1( GtkWidget *w, gpointer data);
static void activate_appl2( GtkWidget *w, gpointer data);
static void activate_appl3( GtkWidget *w, gpointer data);
......@@ -94,6 +120,16 @@ class OpGtk : public Op {
static void activate_appl13( GtkWidget *w, gpointer data);
static void activate_appl14( GtkWidget *w, gpointer data);
static void activate_appl15( GtkWidget *w, gpointer data);
static void activate_appl16( GtkWidget *w, gpointer data);
static void activate_appl17( GtkWidget *w, gpointer data);
static void activate_appl18( GtkWidget *w, gpointer data);
static void activate_appl19( GtkWidget *w, gpointer data);
static void activate_appl20( GtkWidget *w, gpointer data);
static void activate_appl21( GtkWidget *w, gpointer data);
static void activate_appl22( GtkWidget *w, gpointer data);
static void activate_appl23( GtkWidget *w, gpointer data);
static void activate_appl24( GtkWidget *w, gpointer data);
static void activate_appl25( GtkWidget *w, gpointer data);
};
#endif
......@@ -189,11 +189,11 @@ XCrr *XNavGtk::xcrr_new( pwr_tAttrRef *arp, int advanced_user, pwr_tStatus *sts)
Ev *XNavGtk::ev_new( char *eve_name, char *ala_name, char *blk_name,
pwr_tObjid ev_user, int display_ala, int display_eve,
int display_blk, int display_return, int display_ack,
int ev_beep, pwr_tStatus *status)
int ev_beep, pwr_tMask ev_pop_mask, pwr_tStatus *status)
{
return new EvGtk( this, parent_wid, eve_name, ala_name, blk_name,
ev_user, display_ala, display_eve, display_blk,
display_return, display_ack, ev_beep, status);
display_return, display_ack, ev_beep, ev_pop_mask, status);
}
Hist *XNavGtk::hist_new( char *title, pwr_tOid oid, pwr_tStatus *sts)
......
......@@ -51,7 +51,7 @@ class XNavGtk : public XNav {
Ev *ev_new( char *eve_name, char *ala_name, char *blk_name,
pwr_tObjid ev_user, int display_ala, int display_eve,
int display_blk, int display_return, int display_ack,
int ev_beep, pwr_tStatus *status);
int ev_beep, pwr_tMask ev_pop_mask, pwr_tStatus *status);
Hist *hist_new( char *title, pwr_tOid oid, pwr_tStatus *sts);
Block *block_new( pwr_tAttrRef *arp, char *name, unsigned int priv,
pwr_tStatus *sts);
......
......@@ -60,9 +60,10 @@ EvMotif::EvMotif( void *ev_parent_ctx,
int display_return,
int display_ack,
int ev_beep,
pwr_tMask ev_pop_mask,
pwr_tStatus *status) :
Ev( ev_parent_ctx, eve_name, ala_name, blk_name, ev_user, display_ala, display_eve,
display_blk, display_return, display_ack, ev_beep, status),
display_blk, display_return, display_ack, ev_beep, ev_pop_mask, status),
parent_wid(ev_parent_wid), parent_wid_eve(NULL), parent_wid_ala(NULL)
{
char uid_filename[120] = {"xtt_eve.uid"};
......
......@@ -45,6 +45,7 @@ class EvMotif : public Ev {
int display_return,
int display_ack,
int ev_beep,
pwr_tMask ev_pop_mask,
pwr_tStatus *status);
~EvMotif();
......
......@@ -421,9 +421,7 @@ int OpMotif::configure( char *opplace_str)
int sts;
int i;
pwr_tObjid opplace;
pwr_tObjid user;
pwr_sClass_OpPlace *opplace_p;
pwr_sClass_User *user_p;
pwr_sAttrRef attrref;
XmFontList fontlist;
XmFontListEntry entry;
......@@ -434,24 +432,9 @@ int OpMotif::configure( char *opplace_str)
sts = gdh_ObjidToPointer( opplace, (void **) &opplace_p);
if ( EVEN(sts)) return sts;
// Fix
if ( strncmp( opplace_p->OpWinProgram, "Jop", 3) == 0)
if ( opplace_p->StartJavaProcess)
start_jop = 1;
// Find matching user object
sts = gdh_GetClassList( pwr_cClass_User, &user);
while ( ODD (sts))
{
sts = gdh_ObjidToPointer( user, (void **) &user_p);
if ( EVEN(sts)) return sts;
if ( user_p->OpNumber == opplace_p->OpNumber)
break;
sts = gdh_GetNextObject( user, &user);
}
if ( EVEN(sts)) return sts;
// Load font
entry = XmFontListEntryCreate( (char*) "tag1", XmFONT_IS_FONT,
XLoadQueryFont( flow_Display(appl_form),
......@@ -460,10 +443,7 @@ int OpMotif::configure( char *opplace_str)
XtFree( (char *)entry);
// Examine Graph objects
button_cnt = user_p->NoFastAvail;
if ( button_cnt > 15)
button_cnt = 15;
for ( i = 0; i < button_cnt; i++)
for ( i = 0; i < 15; i++)
{
if ( i >= 15)
break;
......@@ -471,19 +451,28 @@ int OpMotif::configure( char *opplace_str)
sts = gdh_ClassAttrToAttrref( pwr_cClass_XttGraph, ".ButtonText", &attrref);
if ( EVEN(sts)) return sts;
attrref = cdh_ArefAdd( &user_p->FastAvail[i], &attrref);
if ( cdh_ObjidIsNotNull( opplace_p->FastAvail[i].Objid)) {
attrref = cdh_ArefAdd( &opplace_p->FastAvail[i], &attrref);
sts = gdh_GetObjectInfoAttrref( &attrref, (void *)button_title[i],
sizeof(button_title[0]));
if ( EVEN(sts))
strcpy( button_title[i], "");
if ( ODD(sts))
button_aref[i] = attrref.Objid;
else
button_aref[i] = pwr_cNOid;
}
else
button_aref[i] = pwr_cNOid;
}
// Create the application buttons
for ( i = 0; i < button_cnt; i++)
{
Widget b[15];
if ( cdh_ObjidIsNull( button_aref[i]))
continue;
switch ( i)
{
case 0:
......
......@@ -53,13 +53,14 @@ Ev::Ev( void *ev_parent_ctx,
int display_return,
int display_ack,
int ev_beep,
pwr_tMask ev_pop_mask,
pwr_tStatus *status) :
parent_ctx(ev_parent_ctx),
user(ev_user), eve_display_ack(display_ack),
eve_display_return(display_return),
start_trace_cb(NULL), display_in_xnav_cb(NULL), update_info_cb(NULL),
help_cb(NULL), popup_menu_cb(0), sound_cb(0), eve(NULL), ala(NULL),
connected(0), ala_displayed(0), eve_displayed(0), beep(ev_beep)
connected(0), ala_displayed(0), eve_displayed(0), beep(ev_beep), pop_mask(ev_pop_mask)
{
}
......@@ -309,8 +310,7 @@ void Ev::create_aliaslist( void *up)
int i, j;
int alias_size;
ev_sAlias dum;
pwr_sClass_User *userp = (pwr_sClass_User *)up;
pwr_sClass_OpPlace *userp = (pwr_sClass_OpPlace *)up;
int listsize = MIN( sizeof(userp->SelectList)/sizeof(userp->SelectList[0]),
sizeof(alias_list)/sizeof(alias_list[0]));
......@@ -398,9 +398,31 @@ pwr_tStatus Ev::mh_alarm_bc( mh_sMessage *MsgP)
ev->ala->event_alarm( MsgP);
if ( ev->update_info_cb)
ev->update_info_cb( ev->parent_ctx);
if ( ev->pop_cb)
ev->pop_cb( ev->parent_ctx);
if ( ev->pop_cb) {
int pop = 0;
switch ( ((mh_sMsgInfo *)MsgP)->EventPrio) {
case mh_eEventPrio_A:
if ( ev->pop_mask & pwr_mOpWindPopMask_Aalarm)
pop = 1;
break;
case mh_eEventPrio_B:
if ( ev->pop_mask & pwr_mOpWindPopMask_Balarm)
pop = 1;
break;
case mh_eEventPrio_C:
if ( ev->pop_mask & pwr_mOpWindPopMask_Calarm)
pop = 1;
break;
case mh_eEventPrio_D:
if ( ev->pop_mask & pwr_mOpWindPopMask_Dalarm)
pop = 1;
break;
default: ;
}
if ( pop)
ev->pop_cb( ev->parent_ctx);
}
return 1;
}
......@@ -427,6 +449,9 @@ pwr_tStatus Ev::mh_info_bc( mh_sMessage *MsgP)
ev->ala->event_info( MsgP);
if ( ev->update_info_cb)
ev->update_info_cb( ev->parent_ctx);
if ( ev->pop_mask & pwr_mOpWindPopMask_InfoMsg)
ev->pop_cb( ev->parent_ctx);
return 1;
}
......
......@@ -51,6 +51,7 @@ class Ev {
int display_return,
int display_ack,
int ev_beep,
pwr_tMask ev_pop_mask,
pwr_tStatus *status);
virtual ~Ev();
......@@ -81,6 +82,7 @@ class Ev {
ev_sAlias alias_list[20];
CoWow *wow;
static Ev *ev;
pwr_tMask pop_mask;
virtual void map_eve() {}
virtual void map_ala() {}
......
......@@ -23,6 +23,7 @@
#include <stdlib.h>
#include "glow.h"
#include "xtt_xnav.h"
#include "rt_gdh.h"
#include "rt_gdh_msg.h"
#include "co_cdh.h"
......@@ -33,7 +34,6 @@
#include "co_lng.h"
#include "xtt_ge.h"
#include "ge_graph.h"
#include "xtt_xnav.h"
void XttGe::graph_init_cb( void *client_data)
{
......
......@@ -32,6 +32,7 @@
#include "rt_mh_outunit.h"
#include "co_wow.h"
#include "co_lng.h"
#include "co_xhelp.h"
#include "xtt_op.h"
#include "rt_xnav_msg.h"
......@@ -131,12 +132,77 @@ void Op::activate_eventlog()
command_cb( parent_ctx, cmd);
}
void Op::activate_blocklist()
{
char cmd[20] = "show blocklist";
if ( command_cb)
command_cb( parent_ctx, cmd);
}
void Op::activate_trend()
{
char cmd[200] = "show objectlist/class=dstrend/title=\"Trend List\"";
if ( command_cb)
command_cb( parent_ctx, cmd);
}
void Op::activate_fast()
{
char cmd[200] = "show objectlist/class=dsfastcurve/title=\"Fast Curve List\"";
if ( command_cb)
command_cb( parent_ctx, cmd);
}
void Op::activate_history()
{
char cmd[200] = "show objectlist/class=sevhist/title=\"Process History List\"";
if ( command_cb)
command_cb( parent_ctx, cmd);
}
void Op::activate_graph()
{
char cmd[200] = "show objectlist/class=xttgraph/title=\"Process Graphic List\"";
if ( command_cb)
command_cb( parent_ctx, cmd);
}
void Op::activate_navigator()
{
if ( map_cb)
map_cb( parent_ctx);
}
void Op::activate_switch_user()
{
char cmd[200] ="login";
if ( command_cb)
command_cb( parent_ctx, cmd);
}
void Op::activate_show_user()
{
char cmd[200] ="show user/window";
if ( command_cb)
command_cb( parent_ctx, cmd);
}
void Op::activate_logout()
{
char cmd[200] ="logout /messagewindow";
if ( command_cb)
command_cb( parent_ctx, cmd);
}
void Op::activate_cmd_menu_item( char *cmd)
{
if ( command_cb)
command_cb( parent_ctx, cmd);
}
void Op::activate_help()
{
if ( help_cb)
......@@ -149,6 +215,16 @@ void Op::activate_help_overview()
help_cb( parent_ctx, "overview");
}
void Op::activate_help_opwin()
{
CoXHelp::dhelp("opg_opwindow", "", navh_eHelpFile_Other, "$pwr_lang/man_opg.dat", 0);
}
void Op::activate_help_proview()
{
CoXHelp::dhelp( "version", "", navh_eHelpFile_Other, "$pwr_exe/xtt_version_help.dat", 0);
}
void Op::jop_command_cb( void *op, char *command)
{
if ( ((Op *)op)->command_cb)
......
......@@ -45,8 +45,8 @@ class Op {
void *parent_ctx;
unsigned long balarm_prio;
unsigned long balarm_type;
char button_title[20][80];
pwr_tAttrRef button_aref[20];
char button_title[25][80];
pwr_tAttrRef button_aref[25];
int button_cnt;
int start_jop;
Jop *jop;
......@@ -67,6 +67,8 @@ class Op {
virtual int configure( char *opplace_str) {return 0;}
virtual void update_alarm_info() {}
virtual void add_close_button() {}
virtual int create_menu_item( const char *name, int pixmap, int append, const char *cmd) { return 0;}
virtual int delete_menu_item( const char *name) { return 0;}
void set_jop_qid( int qix) { if ( jop) jop->set_jop_qid( qix);};
void scan();
......@@ -78,9 +80,20 @@ class Op {
void activate_alarmlist();
void activate_eventlist();
void activate_eventlog();
void activate_blocklist();
void activate_navigator();
void activate_trend();
void activate_fast();
void activate_history();
void activate_graph();
void activate_help();
void activate_help_overview();
void activate_help_opwin();
void activate_help_proview();
void activate_switch_user();
void activate_show_user();
void activate_logout();
void activate_cmd_menu_item( char *cmd);
static void jop_command_cb( void *op, char *command);
};
......
......@@ -1068,7 +1068,7 @@ XNav::XNav(
brow_cnt(0), TraceList(NULL), trace_started(0),
message_cb(NULL), close_cb(NULL), map_cb(NULL), change_value_cb(NULL),
set_dimension_cb(NULL), selection_changed_cb(0), ccm_func_registred(0), verify(0),
menu_tree(NULL), ev(0), op(0), clog(0), closing_down(0),
menu_tree(NULL), ev(0), op(0), clog(0), closing_down(0), opplace_p(0),
base_priv(pwr_mPrv_System), priv(pwr_mPrv_System), displayed(0),
current_logging_index(-1), search_last_found(0), search_compiled(0),
attach_audio(0), audio(0), op_close_button(xn_op_close_button), cologin(0), scctx(0)
......@@ -2761,18 +2761,15 @@ int XNav::setup()
brow_SetNodraw( brow->ctx);
new ItemHeader( brow, "Title", "Setup", NULL, flow_eDest_IntoLast);
new ItemLocal( brow, "ConfigureObject", "setup_configureObject",
pwr_eType_String, sizeof( gbl.ConfigureObject), 0, 0, 1,
(void *) gbl.ConfigureObject, NULL, flow_eDest_IntoLast);
new ItemLocal( brow, "OpPlace", "setup_opPlace",
pwr_eType_String, sizeof( gbl.OpPlace), 0, 0, 1,
(void *) gbl.OpPlace, NULL, flow_eDest_IntoLast);
new ItemLocal( brow, "DefaultDirectory", "setup_defaultdirectory",
pwr_eType_String, sizeof( gbl.default_directory), 0, 0, 0,
(void *) gbl.default_directory, NULL, flow_eDest_IntoLast);
new ItemLocal( brow, "Scantime", "setup_scantime",
pwr_eType_Float64, sizeof( gbl.scantime), 0.010, 10, 0,
(void *) &gbl.scantime, NULL, flow_eDest_IntoLast);
new ItemLocal( brow, "AlarmMessage", "setup_alarmmessage",
pwr_eType_Boolean, sizeof( gbl.AlarmMessage), 0, 1, 0,
(void *) &gbl.AlarmMessage, NULL, flow_eDest_IntoLast);
new ItemLocal( brow, "AlarmBeep", "setup_alarmbeep",
pwr_eType_Boolean, sizeof( gbl.AlarmBeep), 0, 1, 0,
(void *) &gbl.AlarmBeep, NULL, flow_eDest_IntoLast);
......@@ -2782,9 +2779,15 @@ int XNav::setup()
new ItemLocal( brow, "AlarmAck", "setup_alarmack",
pwr_eType_Boolean, sizeof( gbl.AlarmAck), 0, 1, 0,
(void *) &gbl.AlarmAck, NULL, flow_eDest_IntoLast);
new ItemLocal( brow, "SymbolFilename", "setup_symbolfilename",
pwr_eType_String, sizeof(gbl.symbolfilename), 0, 0, 0,
(void *) gbl.symbolfilename, NULL, flow_eDest_IntoLast);
new ItemLocal( brow, "HideOperatorWindow", "setup_hideopwind",
pwr_eType_Boolean, sizeof( gbl.hide_opwind), 0, 1, 0,
(void *) &gbl.hide_opwind, NULL, flow_eDest_IntoLast);
new ItemLocal( brow, "HideStatusBar", "setup_hidestatusbar",
pwr_eType_Boolean, sizeof( gbl.hide_statusbar), 0, 1, 0,
(void *) &gbl.hide_statusbar, NULL, flow_eDest_IntoLast);
new ItemLocal( brow, "SetupScript", "setup_setupscript",
pwr_eType_String, sizeof(gbl.setupscript), 0, 0, 0,
(void *) gbl.setupscript, NULL, flow_eDest_IntoLast);
new ItemLocal( brow, "Verify", "setup_verify",
pwr_eType_Int32, sizeof( gbl.verify), 0, 1, 0,
(void *) &gbl.verify, NULL, flow_eDest_IntoLast);
......@@ -2883,132 +2886,44 @@ int XNav::show_logging( int index)
return XNAV__SUCCESS;
}
int XNavGbl::symbolfile_exec( void *xnav)
int XNavGbl::setupscript_exec( XNav *xnav)
{
char cmd[80];
if ( strcmp( symbolfilename, "") == 0)
strcpy( symbolfilename, "$HOME/xtt_setup");
if ( strcmp( setupscript, "") == 0)
strcpy( setupscript, "$HOME/xtt_setup");
strcpy( cmd, "@");
strcat( cmd, symbolfilename);
((XNav *)xnav)->command( cmd);
strcat( cmd, setupscript);
xnav->command( cmd);
return XNAV__SUCCESS;
}
int XNavGbl::load_config( void *xnav)
int XNavGbl::load_config( XNav *xnav)
{
pwr_tClassId classid;
pwr_tObjid objid;
pwr_tObjid node;
pwr_tOName config_name;
pwr_tAName parname;
int found;
int sts;
char *s;
pwr_tFloat32 float32_val;
if ( ConfigureObject[0])
{
strcpy( config_name, ConfigureObject);
sts = gdh_NameToObjid ( config_name, &objid);
if ( EVEN(sts)) return sts;
}
else
{
/* Try to find a RttConfig object for the node */
sts = gdh_GetNodeObject ( 0, &node);
if ( strcmp( xnav->opplace_name, "") == 0)
return 0;
strcpy( OpPlace, xnav->opplace_name);
sts = gdh_NameToPointer( xnav->opplace_name, (void **)&xnav->opplace_p);
if ( EVEN(sts)) return sts;
/* Look for a RttConfig object as a child to the node object
with the name RttConfig */
found = 0;
sts = gdh_GetChild( node, &objid);
while ( ODD(sts))
{
sts = gdh_GetObjectClass( objid, &classid);
sts = gdh_NameToObjid( xnav->opplace_name, &xnav->gbl.OpObject);
if ( EVEN(sts)) return sts;
if ( classid == pwr_cClass_RttConfig)
{
sts = gdh_ObjidToName ( objid, config_name, sizeof(config_name), cdh_mNName);
if (EVEN(sts)) return sts;
if ( (s = strrchr( config_name, '-')))
s++;
else
s = config_name;
cdh_ToUpper( s, s);
if ( !strcmp( s, "RTTCONFIG"))
{
found = 1;
break;
}
}
sts = gdh_GetNextSibling ( objid, &objid);
}
if ( found == 0)
return XNAV__OBJNOTFOUND;
sts = gdh_ObjidToName ( objid, config_name, sizeof(config_name), cdh_mNName);
if (EVEN(sts)) return sts;
strcpy( ConfigureObject, config_name);
}
/* rtt_UserObject */
strcpy( parname, config_name);
strcat( parname, ".UserObject");
sts = gdh_GetObjectInfo ( parname, &UserObject, sizeof( UserObject));
/* AlarmAutoLoad */
strcpy( parname, config_name);
strcat( parname, ".AlarmAutoLoad");
sts = gdh_GetObjectInfo ( parname, &AlarmAutoLoad,
sizeof( AlarmAutoLoad));
/* AlarmMessage */
strcpy( parname, config_name);
strcat( parname, ".AlarmMessage");
sts = gdh_GetObjectInfo ( parname, &AlarmMessage, sizeof( AlarmMessage));
/* AlarmBeep */
strcpy( parname, config_name);
strcat( parname, ".AlarmBeep");
sts = gdh_GetObjectInfo ( parname, &AlarmBeep, sizeof( AlarmBeep));
/* AlarmReturn */
strcpy( parname, config_name);
strcat( parname, ".AlarmReturn");
sts = gdh_GetObjectInfo ( parname, &AlarmReturn, sizeof( AlarmReturn));
/* AlarmAck */
strcpy( parname, config_name);
strcat( parname, ".AlarmAck");
sts = gdh_GetObjectInfo ( parname, &AlarmAck, sizeof( AlarmAck));
/* DefaultDirectory */
strcpy( parname, config_name);
strcat( parname, ".DefaultDirectory");
sts = gdh_GetObjectInfo ( parname, default_directory,
sizeof( default_directory));
if ( EVEN(sts)) strcpy( default_directory, "");
/* ScanTime */
strcpy( parname, config_name);
strcat( parname, ".ScanTime");
sts = gdh_GetObjectInfo ( parname, &float32_val,
sizeof( float32_val));
if (ODD(sts) && float32_val != 0)
scantime = float32_val;
/* SymbolFileName */
strcpy( parname, config_name);
strcat( parname, ".SymbolFileName");
sts = gdh_GetObjectInfo ( parname, symbolfilename,
sizeof( symbolfilename));
if ( EVEN(sts))
strcpy( symbolfilename, "");
dcli_trim( symbolfilename, symbolfilename);
AlarmBeep = xnav->opplace_p->AlarmBell;
AlarmReturn = (xnav->opplace_p->EventListEvents & pwr_mEventListMask_AlarmReturn) != 0;
AlarmAck = (xnav->opplace_p->EventListEvents & pwr_mEventListMask_AlarmAck) != 0;
hide_opwind = (xnav->opplace_p->OpWindLayout & pwr_mOpWindLayoutMask_HideOperatorWindow) != 0;
hide_statusbar = (xnav->opplace_p->OpWindLayout & pwr_mOpWindLayoutMask_HideStatusBar) != 0;
op_wind_pop = xnav->opplace_p->OpWindPop;
strcpy( setupscript, xnav->opplace_p->SetupScript);
dcli_trim( setupscript, setupscript);
return XNAV__SUCCESS;
}
......@@ -3457,79 +3372,49 @@ int XNav::init_brow_base_cb( FlowCtx *fctx, void *client_data)
brow_CreateSecondaryCtx( xnav->brow_stack[0]->ctx, &secondary_ctx,
init_brow_collect_cb, (void *)xnav, flow_eCtxType_Brow);
// Execute the symbolfile
xnav->gbl.symbolfile_exec( xnav);
// Start operator window
if ( strcmp( xnav->opplace_name, "") != 0)
{
pwr_tCmd cmd;
if ( !xnav->gbl.hide_opwind) {
strcpy( cmd, "open op ");
strcat( cmd, xnav->opplace_name);
if ( xnav->op_close_button)
if ( xnav->op_close_button ||
!(xnav->opplace_p->OpWindLayout & pwr_mOpWindLayoutMask_HideCloseButton))
strcat( cmd, " /closebutton");
xnav->command( cmd);
xnav->load_ev_from_opplace();
}
xnav->login_from_opplace();
}
else
xnav->login();
// Execute the setup script
xnav->gbl.setupscript_exec( xnav);
return 1;
}
int XNav::load_ev_from_opplace()
{
int user_found = 0;
pwr_sClass_OpPlace *op_p;
pwr_sClass_User *user_p;
pwr_tObjid user_objid;
int sts;
// Find the corresponding User-object
sts = gdh_NameToPointer( opplace_name, (void **) &op_p);
if ( EVEN(sts)) return sts;
sts = gdh_GetClassList( pwr_cClass_User, &user_objid);
while ( ODD(sts))
{
sts = gdh_ObjidToPointer( user_objid, (void **)&user_p);
if ( EVEN(sts)) return sts;
if ( user_p->OpNumber == op_p->OpNumber)
{
user_found = 1;
break;
}
sts = gdh_GetNextObject( user_objid, &user_objid);
}
if ( user_found )
{
char cmd[100];
gbl.UserObject = user_objid;
strcpy( cmd, "eventlist load");
command( cmd);
return XNAV__SUCCESS;
}
return 0;
}
int XNav::login_from_opplace()
{
pwr_sClass_User *user_p;
int sts;
unsigned int privilege;
char systemgroup[80];
pwr_sSecurity sec;
char username[80];
sts = gdh_ObjidToPointer( gbl.UserObject, (void **) &user_p);
if ( EVEN(sts)) return sts;
sts = gdh_GetObjectInfo ( "pwrNode-System.SystemGroup", &systemgroup,
sizeof(systemgroup));
if ( EVEN(sts)) return sts;
......@@ -3541,7 +3426,7 @@ int XNav::login_from_opplace()
if ( ODD(sts) && sec.XttUseOpsysUser)
syi_UserName( username, sizeof(username));
else
strcpy( username, user_p->UserName);
strcpy( username, opplace_p->UserName);
sts = user_GetUserPriv( systemgroup, username, &privilege);
if ( EVEN(sts)) {
......
......@@ -30,6 +30,10 @@ extern "C" {
# include "pwr.h"
#endif
#ifndef pwr_baseclasses_h
#include "pwr_baseclasses.h"
#endif
#ifndef co_regex_h
# include "co_regex.h"
#endif
......@@ -179,6 +183,9 @@ typedef enum {
applist_eType_Fast
} applist_eType;
class XNav;
class ApplListElem {
public:
ApplListElem( applist_eType al_type, void *al_ctx, pwr_sAttrRef *al_arp,
......@@ -211,53 +218,41 @@ class ApplList {
class XNavGbl {
public:
XNavGbl() :
priv(0), UserObject(pwr_cNObjid), AlarmAutoLoad(0), AlarmMessage(0),
AlarmBeep(0), AlarmReturn(0), AlarmAck(0), gdh_started(1),
priv(0), OpObject(pwr_cNObjid),
AlarmBeep(0), AlarmReturn(0), AlarmAck(0), hide_opwind(0), hide_statusbar(0),
op_wind_pop(0), gdh_started(1),
verify(0), scantime(0.5), signal_test_mode(0), advanced_user(1), show_truedb(0),
show_allattr(0), no_graph_ratio(0)
{
strcpy( version, xnav_cVersion); strcpy( time, "");
strcpy( ConfigureObject, ""); strcpy( AlarmLastMessage, "");
strcpy( AlarmText1, ""); strcpy( AlarmText2, ""); strcpy( AlarmText3, "");
strcpy( AlarmText4, ""); strcpy( AlarmText5, "");
strcpy( platform, ""); strcpy( os, ""); strcpy( hw, "");
strcpy( node, ""); strcpy( sys, ""); strcpy( default_directory, "");
strcpy( symbolfilename, "");
strcpy( OpPlace, "");
strcpy( default_directory, "");
strcpy( setupscript, "");
};
char version[10];
char time[80];
unsigned long priv;
char ConfigureObject[80];
pwr_tObjid UserObject;
int AlarmAutoLoad;
int AlarmMessage;
pwr_tOName OpPlace;
pwr_tObjid OpObject;
int AlarmBeep;
int AlarmReturn;
int AlarmAck;
int hide_opwind;
int hide_statusbar;
pwr_tMask op_wind_pop;
int gdh_started;
char AlarmLastMessage[80];
char AlarmText1[80];
char AlarmText2[80];
char AlarmText3[80];
char AlarmText4[80];
char AlarmText5[80];
char platform[20];
char os[20];
char hw[20];
int verify;
char node[20];
char sys[20];
char default_directory[80];
double scantime;
char symbolfilename[80];
pwr_tFileName setupscript;
int signal_test_mode;
int advanced_user;
int show_truedb;
int show_allattr;
int no_graph_ratio;
int load_config( void *xnav);
int symbolfile_exec( void *xnav);
int load_config( XNav *xnav);
int setupscript_exec( XNav *xnav);
};
class XNav {
......@@ -300,6 +295,7 @@ class XNav {
CLog *clog;
int closing_down;
pwr_tOName opplace_name;
pwr_sClass_OpPlace *opplace_p;
char base_user[80];
char user[80];
unsigned int base_priv;
......@@ -333,7 +329,7 @@ class XNav {
virtual Ev *ev_new( char *eve_name, char *ala_name, char *blk_name,
pwr_tObjid ev_user, int display_ala, int display_eve,
int display_blk, int display_return, int display_ack,
int ev_beep, pwr_tStatus *status) { return 0;}
int ev_beep, pwr_tMask ev_pop_mask, pwr_tStatus *status) { return 0;}
virtual Hist *hist_new( char *title, pwr_tOid oid, pwr_tStatus *sts) {return 0;}
virtual Block *block_new( pwr_tAttrRef *arp, char *name, unsigned int priv,
pwr_tStatus *sts) {return 0;}
......
......@@ -98,6 +98,12 @@ typedef struct {
char title[256];
} xnav_sHistList;
typedef struct {
pwr_tCid cid;
XNav *xnav;
char title[256];
} xnav_sObjectList;
#define IF_NOGDH_RETURN \
if ( !xnav->gbl.gdh_started)\
......@@ -150,6 +156,8 @@ static void xnav_xao_close_cb( void *ctx, XAttOne *xao);
static void xnav_clog_close_cb( void *ctx);
static void xnav_open_shist_cb( void *ctx, char *text);
static void xnav_open_shist_cancel_cb( void *ctx);
static void xnav_show_objectlist_cb( void *ctx, char *text);
static void xnav_show_objectlist_cancel_cb( void *ctx);
static int xnav_help_func( void *client_data,
void *client_flag);
......@@ -212,7 +220,7 @@ dcli_tCmdTable xnav_command_table[] = {
"/HIERARCHY", "/PARAMETER" , "/OBJID",
"/FILE", "/LOCAL", "/INITSTEP",
"/MAXOBJECTS", "/VOLUME", "/ALL", "/TYPE",
"/OPTION", "/ENTRY", "/NEW", ""}
"/OPTION", "/ENTRY", "/NEW", "/TITLE", "/WINDOW", ""}
},
{
"OPEN",
......@@ -281,7 +289,7 @@ dcli_tCmdTable xnav_command_table[] = {
{
"LOGOUT",
&xnav_logout_func,
{ ""}
{ "/MESSAGEWINDOW", ""}
},
{
"LOGIN",
......@@ -613,15 +621,19 @@ static int xnav_logout_func( void *client_data,
XNav *xnav = (XNav *)client_data;
char msg[80];
if ( strcmp( xnav->base_user, "") == 0)
{
int window = ODD( dcli_get_qualifier( "/MESSAGEWINDOW", 0, 0));
if ( strcmp( xnav->base_user, "") == 0) {
sprintf( msg, "User %s logged out", xnav->user);
xnav->message('I', msg);
if ( window)
xnav->wow->DisplayText( "Logout", msg);
}
else
{
else {
sprintf( msg, "Returned to user %s", xnav->base_user);
xnav->message('I', msg);
if ( window)
xnav->wow->DisplayText( "User Return", msg);
}
strcpy( xnav->user, xnav->base_user);
xnav->priv = xnav->base_priv;
......@@ -1647,8 +1659,8 @@ static int xnav_show_func( void *client_data,
strcpy( event_title, Lng::translate( "Event List"));
strcpy( block_title, Lng::translate( "Blocked Alarms"));
xnav->ev = xnav->ev_new( event_title, alarm_title, block_title,
xnav->gbl.UserObject, 0, 1, 0, xnav->gbl.AlarmReturn,
xnav->gbl.AlarmAck, xnav->gbl.AlarmBeep, &sts);
xnav->gbl.OpObject, 0, 1, 0, xnav->gbl.AlarmReturn,
xnav->gbl.AlarmAck, xnav->gbl.AlarmBeep, xnav->gbl.op_wind_pop, &sts);
if ( EVEN(sts))
{
delete xnav->ev;
......@@ -1714,8 +1726,8 @@ static int xnav_show_func( void *client_data,
strcpy( event_title, Lng::translate( "Event List"));
strcpy( block_title, Lng::translate( "Blocked Alarms"));
xnav->ev = xnav->ev_new( event_title, alarm_title, block_title,
xnav->gbl.UserObject, 1, 0, 0, xnav->gbl.AlarmReturn,
xnav->gbl.AlarmAck, xnav->gbl.AlarmBeep, &sts);
xnav->gbl.OpObject, 1, 0, 0, xnav->gbl.AlarmReturn,
xnav->gbl.AlarmAck, xnav->gbl.AlarmBeep, xnav->gbl.op_wind_pop, &sts);
if ( EVEN(sts))
{
delete xnav->ev;
......@@ -1745,8 +1757,8 @@ static int xnav_show_func( void *client_data,
strcpy( event_title, Lng::translate( "Event List"));
strcpy( block_title, Lng::translate( "Blocked Alarms"));
xnav->ev = xnav->ev_new( event_title, alarm_title, block_title,
xnav->gbl.UserObject, 0, 0, 1, xnav->gbl.AlarmReturn,
xnav->gbl.AlarmAck, xnav->gbl.AlarmBeep, &sts);
xnav->gbl.OpObject, 0, 0, 1, xnav->gbl.AlarmReturn,
xnav->gbl.AlarmAck, xnav->gbl.AlarmBeep, xnav->gbl.op_wind_pop, &sts);
if ( EVEN(sts))
{
delete xnav->ev;
......@@ -1767,22 +1779,40 @@ static int xnav_show_func( void *client_data,
}
else if ( strncmp( arg1_str, "USER", strlen( arg1_str)) == 0)
{
char msg[120];
char msg[256];
char priv_str[80];
int window = ODD( dcli_get_qualifier( "/WINDOW", 0, 0));
if ( strcmp( xnav->user, "") == 0)
{
user_RtPrivToString( xnav->priv, priv_str, sizeof(priv_str));
if ( window) {
sprintf( msg, "Current User: Not logged in\n\nPrivileges: %s)", priv_str);
xnav->wow->DisplayText( "User", msg);
}
else {
sprintf( msg, "Not logged in (%s)", priv_str);
xnav->message('I', msg);
}
}
else
{
user_RtPrivToString( xnav->priv, priv_str, sizeof(priv_str));
if ( window) {
sprintf( msg, "Current User: %s\n\nPrivileges: %s", xnav->user, priv_str);
if ( strcmp( xnav->base_user, "") != 0 && strcmp( xnav->base_user, xnav->user) != 0) {
strcat( msg, "\n\nOriginal User: ");
strcat( msg, xnav->base_user);
}
xnav->wow->DisplayText( "User", msg);
}
else {
sprintf( msg, "User %s (%s)", xnav->user, priv_str);
xnav->message('I', msg);
}
}
}
else if ( strncmp( arg1_str, "VOLUMES", strlen( arg1_str)) == 0)
{
/* Command is "SHOW VOLUMES" */
......@@ -1901,6 +1931,64 @@ static int xnav_show_func( void *client_data,
/* Command is "SHOW METHODS" */
xnav->print_methods();
}
else if ( strncmp( arg1_str, "OBJECTLIST", strlen( arg1_str)) == 0)
{
// Command is "SHOW OBJECTLIST"
pwr_tAttrRef aref;
int cnt = 0;
pwr_tObjName class_str;
char title_str[80];
pwr_tString80 *names;
xnav_sObjectList *ctx;
pwr_tCid cid;
if ( EVEN( dcli_get_qualifier( "/CLASS", class_str, sizeof(class_str)))) {
xnav->message('E', "Class is missing");
return XNAV__HOLDCOMMAND;
}
sts = gdh_ClassNameToId( class_str, &cid);
if ( EVEN(sts)) {
xnav->message('E', "Unknown class");
return XNAV__HOLDCOMMAND;
}
for ( sts = gdh_GetClassListAttrRef( cid, &aref);
ODD(sts);
sts = gdh_GetNextAttrRef( cid, &aref, &aref)) {
cnt++;
}
names = (pwr_tString80 *)calloc( cnt, sizeof(pwr_tString80));
int idx = 0;
for ( sts = gdh_GetClassListAttrRef( cid, &aref);
ODD(sts);
sts = gdh_GetNextAttrRef( cid, &aref, &aref)) {
sts = gdh_AttrrefToName( &aref, names[idx], sizeof(names[0]),
cdh_mName_volumeStrict);
if ( EVEN(sts)) continue;
idx++;
if ( idx > cnt)
break;
}
if ( EVEN( dcli_get_qualifier( "/TITLE", title_str, sizeof(title_str)))) {
sts = gdh_ObjidToName( cdh_ClassIdToObjid( cid), title_str, sizeof(title_str),
cdh_mName_object);
if ( EVEN(sts)) return sts;
strcat( title_str, Lng::translate(" List"));
}
ctx = (xnav_sObjectList *) calloc( 1, sizeof(xnav_sObjectList));
ctx->cid = cid;
ctx->xnav = xnav;
xnav->wow->CreateList( title_str, (char *)names, xnav_show_objectlist_cb,
xnav_show_objectlist_cancel_cb, ctx);
free( names);
}
else
{
/* This might be a system picture */
......@@ -1937,8 +2025,8 @@ static int xnav_eventlist_func( void *client_data,
strcpy( event_title, Lng::translate( "Event List"));
strcpy( block_title, Lng::translate( "Blocked Alarms"));
xnav->ev = xnav->ev_new( event_title, alarm_title, block_title,
xnav->gbl.UserObject, 0, 0, 0, xnav->gbl.AlarmReturn,
xnav->gbl.AlarmAck, xnav->gbl.AlarmBeep, &sts);
xnav->gbl.OpObject, 0, 0, 0, xnav->gbl.AlarmReturn,
xnav->gbl.AlarmAck, xnav->gbl.AlarmBeep, xnav->gbl.op_wind_pop, &sts);
if ( EVEN(sts))
{
delete xnav->ev;
......@@ -3324,7 +3412,7 @@ static int xnav_open_func( void *client_data,
if ( xnav->clog)
xnav->clog->pop();
else {
xnav->clog = xnav->clog_new( "Console log", &sts);
xnav->clog = xnav->clog_new( "System Messages", &sts);
if ( EVEN(sts)) {
delete xnav->clog;
xnav->op = 0;
......@@ -3901,6 +3989,49 @@ static int xnav_create_func( void *client_data,
return XNAV__SUCCESS;
}
else if ( strncmp( arg1_str, "OPMENUITEM", strlen( arg1_str)) == 0)
{
char name_str[80];
pwr_tCmd command_str;
char pixmap_str[80];
int pixmap;
int append = 1;
// Command is "CREATE OPMENUITEM"
if ( ODD( dcli_get_qualifier( "dcli_arg2", name_str, sizeof(name_str)))) {
if ( name_str[0] == '/') {
xnav->message('E', "Syntax error");
return XNAV__HOLDCOMMAND;
}
}
else if ( EVEN( dcli_get_qualifier( "/NAME", name_str, sizeof(name_str)))) {
xnav->message('E',"Enter name");
return XNAV__HOLDCOMMAND;
}
if ( EVEN( dcli_get_qualifier( "/COMMAND", command_str, sizeof(command_str)))) {
xnav->message('E',"Enter name");
return XNAV__HOLDCOMMAND;
}
if ( ODD( dcli_get_qualifier( "/PIXMAP", pixmap_str, sizeof(pixmap_str)))) {
if ( strcmp( pixmap_str, "GRAPH") == 0)
pixmap = wow_ePixmap_Graph;
else
pixmap = wow_ePixmap_No;
}
else
pixmap = wow_ePixmap_No;
if ( ODD( dcli_get_qualifier( "/BEFORE", 0, 0)))
append = 0;
if ( xnav->op) {
sts = xnav->op->create_menu_item( name_str, pixmap, append, command_str);
if ( EVEN(sts))
xnav->message('E',"Unable to create op menu item");
}
return XNAV__SUCCESS;
}
else if ( strncmp( arg1_str, "OBJECT", strlen( arg1_str)) == 0)
{
// Command is "CREATE OBJECT"
......@@ -3975,6 +4106,29 @@ static int xnav_delete_func( void *client_data,
return XNAV__SUCCESS;
}
else if ( strncmp( arg1_str, "OPMENUITEM", strlen( arg1_str)) == 0)
{
char name_str[80];
// Command is "DELETE OPMENUITEM"
if ( ODD( dcli_get_qualifier( "dcli_arg2", name_str, sizeof(name_str)))) {
if ( name_str[0] == '/') {
xnav->message('E', "Syntax error");
return XNAV__HOLDCOMMAND;
}
}
else if ( EVEN( dcli_get_qualifier( "/NAME", name_str, sizeof(name_str)))) {
xnav->message('E',"Enter name");
return XNAV__HOLDCOMMAND;
}
if ( xnav->op) {
sts = xnav->op->delete_menu_item( name_str);
if ( EVEN(sts))
xnav->message('E',"Unable to delete op menu item");
}
return XNAV__SUCCESS;
}
else if ( strncmp( arg1_str, "OBJECT", strlen( arg1_str)) == 0)
{
// Command is "DELETE OBJECT"
......@@ -4089,10 +4243,10 @@ static int xnav_store_func( void *client_data,
/* Assume that this is the filestring */
file_ptr = file_str;
else
file_ptr = xnav->gbl.symbolfilename;
file_ptr = xnav->gbl.setupscript;
}
else
file_ptr = xnav->gbl.symbolfilename;
file_ptr = xnav->gbl.setupscript;
dcli_get_defaultfilename( file_ptr, filename, ".rtt_com");
sts = dcli_store_symbols( filename);
......@@ -7034,4 +7188,37 @@ static void xnav_open_shist_cancel_cb( void *ctx)
free( ctx);
}
static void xnav_show_objectlist_cb( void *ctx, char *text)
{
XNav *xnav = ((xnav_sObjectList *)ctx)->xnav;
pwr_tCid cid = ((xnav_sObjectList *)ctx)->cid;
pwr_tCmd cmd;
free( ctx);
switch ( cid) {
case pwr_cClass_DsTrend:
sprintf( cmd, "open trend/name=%s/title=\"%s\"", text, text);
break;
case pwr_cClass_DsFastCurve:
sprintf( cmd, "open fast/name=%s/title=\"%s\"", text, text);
break;
case pwr_cClass_SevHist:
sprintf( cmd, "open history/name=%s/title=\"%s\"", text, text);
break;
case pwr_cClass_XttGraph:
sprintf( cmd, "open graph/object=%s", text);
break;
default:
sprintf( cmd, "open graph/class/instance=%s", text);
}
xnav->command( cmd);
}
static void xnav_show_objectlist_cancel_cb( void *ctx)
{
free( ctx);
}
......@@ -102,6 +102,7 @@ E 1.1.96 "Eventlog"
E 1.1.97 "Confirm"
E 1.1.98 "Search string"
E 1.1.99 "History"
E 1.1.100 " List"
#
# Logging entry
E 1.2.1 "Active"
......@@ -153,8 +154,8 @@ E 1.8.2 "_Next File"
E 1.8.3 "_Previous File"
E 1.8.4 "_Select File"
E 1.8.5 "_Filter"
E 1.8.6 "Consolelog"
E 1.8.7 "_Help on ConsoleLog"
E 1.8.6 "System Messages"
E 1.8.7 "_Help on System Messages"
E 1.8.8 "Help on _Selected Message"
#
# Eventlog
......@@ -230,6 +231,37 @@ E 1.12.15 "_Mode"
E 1.12.16 "On _Trace"
E 1.12.17 "On _PlcPgm"
#
# Operator Window
E 1.13.1 "Trend List"
E 1.13.2 "Fast Curve List"
E 1.13.3 "Process History List"
E 1.13.4 "Process Graphic List"
E 1.13.5 "Process Graphics"
E 1.13.6 "_OperatorWindow"
E 1.13.7 "_AlarmList"
E 1.13.8 "_EventList"
E 1.13.9 "Event_Log"
E 1.13.10 "_BlockList"
E 1.13.11 "_Alarm"
E 1.13.12 "_Trends"
E 1.13.13 "_Fast"
E 1.13.14 "_Process History"
E 1.13.15 "_Smaller Text"
E 1.13.16 "_Larger Text"
E 1.13.17 "_Navigator"
E 1.13.18 "_Process Graphics"
E 1.13.19 "Larger Text"
E 1.13.20 "Smaller Text"
E 1.13.21 "_Curves"
E 1.13.22 "Trend List"
E 1.13.23 "Fast Curve List"
E 1.13.24 "Process History List"
E 1.13.25 "Process Graphic List"
E 1.13.26 "_User"
E 1.13.27 "S_witch User"
E 1.13.28 "_Show User"
E 1.13.29 "_Return"
#
# Postscript printing
E 2.1.1 "Contents"
E 2.1.2 "page"
......
xtt/mmi/xtt/src/xtt_down.png

217 Bytes | W: | H:

xtt/mmi/xtt/src/xtt_down.png

196 Bytes | W: | H:

xtt/mmi/xtt/src/xtt_down.png
xtt/mmi/xtt/src/xtt_down.png
xtt/mmi/xtt/src/xtt_down.png
xtt/mmi/xtt/src/xtt_down.png
  • 2-up
  • Swipe
  • Onion skin
xtt/mmi/xtt/src/xtt_navigator.png

414 Bytes | W: | H:

xtt/mmi/xtt/src/xtt_navigator.png

583 Bytes | W: | H:

xtt/mmi/xtt/src/xtt_navigator.png
xtt/mmi/xtt/src/xtt_navigator.png
xtt/mmi/xtt/src/xtt_navigator.png
xtt/mmi/xtt/src/xtt_navigator.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -102,6 +102,7 @@ E 1.1.96 "H
E 1.1.97 "Verifiera"
E 1.1.98 "Skstrng"
E 1.1.99 "Historik"
E 1.1.100 " Lista"
#
# Logging entry
E 1.2.1 "Aktiv"
......@@ -153,8 +154,8 @@ E 1.8.2 "_N
E 1.8.3 "_Fregende Fil"
E 1.8.4 "_Vlj Fil"
E 1.8.5 "_Filter"
E 1.8.6 "Konsollogg"
E 1.8.7 "_Hjlp fr Konsollog"
E 1.8.6 "System Meddelanden"
E 1.8.7 "_Hjlp fr System Meddelanden"
E 1.8.8 "_Hjlp fr utvalt meddelande"
#
# Eventlog
......@@ -230,6 +231,37 @@ E 1.12.15 "_Mod"
E 1.12.16 "Om _Trace"
E 1.12.17 "Om _PlcPgm"
#
# Operator Window
E 1.13.1 "Trend Lista"
E 1.13.2 "Snabb Lista"
E 1.13.3 "Process Historik Lista"
E 1.13.4 "Process Grafik Lista"
E 1.13.5 "Process Grafik"
E 1.13.6 "_Operatrsfnster"
E 1.13.7 "_Larmlista"
E 1.13.8 "_Hndelselista"
E 1.13.9 "Hndelse_Logg"
E 1.13.10 "_Blockeringslista"
E 1.13.11 "_Larm"
E 1.13.12 "_Trendkurvor"
E 1.13.13 "_Snabbkurvor"
E 1.13.14 "_Process Historik"
E 1.13.15 "_Mindre text"
E 1.13.16 "_Strre text"
E 1.13.17 "_Navigatr"
E 1.13.18 "_Process Grafik"
E 1.13.19 "Strre text"
E 1.13.20 "Mindre text"
E 1.13.21 "_Kurvor"
E 1.13.22 "Trendkurvor"
E 1.13.23 "Snabbkurvor"
E 1.13.24 "Process Historik"
E 1.13.25 "Process Grafik"
E 1.13.26 "_Anvndare"
E 1.13.27 "_Byt Anvndare"
E 1.13.28 "_Visa Anvndare"
E 1.13.29 "_terg"
#
# Postscript printing
E 2.1.1 "Innehll"
E 2.1.2 "sidan"
......
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