Commit 030616ca authored by claes's avatar claes

New SystemMessage window

parent fcfd70dd
......@@ -103,6 +103,7 @@ static xnav_sStartMenu system_menu[] = {
{ "PlcThread", xnav_eItemType_Command, (void *) "show plcthread"},
{ "PlcPgm", xnav_eItemType_Command, (void *) "show plcpgm"},
{ "Logging", xnav_eItemType_Menu, (void *)&logging_menu},
{ "System Messages", xnav_eItemType_Command, (void *) "open consolelog"},
{ "", 0, NULL}};
static xnav_sStartMenu root_menu[] = {
{ "Database", xnav_eItemType_Command, (void *) "show database"},
......
This diff is collapsed.
#ifndef xtt_clog_h
#define xtt_clog_h
/* xtt_clog.h -- Alarm and event windows in xtt
PROVIEW/R
Copyright (C) 1996 by Comator Process AB.
<Description>. */
#if defined __cplusplus
extern "C" {
#endif
#ifndef pwr_h
# include "pwr.h"
#endif
#if defined __cplusplus
}
#endif
#ifndef xtt_clognav
# include "xtt_clognav.h"
#endif
class CLog {
public:
CLog(
void *clog_parent_ctx,
Widget clog_parent_wid,
char *clog_name,
pwr_tStatus *status);
~CLog();
void *parent_ctx;
Widget parent_wid;
Widget parent_wid_clog;
char name[80];
Widget toplevel;
Widget form_clog;
Widget clognav_widget;
Widget filter_form;
Widget show_success_w;
Widget show_info_w;
Widget show_warning_w;
Widget show_error_w;
Widget show_fatal_w;
Widget show_text_w;
Widget filter_string_w;
Widget filesel_form;
Widget filesel_list_w;
CLogNav *clognav;
int clog_displayed;
void (*help_cb)( void *, char *);
void (*close_cb)( void *);
bool filesel_loaded;
int clock_cursor;
void pop();
void set_clock_cursor();
void reset_cursor();
void free_cursor();
};
#endif
This diff is collapsed.
#ifndef xtt_clognav_h
#define xtt_clognav_h
/* xtt_clognav.h -- Console message window.
PROVIEW/R
Copyright (C) 1996 by Comator Process AB.
<Description>. */
// Status is defined as int i xlib...
#include <vector>
using namespace std;
#ifdef Status
# undef Status
#endif
#if defined __cplusplus
extern "C" {
#endif
#ifndef pwr_h
# include "pwr.h"
#endif
#ifndef rt_errh_h
# include "rt_errh.h"
#endif
#if defined __cplusplus
}
#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 {
clognav_eItemType_Msg,
clognav_eItemType_Restart
} clognav_eItemType;
class CLogNavFilter {
public:
CLogNavFilter() :
show_success(true), show_info(true), show_warning(true), show_error(true),
show_fatal(true), show_text(true)
{ strcpy( str, "");}
bool show_success;
bool show_info;
bool show_warning;
bool show_error;
bool show_fatal;
bool show_text;
char str[200];
};
class CLogNavBrow {
public:
CLogNavBrow( BrowCtx *brow_ctx, void *evl) : ctx(brow_ctx), clognav(evl) {};
~CLogNavBrow();
BrowCtx *ctx;
void *clognav;
brow_tNodeClass nc_event;
brow_tNodeClass nc_msg_info;
brow_tNodeClass nc_msg_warning;
brow_tNodeClass nc_msg_error;
brow_tNodeClass nc_msg_fatal;
brow_tNodeClass nc_restart;
brow_tNodeClass nc_text;
flow_sAnnotPixmap *pixmap_leaf;
flow_sAnnotPixmap *pixmap_map;
flow_sAnnotPixmap *pixmap_openmap;
void free_pixmaps();
void allocate_pixmaps();
void create_nodeclasses();
void brow_setup();
};
class CLogMsg {
public:
CLogMsg( errh_eSeverity msg_severity, char *msg_logger, int msg_pid,
pwr_tTime msg_time, char *msg_text) :
severity(msg_severity), pid(msg_pid), time(msg_time)
{
strncpy( logger, msg_logger, sizeof(logger));
strncpy( text, msg_text, sizeof(text));
}
errh_eSeverity severity;
char logger[40];
int pid;
pwr_tTime time;
char text[200];
};
class CLogFile {
public:
CLogFile()
{
strcpy( name, "");
}
CLogFile( char *file_name, pwr_tTime file_time) :
time( file_time)
{
strcpy( name, file_name);
}
char name[200];
pwr_tTime time;
};
class CLogNav {
public:
CLogNav(
void *ev_parent_ctx,
Widget ev_parent_wid,
Widget *w);
~CLogNav();
void *parent_ctx;
Widget parent_wid;
Widget brow_widget;
Widget form_widget;
Widget toplevel;
CLogNavBrow *brow;
CLogNavFilter filter;
int clog_size;
int max_size;
vector<CLogMsg> msg_list;
vector<CLogFile> file_list;
int current_pos_high;
int current_pos_low;
void set_input_focus();
void zoom( double zoom_factor);
void unzoom();
void set_nodraw();
void reset_nodraw();
void read( int *idx_list, int idx_cnt);
void set_filter( bool success, bool info, bool warning, bool error, bool fatal,
bool text, char *str);
void get_filter( bool *success, bool *info, bool *warning, bool *error, bool *fatal,
bool *text);
void draw();
void get_files();
int next_file();
int prev_file();
};
class ItemMsgBase {
public:
ItemMsgBase( CLogNav *item_clognav, char *item_name, brow_tNode dest) :
clognav(item_clognav), node(dest)
{
strcpy( name, item_name);
}
clognav_eItemType type;
CLogNav *clognav;
brow_tNode node;
char name[40];
};
class ItemMsgRestart : public ItemMsgBase {
public:
ItemMsgRestart( CLogNav *clognav, char *item_name, pwr_tTime item_time,
brow_tNode dest, flow_eDest dest_code);
pwr_tTime time;
};
class ItemMsg : public ItemMsgBase {
public:
ItemMsg( CLogNav *clognav, char *item_name, errh_eSeverity item_severity,
char *item_logger, int item_pid, pwr_tTime item_time, char *item_text,
brow_tNode dest, flow_eDest dest_code);
errh_eSeverity severity;
char logger[40];
int pid;
pwr_tTime time;
char text[200];
};
#endif
......@@ -959,7 +959,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), ccm_func_registred(0), verify(0),
menu_tree(NULL), ev(NULL), op(NULL), closing_down(0),
menu_tree(NULL), ev(0), op(0), clog(0), closing_down(0),
base_priv(pwr_mPrv_System), priv(pwr_mPrv_System), displayed(0),
current_logging_index(-1), search_last_found(0), search_compiled(0)
{
......
......@@ -80,6 +80,10 @@ extern "C" {
#include "xtt_menu.h"
#endif
#ifndef xtt_clog_h
#include "xtt_clog.h"
#endif
#define xnav_cVersion "X3.0b"
#define XNAV_BROW_MAX 25
#define XNAV_LOGG_MAX 10
......@@ -259,6 +263,7 @@ class XNav {
xnav_sMenu *menu_tree;
Ev *ev;
Op *op;
CLog *clog;
int closing_down;
char opplace_name[80];
char base_user[80];
......
......@@ -103,6 +103,7 @@ static void xnav_op_map_cb( void *ctx);
static int xnav_op_get_alarm_info_cb( void *xnav, evlist_sAlarmInfo *info);
static void xnav_op_ack_last_cb( void *xnav, unsigned long type, unsigned long prio);
static void xnav_trend_close_cb( void *ctx, XttTrend *trend);
static void xnav_clog_close_cb( void *ctx);
static int xnav_help_func( void *client_data,
void *client_flag);
......@@ -2422,6 +2423,24 @@ static int xnav_open_func( void *client_data,
if ( EVEN(sts))
xnav->message(' ', XNav::get_message(sts));
}
else if ( strncmp( arg1_str, "CONSOLELOG", strlen( arg1_str)) == 0)
{
int sts;
if ( xnav->clog)
xnav->clog->pop();
else {
xnav->clog = new CLog( xnav, xnav->parent_wid, "Console log", &sts);
if ( EVEN(sts)) {
delete xnav->clog;
xnav->op = 0;
xnav->message('E', "Unable to open console log");
return XNAV__SUCCESS;
}
xnav->clog->help_cb = xnav_ev_help_cb;
xnav->clog->close_cb = xnav_clog_close_cb;
}
}
else
xnav->message('E',"Syntax error");
......@@ -5030,6 +5049,13 @@ void xnav_start_trace_cb( void *xnav, pwr_tObjid objid, char *name)
((XNav *)xnav)->start_trace( objid, name);
}
static void xnav_clog_close_cb( void *ctx)
{
XNav *xnav = (XNav *)ctx;
delete xnav->clog;
xnav->clog = 0;
}
static void xnav_ev_help_cb( void *ctx, char *key)
{
XNav *xnav = (XNav *) ctx;
......
......@@ -11,6 +11,7 @@
#include <stdlib.h>
extern "C" {
#include "rt_net.h"
#include "rt_gdh.h"
#include "rt_gdh_msg.h"
#include "co_cdh.h"
......@@ -44,7 +45,6 @@ extern "C" {
#include "rt_qdb.h"
#include "rt_hash.h"
#include "rt_pool.h"
#include "rt_net.h"
#include "rt_sub.h"
#include "rt_io_base.h"
}
......
......@@ -58,6 +58,15 @@ c_Hide_event_name : compound_string("Hide event name");
c_Hide_event_text : compound_string("Hide event text");
c_Help_on_selected_event : compound_string("Help on selected event");
! module xtt_clog.uil
c_NextFile : compound_string("Next File");
c_PreviousFile : compound_string("Previous File");
c_SelectFile : compound_string("Select File");
c_Filter : compound_string("Filter");
c_Consolelog : compound_string("ConsoleLog");
c_Help_on_selected_msg : compound_string("Help on selected message");
! module xtt_trace.uil
c_SaveTrace : compound_string("SaveTrace");
......
This diff is collapsed.
......@@ -58,6 +58,15 @@ c_Hide_event_name : compound_string("D
c_Hide_event_text : compound_string("Dlj hndelsetext");
c_Help_on_selected_event : compound_string("Hjlp fr utvald hndelse");
! module xtt_clog.uil
c_NextFile : compound_string("Nsta Fil");
c_PreviousFile : compound_string("Fregende Fil");
c_SelectFile : compound_string("Vlj Fil");
c_Filter : compound_string("Filter");
c_Consolelog : compound_string("Konsollogg");
c_Help_on_selected_msg : compound_string("Hjlp fr utvalt meddelande");
! module xtt_trace.uil
c_SaveTrace : compound_string("Spara Trace");
......
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