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
a1f2bba2
Commit
a1f2bba2
authored
Sep 27, 2019
by
Claes Sjofors
Committed by
Claes Sjöfors
Mar 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Xtt eventlist and eventlog, File/Export added
parent
b0ef4d54
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
173 additions
and
22 deletions
+173
-22
wb/lib/wb/gtk/wb_wtt_gtk.cpp
wb/lib/wb/gtk/wb_wtt_gtk.cpp
+2
-2
wb/lib/wb/qt/wb_wtt_qt.cqt
wb/lib/wb/qt/wb_wtt_qt.cqt
+4
-2
wb/lib/wb/src/wb_bckw.cpp
wb/lib/wb/src/wb_bckw.cpp
+2
-2
xtt/lib/cow/gtk/cow_wow_gtk.cpp
xtt/lib/cow/gtk/cow_wow_gtk.cpp
+12
-2
xtt/lib/cow/gtk/cow_wow_gtk.h
xtt/lib/cow/gtk/cow_wow_gtk.h
+1
-1
xtt/lib/cow/qt/cow_wow_qt.cqt
xtt/lib/cow/qt/cow_wow_qt.cqt
+7
-2
xtt/lib/cow/src/cow_wow.cpp
xtt/lib/cow/src/cow_wow.cpp
+1
-1
xtt/lib/cow/src/cow_wow.h
xtt/lib/cow/src/cow_wow.h
+7
-1
xtt/lib/ge/gtk/ge_curve_gtk.cpp
xtt/lib/ge/gtk/ge_curve_gtk.cpp
+1
-1
xtt/lib/ge/gtk/ge_gtk.cpp
xtt/lib/ge/gtk/ge_gtk.cpp
+2
-2
xtt/lib/ge/qt/ge_qt.cqt
xtt/lib/ge/qt/ge_qt.cqt
+4
-4
xtt/lib/ge/src/ge.cpp
xtt/lib/ge/src/ge.cpp
+1
-1
xtt/lib/xtt/gtk/xtt_ev_gtk.cpp
xtt/lib/xtt/gtk/xtt_ev_gtk.cpp
+12
-1
xtt/lib/xtt/gtk/xtt_ev_gtk.h
xtt/lib/xtt/gtk/xtt_ev_gtk.h
+1
-0
xtt/lib/xtt/gtk/xtt_hist_gtk.cpp
xtt/lib/xtt/gtk/xtt_hist_gtk.cpp
+12
-0
xtt/lib/xtt/gtk/xtt_hist_gtk.h
xtt/lib/xtt/gtk/xtt_hist_gtk.h
+1
-0
xtt/lib/xtt/qt/xtt_ev_qt.cqt
xtt/lib/xtt/qt/xtt_ev_qt.cqt
+6
-0
xtt/lib/xtt/qt/xtt_ev_qt.h
xtt/lib/xtt/qt/xtt_ev_qt.h
+1
-0
xtt/lib/xtt/src/xtt_ev.cpp
xtt/lib/xtt/src/xtt_ev.cpp
+42
-0
xtt/lib/xtt/src/xtt_ev.h
xtt/lib/xtt/src/xtt_ev.h
+6
-0
xtt/lib/xtt/src/xtt_hist.cpp
xtt/lib/xtt/src/xtt_hist.cpp
+42
-0
xtt/lib/xtt/src/xtt_hist.h
xtt/lib/xtt/src/xtt_hist.h
+6
-0
No files found.
wb/lib/wb/gtk/wb_wtt_gtk.cpp
View file @
a1f2bba2
...
...
@@ -1287,7 +1287,7 @@ void WttGtk::activate_openfile_dbs(GtkWidget* w, gpointer data)
wtt
->
set_clock_cursor
();
wtt
->
wnav
->
wow
->
CreateFileSelDia
(
"Loadfile Selection"
,
(
void
*
)
wtt
,
Wtt
::
file_selected_cb
,
wow_eFileSelType_Dbs
);
Wtt
::
file_selected_cb
,
wow_eFileSelType_Dbs
,
wow_eFileSelAction_Open
);
wtt
->
reset_cursor
();
}
...
...
@@ -1297,7 +1297,7 @@ void WttGtk::activate_openfile_wbl(GtkWidget* w, gpointer data)
wtt
->
set_clock_cursor
();
wtt
->
wnav
->
wow
->
CreateFileSelDia
(
"Loadfile Selection"
,
(
void
*
)
wtt
,
Wtt
::
file_selected_cb
,
wow_eFileSelType_Wbl
);
Wtt
::
file_selected_cb
,
wow_eFileSelType_Wbl
,
wow_eFileSelAction_Open
);
wtt
->
reset_cursor
();
}
...
...
wb/lib/wb/qt/wb_wtt_qt.cqt
View file @
a1f2bba2
...
...
@@ -1179,7 +1179,8 @@ void WttQtWidget::activate_openfile_dbs()
{
wtt->set_clock_cursor();
wtt->wnav->wow->CreateFileSelDia(
"Loadfile Selection", wtt, Wtt::file_selected_cb, wow_eFileSelType_Dbs);
"Loadfile Selection", wtt, Wtt::file_selected_cb, wow_eFileSelType_Dbs,
wow_eFileSelAction_Open);
wtt->reset_cursor();
}
...
...
@@ -1187,7 +1188,8 @@ void WttQtWidget::activate_openfile_wbl()
{
wtt->set_clock_cursor();
wtt->wnav->wow->CreateFileSelDia(
"Loadfile Selection", wtt, Wtt::file_selected_cb, wow_eFileSelType_Wbl);
"Loadfile Selection", wtt, Wtt::file_selected_cb, wow_eFileSelType_Wbl,
wow_eFileSelAction_Open);
wtt->reset_cursor();
}
...
...
wb/lib/wb/src/wb_bckw.cpp
View file @
a1f2bba2
...
...
@@ -100,7 +100,7 @@ void WbBckW::filter_cb(void* ctx, void* data, char* text)
void
WbBckW
::
activate_open
()
{
wow
->
CreateFileSelDia
(
"Backup File Selection"
,
(
void
*
)
this
,
file_selected_cb
,
wow_eFileSelType_Backup
);
wow_eFileSelType_Backup
,
wow_eFileSelAction_Open
);
}
void
WbBckW
::
file_selected_cb
(
...
...
@@ -138,7 +138,7 @@ void WbBckW::activate_diff()
return
;
wow
->
CreateFileSelDia
(
"Backup File Selection"
,
(
void
*
)
this
,
diff_file_selected_cb
,
wow_eFileSelType_Backup
);
diff_file_selected_cb
,
wow_eFileSelType_Backup
,
wow_eFileSelAction_Open
);
}
void
WbBckW
::
diff_file_selected_cb
(
...
...
xtt/lib/cow/gtk/cow_wow_gtk.cpp
View file @
a1f2bba2
...
...
@@ -864,13 +864,19 @@ int CoWowGtk::GetSelection(GtkWidget* w, char* str, int size, GdkAtom atom)
void
CoWowGtk
::
CreateFileSelDia
(
const
char
*
title
,
void
*
parent_ctx
,
void
(
*
file_selected_cb
)(
void
*
,
char
*
,
wow_eFileSelType
),
wow_eFileSelType
file_type
)
wow_eFileSelType
file_type
,
wow_eFileSelAction
action
)
{
GtkWidget
*
dialog
;
pwr_tFileName
fname
;
GtkFileChooserAction
gaction
;
if
(
action
==
wow_eFileSelAction_Open
)
gaction
=
GTK_FILE_CHOOSER_ACTION_OPEN
;
else
gaction
=
GTK_FILE_CHOOSER_ACTION_SAVE
;
dialog
=
gtk_file_chooser_dialog_new
(
title
,
NULL
,
GTK_FILE_CHOOSER_ACTION_OPEN
,
GTK_STOCK_CANCEL
,
GTK_RESPONSE_CANCEL
,
gaction
,
GTK_STOCK_CANCEL
,
GTK_RESPONSE_CANCEL
,
GTK_STOCK_OPEN
,
GTK_RESPONSE_ACCEPT
,
NULL
);
if
(
file_type
==
wow_eFileSelType_Dbs
)
{
...
...
@@ -962,6 +968,10 @@ void CoWowGtk::CreateFileSelDia(const char* title, void* parent_ctx,
gtk_file_filter_set_name
(
filter
,
"All Files"
);
gtk_file_filter_add_pattern
(
filter
,
"*"
);
gtk_file_chooser_add_filter
(
GTK_FILE_CHOOSER
(
dialog
),
filter
);
}
else
if
(
file_type
==
wow_eFileSelType_Tmp
)
{
pwr_tFileName
folder
;
dcli_translate_filename
(
folder
,
"$pwrp_tmp"
);
gtk_file_chooser_set_current_folder
(
GTK_FILE_CHOOSER
(
dialog
),
folder
);
}
if
(
gtk_dialog_run
(
GTK_DIALOG
(
dialog
))
==
GTK_RESPONSE_ACCEPT
)
{
...
...
xtt/lib/cow/gtk/cow_wow_gtk.h
View file @
a1f2bba2
...
...
@@ -144,7 +144,7 @@ public:
void
DeleteList
(
void
*
ctx
);
void
CreateFileSelDia
(
const
char
*
title
,
void
*
parent_ctx
,
void
(
*
file_selected_cb
)(
void
*
,
char
*
,
wow_eFileSelType
),
wow_eFileSelType
file_type
);
wow_eFileSelType
file_type
,
wow_eFileSelAction
action
);
int
CreateModalDialog
(
const
char
*
title
,
const
char
*
text
,
const
char
*
button1
,
const
char
*
button2
,
const
char
*
button3
,
const
char
*
image
);
...
...
xtt/lib/cow/qt/cow_wow_qt.cqt
View file @
a1f2bba2
...
...
@@ -478,7 +478,7 @@ int CoWowQt::GetSelection(char* str, int size, const char* atom)
void CoWowQt::CreateFileSelDia(const char* title, void* parent_ctx,
void (*file_selected_cb)(void*, char*, wow_eFileSelType),
wow_eFileSelType file_type)
wow_eFileSelType file_type
, wow_eFileSelAction action
)
{
pwr_tFileName folder;
QString filter;
...
...
@@ -500,11 +500,16 @@ void CoWowQt::CreateFileSelDia(const char* title, void* parent_ctx,
} else if (file_type == wow_eFileSelType_Backup) {
dcli_translate_filename(folder, "$pwrp_load");
filter = "Backup files (*.bck);;All Files (*)";
} else if (file_type == wow_eFileSelType_Tmp) {
dcli_translate_filename(folder, "$pwrp_tmp");
}
// QFileDialog::getOpenFileName() is broken
QFileDialog dialog(object->parent_wid, fl(title), fl(folder), filter);
dialog.setFileMode(QFileDialog::ExistingFile);
if (action == wow_eFileSelAction_Open)
dialog.setFileMode(QFileDialog::ExistingFile);
else
dialog.setFileMode(QFileDialog::AnyFile);
int sts = dialog.exec();
if (sts == QDialog::Accepted && dialog.selectedFiles().length() > 0) {
...
...
xtt/lib/cow/src/cow_wow.cpp
View file @
a1f2bba2
...
...
@@ -176,7 +176,7 @@ void CoWow::DeleteList(void* ctx)
void
CoWow
::
CreateFileSelDia
(
const
char
*
title
,
void
*
parent_ctx
,
void
(
*
file_selected_cb
)(
void
*
,
char
*
,
wow_eFileSelType
),
wow_eFileSelType
file_type
)
wow_eFileSelType
file_type
,
wow_eFileSelAction
action
)
{
}
...
...
xtt/lib/cow/src/cow_wow.h
View file @
a1f2bba2
...
...
@@ -42,6 +42,11 @@
#include "co_wow_msg.h"
#include "co_lng.h"
typedef
enum
{
wow_eFileSelAction_Save
,
wow_eFileSelAction_Open
}
wow_eFileSelAction
;
typedef
enum
{
wow_eFileSelType_
,
wow_eFileSelType_All
,
...
...
@@ -53,6 +58,7 @@ typedef enum {
wow_eFileSelType_History
,
wow_eFileSelType_Backup
,
wow_eFileSelType_ColorTheme
,
wow_eFileSelType_Tmp
,
wow_eFileSelType__
}
wow_eFileSelType
;
...
...
@@ -133,7 +139,7 @@ public:
virtual
void
DeleteList
(
void
*
ctx
);
virtual
void
CreateFileSelDia
(
const
char
*
title
,
void
*
parent_ctx
,
void
(
*
file_selected_cb
)(
void
*
,
char
*
,
wow_eFileSelType
),
wow_eFileSelType
file_type
);
wow_eFileSelType
file_type
,
wow_eFileSelAction
action
);
virtual
int
CreateModalDialog
(
const
char
*
title
,
const
char
*
text
,
const
char
*
button1
,
const
char
*
button2
,
const
char
*
button3
,
const
char
*
image
);
...
...
xtt/lib/ge/gtk/ge_curve_gtk.cpp
View file @
a1f2bba2
...
...
@@ -534,7 +534,7 @@ void GeCurveGtk::activate_export_browse(GtkWidget* w, gpointer data)
GeCurve
*
curve
=
(
GeCurve
*
)
data
;
curve
->
wow
->
CreateFileSelDia
(
CoWowGtk
::
translate_utf8
(
"File Selection"
),
(
void
*
)
curve
,
export_file_selected_cb
,
wow_eFileSelType_History
);
(
void
*
)
curve
,
export_file_selected_cb
,
wow_eFileSelType_History
,
wow_eFileSelAction_Open
);
}
void
GeCurveGtk
::
export_file_selected_cb
(
...
...
xtt/lib/ge/gtk/ge_gtk.cpp
View file @
a1f2bba2
...
...
@@ -857,14 +857,14 @@ void GeGtk::activate_import_graph(GtkWidget* w, gpointer gectx)
{
((
Ge
*
)
gectx
)
->
wow
->
CreateFileSelDia
(
"Graph Selection"
,
(
void
*
)
gectx
,
graph_file_selected_cb
,
wow_eFileSelType_Graph
);
graph_file_selected_cb
,
wow_eFileSelType_Graph
,
wow_eFileSelAction_Open
);
}
void
GeGtk
::
activate_import_image
(
GtkWidget
*
w
,
gpointer
gectx
)
{
((
Ge
*
)
gectx
)
->
wow
->
CreateFileSelDia
(
"Image Selection"
,
(
void
*
)
gectx
,
image_file_selected_cb
,
wow_eFileSelType_Image
);
image_file_selected_cb
,
wow_eFileSelType_Image
,
wow_eFileSelAction_Open
);
}
void
GeGtk
::
activate_creanextpage
(
GtkWidget
*
w
,
gpointer
gectx
)
...
...
xtt/lib/ge/qt/ge_qt.cqt
View file @
a1f2bba2
...
...
@@ -821,14 +821,14 @@ void GeQtWidget::activate_customcolors_write()
void GeQtWidget::activate_import_graph()
{
ge->wow->CreateFileSelDia("Graph Selection",
(void*)this
,
GeQt::graph_file_selected_cb, wow_eFileSelType_Graph);
ge->wow->CreateFileSelDia("Graph Selection",
ge
,
GeQt::graph_file_selected_cb, wow_eFileSelType_Graph
, wow_eFileSelAction_Open
);
}
void GeQtWidget::activate_import_image()
{
ge->wow->CreateFileSelDia("Image Selection",
(void*)this
,
GeQt::image_file_selected_cb, wow_eFileSelType_Image);
ge->wow->CreateFileSelDia("Image Selection",
ge
,
GeQt::image_file_selected_cb, wow_eFileSelType_Image
, wow_eFileSelAction_Open
);
}
void GeQtWidget::activate_creanextpage()
...
...
xtt/lib/ge/src/ge.cpp
View file @
a1f2bba2
...
...
@@ -1626,7 +1626,7 @@ void Ge::activate_colortheme_next()
void
Ge
::
activate_customcolors_read
()
{
wow
->
CreateFileSelDia
(
"CustomColors Selection"
,
(
void
*
)
this
,
customcolors_selected_cb
,
wow_eFileSelType_ColorTheme
);
customcolors_selected_cb
,
wow_eFileSelType_ColorTheme
,
wow_eFileSelAction_Open
);
}
void
Ge
::
customcolors_selected_cb
(
...
...
xtt/lib/xtt/gtk/xtt_ev_gtk.cpp
View file @
a1f2bba2
...
...
@@ -156,6 +156,11 @@ EvGtk::EvGtk(void* ev_parent_ctx, GtkWidget* ev_parent_wid, char* eve_name,
g_signal_connect
(
file_print
,
"activate"
,
G_CALLBACK
(
eve_activate_print
),
this
);
GtkWidget
*
file_export
=
gtk_image_menu_item_new_with_mnemonic
(
CoWowGtk
::
translate_utf8
(
"_Export"
));
g_signal_connect
(
file_export
,
"activate"
,
G_CALLBACK
(
eve_activate_export
),
this
);
GtkWidget
*
file_close
=
gtk_image_menu_item_new_with_mnemonic
(
CoWowGtk
::
translate_utf8
(
"_Close"
));
gtk_image_menu_item_set_image
(
GTK_IMAGE_MENU_ITEM
(
file_close
),
...
...
@@ -167,6 +172,7 @@ EvGtk::EvGtk(void* ev_parent_ctx, GtkWidget* ev_parent_wid, char* eve_name,
GtkMenu
*
file_menu
=
(
GtkMenu
*
)
g_object_new
(
GTK_TYPE_MENU
,
NULL
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_print
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_export
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_close
);
GtkWidget
*
file
...
...
@@ -1214,7 +1220,12 @@ void EvGtk::blk_activate_print(GtkWidget* w, gpointer data)
ev
->
blk_activate_print
();
}
void
EvGtk
::
eve_activate_ack_last
(
GtkWidget
*
w
,
gpointer
data
)
void
EvGtk
::
eve_activate_export
(
GtkWidget
*
w
,
gpointer
ev
)
{
((
Ev
*
)
ev
)
->
eve_activate_export
();
}
void
EvGtk
::
eve_activate_ack_last
(
GtkWidget
*
w
,
gpointer
ev
)
{
Ev
*
ev
=
(
Ev
*
)
data
;
...
...
xtt/lib/xtt/gtk/xtt_ev_gtk.h
View file @
a1f2bba2
...
...
@@ -94,6 +94,7 @@ public:
static
void
eve_activate_print
(
GtkWidget
*
w
,
gpointer
data
);
static
void
ala_activate_print
(
GtkWidget
*
w
,
gpointer
data
);
static
void
blk_activate_print
(
GtkWidget
*
w
,
gpointer
data
);
static
void
eve_activate_export
(
GtkWidget
*
w
,
gpointer
data
);
static
void
eve_activate_ack_last
(
GtkWidget
*
w
,
gpointer
data
);
static
void
ala_activate_ack_last
(
GtkWidget
*
w
,
gpointer
data
);
static
void
ala_activate_ack_all
(
GtkWidget
*
w
,
gpointer
data
);
...
...
xtt/lib/xtt/gtk/xtt_hist_gtk.cpp
View file @
a1f2bba2
...
...
@@ -122,6 +122,10 @@ HistGtk::HistGtk(void* hist_parent_ctx, GtkWidget* hist_parent_wid,
gtk_image_new_from_stock
(
"gtk-print"
,
GTK_ICON_SIZE_MENU
));
g_signal_connect
(
file_print
,
"activate"
,
G_CALLBACK
(
activate_print
),
this
);
GtkWidget
*
file_export
=
gtk_image_menu_item_new_with_mnemonic
(
CoWowGtk
::
translate_utf8
(
"_Export"
));
g_signal_connect
(
file_export
,
"activate"
,
G_CALLBACK
(
activate_export
),
this
);
GtkWidget
*
file_close
=
gtk_image_menu_item_new_with_mnemonic
(
CoWowGtk
::
translate_utf8
(
"_Close"
));
gtk_image_menu_item_set_image
(
GTK_IMAGE_MENU_ITEM
(
file_close
),
...
...
@@ -132,6 +136,7 @@ HistGtk::HistGtk(void* hist_parent_ctx, GtkWidget* hist_parent_wid,
GtkMenu
*
file_menu
=
(
GtkMenu
*
)
g_object_new
(
GTK_TYPE_MENU
,
NULL
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_print
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_export
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_close
);
GtkWidget
*
file
...
...
@@ -717,6 +722,13 @@ void HistGtk::activate_print(GtkWidget* w, gpointer data)
histOP
->
activate_print
();
}
void
HistGtk
::
activate_export
(
GtkWidget
*
w
,
gpointer
data
)
{
Hist
*
histOP
=
(
Hist
*
)
data
;
histOP
->
activate_export
();
}
void
HistGtk
::
activate_zoom_in
(
GtkWidget
*
w
,
gpointer
data
)
{
Hist
*
histOP
=
(
Hist
*
)
data
;
...
...
xtt/lib/xtt/gtk/xtt_hist_gtk.h
View file @
a1f2bba2
...
...
@@ -92,6 +92,7 @@ public:
GtkWidget
*
w
,
GdkEvent
*
event
,
gpointer
data
);
static
void
activate_exit
(
GtkWidget
*
w
,
gpointer
data
);
static
void
activate_print
(
GtkWidget
*
w
,
gpointer
data
);
static
void
activate_export
(
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
);
...
...
xtt/lib/xtt/qt/xtt_ev_qt.cqt
View file @
a1f2bba2
...
...
@@ -135,6 +135,7 @@ EvQt::EvQt(void* ev_parent_ctx, char* eve_name, char* ala_name, char* blk_name,
QMenu* file = menu_bar->addMenu(translate_utf8("&File"));
addMenuItem(object, file, "&Print", SLOT(eve_activate_print()), "",
"document-print");
addMenuItem(object, file, "&Export", SLOT(eve_activate_export()));
addMenuItem(
object, file, "&Close", SLOT(eve_activate_exit()), "CTRL+W", "window-close");
...
...
@@ -687,6 +688,11 @@ void EvQtObject::blk_activate_print()
ev->blk_activate_print();
}
void EvQtObject::eve_activate_export()
{
ev->eve_activate_export();
}
void EvQtObject::eve_activate_ack_last()
{
ev->eve_activate_ack_last();
...
...
xtt/lib/xtt/qt/xtt_ev_qt.h
View file @
a1f2bba2
...
...
@@ -99,6 +99,7 @@ public slots:
void
eve_activate_print
();
void
ala_activate_print
();
void
blk_activate_print
();
void
eve_activate_export
();
void
eve_activate_ack_last
();
void
ala_activate_ack_last
();
void
ala_activate_ack_all
();
...
...
xtt/lib/xtt/src/xtt_ev.cpp
View file @
a1f2bba2
...
...
@@ -270,6 +270,48 @@ void Ev::blk_activate_print()
blk
->
print
(
title
);
}
void
Ev
::
eve_activate_export
()
{
wow
->
CreateFileSelDia
(
"Export"
,
(
void
*
)
this
,
eve_export_file_selected_cb
,
wow_eFileSelType_Tmp
,
wow_eFileSelAction_Save
);
}
void
Ev
::
eve_export_file_selected_cb
(
void
*
ctx
,
char
*
filename
,
wow_eFileSelType
file_type
)
{
((
Ev
*
)
ctx
)
->
eve_export_events
(
filename
);
}
int
Ev
::
eve_export_events
(
const
char
*
filename
)
{
brow_tObject
*
list
;
int
list_cnt
;
ItemAlarm
*
item
;
char
timstr
[
40
];
char
supobjectstr
[
80
];
pwr_tFileName
fname
;
FILE
*
fp
;
dcli_translate_filename
(
fname
,
filename
);
fp
=
fopen
(
fname
,
"w"
);
if
(
!
fp
)
return
0
;
fprintf
(
fp
,
"Time,Type,Prio,Text,Name,SupObject,Id,Status
\n
"
);
brow_GetObjectList
(
eve
->
brow
->
ctx
,
&
list
,
&
list_cnt
);
for
(
int
i
=
0
;
i
<
list_cnt
;
i
++
)
{
brow_GetUserData
(
list
[
i
],
(
void
**
)
&
item
);
time_AtoAscii
(
&
item
->
time
,
time_eFormat_NumDateAndTime
,
timstr
,
sizeof
(
timstr
));
strcpy
(
supobjectstr
,
cdh_ObjidToString
(
item
->
supobject
.
Objid
,
1
));
if
(
item
->
supobject
.
Flags
.
b
.
ObjectAttr
)
sprintf
(
&
supobjectstr
[
strlen
(
supobjectstr
)],
"#%u:%u"
,
item
->
supobject
.
Offset
,
item
->
supobject
.
Size
);
fprintf
(
fp
,
"%s,%u,%lu,
\"
%s
\"
,
\"
%s
\"
,%s,
\"
(%u,%u)
\"
,%u
\n
"
,
timstr
,
item
->
eventtype
,
item
->
eventprio
,
item
->
eventtext
,
item
->
eventname
,
supobjectstr
,
item
->
eventid
.
Nix
,
item
->
eventid
.
Idx
,
item
->
status
);
}
fclose
(
fp
);
return
1
;
}
void
Ev
::
eve_activate_ack_last
()
{
mh_sEventId
*
id
;
...
...
xtt/lib/xtt/src/xtt_ev.h
View file @
a1f2bba2
...
...
@@ -45,6 +45,9 @@
#ifndef xtt_eveve
#include "xtt_eveve.h"
#endif
#ifndef cow_wow
#include "cow_wow.h"
#endif
class
CoWow
;
class
XttMethodToolbar
;
...
...
@@ -176,10 +179,12 @@ public:
char
*
name_to_alias
(
char
*
name
);
pwr_tStatus
set_view
(
pwr_tOid
view
);
void
view_shift
();
int
eve_export_events
(
const
char
*
filename
);
void
eve_activate_print
();
void
ala_activate_print
();
void
blk_activate_print
();
void
eve_activate_export
();
void
ala_activate_ack_last
();
void
eve_activate_ack_last
();
void
eve_activate_ack_all
();
...
...
@@ -210,6 +215,7 @@ public:
static
void
seve_copy_list_cb
(
void
*
ctx
,
EvList
*
evl
);
static
void
seve_close_cb
(
void
*
ctx
,
EvEve
*
seve
);
static
void
help_event_cb
(
void
*
ctx
,
void
*
item
);
static
void
eve_export_file_selected_cb
(
void
*
ctx
,
char
*
filename
,
wow_eFileSelType
file_type
);
static
pwr_tStatus
mh_ack_bc
(
mh_sAck
*
MsgP
);
static
pwr_tStatus
mh_return_bc
(
mh_sReturn
*
MsgP
);
...
...
xtt/lib/xtt/src/xtt_hist.cpp
View file @
a1f2bba2
...
...
@@ -148,6 +148,48 @@ void Hist::activate_print()
hist
->
print
(
Lng
::
translate
(
"Eventlog"
));
}
void
Hist
::
activate_export
()
{
wow
->
CreateFileSelDia
(
"Export"
,
(
void
*
)
this
,
export_file_selected_cb
,
wow_eFileSelType_Tmp
,
wow_eFileSelAction_Save
);
}
void
Hist
::
export_file_selected_cb
(
void
*
ctx
,
char
*
filename
,
wow_eFileSelType
file_type
)
{
((
Hist
*
)
ctx
)
->
export_events
(
filename
);
}
int
Hist
::
export_events
(
const
char
*
filename
)
{
brow_tObject
*
list
;
int
list_cnt
;
ItemAlarm
*
item
;
char
timstr
[
40
];
char
supobjectstr
[
80
];
pwr_tFileName
fname
;
FILE
*
fp
;
dcli_translate_filename
(
fname
,
filename
);
fp
=
fopen
(
fname
,
"w"
);
if
(
!
fp
)
return
0
;
fprintf
(
fp
,
"Time,Type,Prio,Text,Name,SupObject,Id,Status
\n
"
);
brow_GetObjectList
(
hist
->
brow
->
ctx
,
&
list
,
&
list_cnt
);
for
(
int
i
=
0
;
i
<
list_cnt
;
i
++
)
{
brow_GetUserData
(
list
[
i
],
(
void
**
)
&
item
);
time_AtoAscii
(
&
item
->
time
,
time_eFormat_NumDateAndTime
,
timstr
,
sizeof
(
timstr
));
strcpy
(
supobjectstr
,
cdh_ObjidToString
(
item
->
supobject
.
Objid
,
1
));
if
(
item
->
supobject
.
Flags
.
b
.
ObjectAttr
)
sprintf
(
&
supobjectstr
[
strlen
(
supobjectstr
)],
"#%u:%u"
,
item
->
supobject
.
Offset
,
item
->
supobject
.
Size
);
fprintf
(
fp
,
"%s,%u,%lu,
\"
%s
\"
,
\"
%s
\"
,%s,
\"
(%u,%u)
\"
,%u
\n
"
,
timstr
,
item
->
eventtype
,
item
->
eventprio
,
item
->
eventtext
,
item
->
eventname
,
supobjectstr
,
item
->
eventid
.
Nix
,
item
->
eventid
.
Idx
,
item
->
status
);
}
fclose
(
fp
);
return
1
;
}
void
Hist
::
activate_help
()
{
if
(
help_cb
)
...
...
xtt/lib/xtt/src/xtt_hist.h
View file @
a1f2bba2
...
...
@@ -50,6 +50,9 @@ extern "C" {
#ifndef xtt_evlist
#include "xtt_evlist.h"
#endif
#ifndef cow_wow
#include "cow_wow.h"
#endif
#define ERROR_TIME_CONVERT -99
class
CoWow
;
...
...
@@ -133,10 +136,12 @@ public:
}
void
activate_print
();
void
activate_export
();
void
activate_help
();
void
activate_helpevent
();
void
time_cb
(
time_ePeriod
period
);
void
stat
();
int
export_events
(
const
char
*
filename
);
static
int
GoBackMonth
(
pwr_tTime
TimeIn
,
pwr_tTime
*
FromTime
,
pwr_tTime
*
ToTime
);
...
...
@@ -154,6 +159,7 @@ public:
static
void
help_event_cb
(
void
*
ctx
,
void
*
item
);
static
void
selection_changed_cb
(
void
*
ctx
);
static
void
hist_init_cb
(
void
*
ctx
);
static
void
export_file_selected_cb
(
void
*
ctx
,
char
*
filename
,
wow_eFileSelType
file_type
);
};
#else
...
...
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