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
ffe2fc6c
Commit
ffe2fc6c
authored
Nov 08, 2018
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified xtt_hist time_cb
parent
18a40722
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
148 deletions
+33
-148
xtt/lib/xtt/gtk/xtt_hist_gtk.cpp
xtt/lib/xtt/gtk/xtt_hist_gtk.cpp
+9
-9
xtt/lib/xtt/qt/xtt_hist_qt.cqt
xtt/lib/xtt/qt/xtt_hist_qt.cqt
+16
-51
xtt/lib/xtt/qt/xtt_hist_qt.h
xtt/lib/xtt/qt/xtt_hist_qt.h
+1
-8
xtt/lib/xtt/src/xtt_hist.cpp
xtt/lib/xtt/src/xtt_hist.cpp
+6
-72
xtt/lib/xtt/src/xtt_hist.h
xtt/lib/xtt/src/xtt_hist.h
+1
-8
No files found.
xtt/lib/xtt/gtk/xtt_hist_gtk.cpp
View file @
ffe2fc6c
...
...
@@ -600,7 +600,7 @@ HistGtk::HistGtk(void* hist_parent_ctx, GtkWidget* hist_parent_wid,
// Init start and stop time
((
Hist
*
)
this
)
->
all_cb
(
);
((
Hist
*
)
this
)
->
time_cb
(
time_ePeriod_AllTime
);
wow
=
new
CoWowGtk
(
parent_wid_hist
);
...
...
@@ -829,56 +829,56 @@ void HistGtk::today_cb(GtkWidget* w, gpointer data)
{
Hist
*
histOP
=
(
Hist
*
)
data
;
histOP
->
t
oday_cb
(
);
histOP
->
t
ime_cb
(
time_ePeriod_Today
);
}
void
HistGtk
::
yesterday_cb
(
GtkWidget
*
w
,
gpointer
data
)
{
Hist
*
histOP
=
(
Hist
*
)
data
;
histOP
->
yesterday_cb
(
);
histOP
->
time_cb
(
time_ePeriod_Yesterday
);
}
void
HistGtk
::
thisw_cb
(
GtkWidget
*
w
,
gpointer
data
)
{
Hist
*
histOP
=
(
Hist
*
)
data
;
histOP
->
t
hisw_cb
(
);
histOP
->
t
ime_cb
(
time_ePeriod_ThisWeek
);
}
void
HistGtk
::
lastw_cb
(
GtkWidget
*
w
,
gpointer
data
)
{
Hist
*
histOP
=
(
Hist
*
)
data
;
histOP
->
lastw_cb
(
);
histOP
->
time_cb
(
time_ePeriod_LastWeek
);
}
void
HistGtk
::
thism_cb
(
GtkWidget
*
w
,
gpointer
data
)
{
Hist
*
histOP
=
(
Hist
*
)
data
;
histOP
->
t
hism_cb
(
);
histOP
->
t
ime_cb
(
time_ePeriod_ThisMonth
);
}
void
HistGtk
::
lastm_cb
(
GtkWidget
*
w
,
gpointer
data
)
{
Hist
*
histOP
=
(
Hist
*
)
data
;
histOP
->
lastm_cb
(
);
histOP
->
time_cb
(
time_ePeriod_LastMonth
);
}
void
HistGtk
::
all_cb
(
GtkWidget
*
w
,
gpointer
data
)
{
Hist
*
histOP
=
(
Hist
*
)
data
;
histOP
->
all_cb
(
);
histOP
->
time_cb
(
time_ePeriod_AllTime
);
}
void
HistGtk
::
time_cb
(
GtkWidget
*
w
,
gpointer
data
)
{
Hist
*
histOP
=
(
Hist
*
)
data
;
histOP
->
time_cb
();
histOP
->
time_cb
(
time_ePeriod_UserDefined
);
}
void
HistGtk
::
set_num_of_events
(
int
nrOfEvents
)
...
...
xtt/lib/xtt/qt/xtt_hist_qt.cqt
View file @
ffe2fc6c
...
...
@@ -139,22 +139,21 @@ HistQt::HistQt(void* hist_parent_ctx, QWidget* hist_parent_wid, char* hist_name,
stop_time_entry_w->setFixedWidth(160);
// Time option menu
QToolBar* sea_time_menu = new QToolBar();
addToolItem(toplevel, sea_time_menu, "All ", SLOT(all_cb()), "");
addToolItem(toplevel, sea_time_menu, "Today", SLOT(today_cb()), "");
addToolItem(toplevel, sea_time_menu, "Yesterday", SLOT(yesterday_cb()), "");
addToolItem(toplevel, sea_time_menu, "This Week", SLOT(thisw_cb()), "");
addToolItem(toplevel, sea_time_menu, "Last Week", SLOT(lastw_cb()), "");
addToolItem(toplevel, sea_time_menu, "This Month", SLOT(thism_cb()), "");
addToolItem(toplevel, sea_time_menu, "Last Month", SLOT(lastm_cb()), "");
addToolItem(toplevel, sea_time_menu, "Time", SLOT(time_cb()), "");
QHBoxLayout* sea_timebox = new QHBoxLayout();
QToolBar* sea_timebox = new QToolBar();
sea_timebox->addWidget(sea_time_start_label);
sea_timebox->addWidget(start_time_entry_w);
sea_timebox->addWidget(sea_time_stop_label);
sea_timebox->addWidget(stop_time_entry_w);
sea_timebox->addWidget(sea_time_menu);
QComboBox* sea_time_menu = addToolMenu(toplevel, sea_timebox, SLOT(time_cb(int)));
sea_time_menu->addItem("All", time_ePeriod_AllTime);
sea_time_menu->addItem("Today", time_ePeriod_Today);
sea_time_menu->addItem("Yesterday", time_ePeriod_Yesterday);
sea_time_menu->addItem("This Week", time_ePeriod_ThisWeek);
sea_time_menu->addItem("Last Week", time_ePeriod_LastWeek);
sea_time_menu->addItem("This Month", time_ePeriod_ThisMonth);
sea_time_menu->addItem("Last Month", time_ePeriod_LastMonth);
sea_time_menu->addItem("Time", time_ePeriod_UserDefined);
// Event type box
QLabel* sea_type_label = new QLabel(translate_utf8("Event type"));
...
...
@@ -267,7 +266,7 @@ HistQt::HistQt(void* hist_parent_ctx, QWidget* hist_parent_wid, char* hist_name,
sea_stringframe->setLayout(sea_stringbox);
QVBoxLayout* search_vbox_layout = new QVBoxLayout();
search_vbox_layout->add
Layou
t(sea_timebox);
search_vbox_layout->add
Widge
t(sea_timebox);
search_vbox_layout->addLayout(sea_typebox);
search_vbox_layout->addLayout(sea_priobox);
search_vbox_layout->addLayout(sea_eventnamebox);
...
...
@@ -333,7 +332,7 @@ HistQt::HistQt(void* hist_parent_ctx, QWidget* hist_parent_wid, char* hist_name,
toplevel->setLayout(hist_vbox);
toplevel->show();
all_cb(
);
Hist::time_cb(time_ePeriod_AllTime
);
wow = new CoWowQt(toplevel);
...
...
@@ -450,44 +449,10 @@ void HistQtWidget::cancel_cb()
// printf("hist_cancel_cb\n");
}
void HistQtWidget::today_cb()
{
hist->today_cb();
}
void HistQtWidget::yesterday_cb()
{
hist->yesterday_cb();
}
void HistQtWidget::thisw_cb()
{
hist->thisw_cb();
}
void HistQtWidget::lastw_cb()
{
hist->lastw_cb();
}
void HistQtWidget::thism_cb()
{
hist->thism_cb();
}
void HistQtWidget::lastm_cb()
{
hist->lastm_cb();
}
void HistQtWidget::all_cb()
{
hist->all_cb();
}
void HistQtWidget::time_cb()
void HistQtWidget::time_cb(int idx)
{
hist->time_cb();
time_ePeriod data = static_cast<time_ePeriod>(((QComboBox*)sender())->itemData(idx).toInt());
hist->time_cb(data);
}
void HistQt::set_num_of_events(int nrOfEvents)
...
...
xtt/lib/xtt/qt/xtt_hist_qt.h
View file @
ffe2fc6c
...
...
@@ -123,14 +123,7 @@ public slots:
void
ok_btn
();
// callbackfunctions from the searchdialog
void
cancel_cb
();
void
today_cb
();
void
yesterday_cb
();
void
thisw_cb
();
void
lastw_cb
();
void
thism_cb
();
void
lastm_cb
();
void
all_cb
();
void
time_cb
();
void
time_cb
(
int
);
private:
HistQt
*
hist
;
...
...
xtt/lib/xtt/src/xtt_hist.cpp
View file @
ffe2fc6c
...
...
@@ -168,84 +168,18 @@ void Hist::activate_helpevent()
}
}
void
Hist
::
t
oday_cb
(
)
void
Hist
::
t
ime_cb
(
time_ePeriod
period
)
{
pwr_tTime
StartTime
;
pwr_tTime
StopTime
;
time_Period
(
time_ePeriod_Today
,
&
StartTime
,
&
StopTime
,
0
,
1
);
int
daybreak
=
0
;
if
(
period
==
time_ePeriod_Today
||
period
==
time_ePeriod_ThisWeek
||
period
==
time_ePeriod_ThisMonth
||
period
==
time_ePeriod_AllTime
)
daybreak
=
1
;
SetListTime
(
StartTime
,
StopTime
,
INSENS
);
}
void
Hist
::
yesterday_cb
()
{
pwr_tTime
StartTime
;
pwr_tTime
StopTime
;
time_Period
(
time_ePeriod_Yesterday
,
&
StartTime
,
&
StopTime
,
0
,
0
);
SetListTime
(
StartTime
,
StopTime
,
INSENS
);
}
void
Hist
::
thisw_cb
()
{
pwr_tTime
StartTime
;
pwr_tTime
StopTime
;
time_Period
(
time_ePeriod_ThisWeek
,
&
StartTime
,
&
StopTime
,
0
,
1
);
SetListTime
(
StartTime
,
StopTime
,
INSENS
);
}
void
Hist
::
lastw_cb
()
{
pwr_tTime
StartTime
;
pwr_tTime
StopTime
;
time_Period
(
time_ePeriod_LastWeek
,
&
StartTime
,
&
StopTime
,
0
,
0
);
SetListTime
(
StartTime
,
StopTime
,
INSENS
);
}
void
Hist
::
thism_cb
()
{
pwr_tTime
StartTime
;
pwr_tTime
StopTime
;
time_Period
(
time_ePeriod_ThisMonth
,
&
StartTime
,
&
StopTime
,
0
,
1
);
SetListTime
(
StartTime
,
StopTime
,
INSENS
);
}
void
Hist
::
lastm_cb
()
{
pwr_tTime
StartTime
;
pwr_tTime
StopTime
;
time_Period
(
time_ePeriod_LastMonth
,
&
StartTime
,
&
StopTime
,
0
,
0
);
SetListTime
(
StartTime
,
StopTime
,
INSENS
);
}
void
Hist
::
all_cb
()
{
pwr_tTime
StartTime
;
pwr_tTime
StopTime
;
time_Period
(
time_ePeriod_AllTime
,
&
StartTime
,
&
StopTime
,
0
,
1
);
SetListTime
(
StartTime
,
StopTime
,
INSENS
);
}
void
Hist
::
time_cb
()
{
pwr_tTime
StartTime
;
pwr_tTime
StopTime
;
time_Period
(
time_ePeriod_AllTime
,
&
StartTime
,
&
StopTime
,
0
,
0
);
time_Period
(
period
==
time_ePeriod_UserDefined
?
time_ePeriod_AllTime
:
period
,
&
StartTime
,
&
StopTime
,
0
,
daybreak
);
SetListTime
(
StartTime
,
StopTime
,
SENS
);
SetListTime
(
StartTime
,
StopTime
,
period
==
time_ePeriod_UserDefined
?
SENS
:
IN
SENS
);
}
pwr_tStatus
Hist
::
hist_add_ack_mess
(
mh_sAck
*
MsgP
)
...
...
xtt/lib/xtt/src/xtt_hist.h
View file @
ffe2fc6c
...
...
@@ -135,14 +135,7 @@ public:
void
activate_print
();
void
activate_help
();
void
activate_helpevent
();
void
today_cb
();
void
yesterday_cb
();
void
lastw_cb
();
void
thism_cb
();
void
lastm_cb
();
void
thisw_cb
();
void
all_cb
();
void
time_cb
();
void
time_cb
(
time_ePeriod
period
);
void
stat
();
static
int
GoBackMonth
(
...
...
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