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
497d030e
Commit
497d030e
authored
Dec 28, 2018
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QT: Cleaned up profinet_viewer.
parent
3e62c2bd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
51 deletions
+30
-51
profibus/exe/profinet_viewer/qt/pn_viewer_qt.cqt
profibus/exe/profinet_viewer/qt/pn_viewer_qt.cqt
+12
-7
profibus/exe/profinet_viewer/qt/pn_viewer_qt.h
profibus/exe/profinet_viewer/qt/pn_viewer_qt.h
+3
-3
profibus/exe/profinet_viewer/qt/pn_viewernav_qt.cpp
profibus/exe/profinet_viewer/qt/pn_viewernav_qt.cpp
+0
-1
profibus/exe/profinet_viewer/qt/profinet_viewer_qt.cpp
profibus/exe/profinet_viewer/qt/profinet_viewer_qt.cpp
+12
-37
profibus/lib/cow/qt/cow_pb_gsd_attr_qt.cqt
profibus/lib/cow/qt/cow_pb_gsd_attr_qt.cqt
+1
-1
profibus/lib/cow/qt/cow_pn_gsdml_attr_qt.cqt
profibus/lib/cow/qt/cow_pn_gsdml_attr_qt.cqt
+2
-2
No files found.
profibus/exe/profinet_viewer/qt/pn_viewer_qt.cqt
View file @
497d030e
...
...
@@ -51,16 +51,14 @@
void PnViewerQtWidget::closeEvent(QCloseEvent* event)
{
debug_print("PnViewerQtWidget::closeEvent\n");
viewer->activate_close();
QWidget::closeEvent(event);
}
PnViewerQt::PnViewerQt(void* v_parent_ctx, QWidget* v_parent_wid,
const char* v_name, const char* v_device, pwr_tStatus* status)
: PnViewer(v_parent_ctx, v_name, v_device, status)
PnViewerQt::PnViewerQt(const char* v_name, const char* v_device,
pwr_tStatus* status) : PnViewer(NULL, v_name, v_device, status)
{
toplevel = new PnViewerQtWidget(this
, v_parent_wid
);
toplevel = new PnViewerQtWidget(this);
toplevel->setMinimumSize(800, 600);
toplevel->setWindowTitle(fl(v_name));
toplevel->setAttribute(Qt::WA_DeleteOnClose);
...
...
@@ -90,7 +88,7 @@ PnViewerQt::PnViewerQt(void* v_parent_ctx, QWidget* v_parent_wid,
addMenuItem(toplevel, view, "Zoom &Out", SLOT(activate_zoom_out()), "CTRL+O",
"zoom-out");
addMenuItem(toplevel, view, "Zoom &Reset", SLOT(activate_zoom_reset()), "",
"zoom-
reset
");
"zoom-
original
");
// Help menu
QMenu* help = menu_bar->addMenu(translate_utf8("&Help"));
...
...
@@ -107,7 +105,7 @@ PnViewerQt::PnViewerQt(void* v_parent_ctx, QWidget* v_parent_wid,
value_recall = new CoWowRecall();
cmd_entry = new CoWowEntryQt(value_recall);
cmd_entry->setFixedHeight(25);
QObject::connect(cmd_entry, SIGNAL(
editing_finish
ed()), toplevel,
QObject::connect(cmd_entry, SIGNAL(
returnPress
ed()), toplevel,
SLOT(valchanged_cmd_entry()));
statusbar->addWidget(msg_label);
...
...
@@ -156,6 +154,13 @@ PnViewerQt::PnViewerQt(void* v_parent_ctx, QWidget* v_parent_wid,
wow = new CoWowQt(toplevel);
}
PnViewerQt::~PnViewerQt()
{
if (viewernav) {
delete viewernav;
}
}
void PnViewerQt::message(char severity, const char* msg)
{
msg_label->setText(QString::fromLatin1(msg));
...
...
profibus/exe/profinet_viewer/qt/pn_viewer_qt.h
View file @
497d030e
...
...
@@ -49,8 +49,8 @@ class PnViewerQtWidget;
class
PnViewerQt
:
public
PnViewer
{
public:
PnViewerQt
(
void
*
v_parent_ctx
,
QWidget
*
v_parent_wid
,
const
char
*
v_name
,
const
char
*
v_device
,
pwr_tStatus
*
status
);
PnViewerQt
(
const
char
*
v_name
,
const
char
*
v_device
,
pwr_tStatus
*
status
);
~
PnViewerQt
(
);
QWidget
*
nav_widget
;
QWidget
*
navconf_widget
;
...
...
@@ -71,7 +71,7 @@ class PnViewerQtWidget : public QWidget {
Q_OBJECT
public:
PnViewerQtWidget
(
PnViewerQt
*
parent_ctx
,
QWidget
*
parent
)
PnViewerQtWidget
(
PnViewerQt
*
parent_ctx
)
:
QWidget
(),
viewer
(
parent_ctx
){}
protected:
...
...
profibus/exe/profinet_viewer/qt/pn_viewernav_qt.cpp
View file @
497d030e
...
...
@@ -47,7 +47,6 @@ PnViewerNavQt::PnViewerNavQt(
void
*
l_parent_ctx
,
QWidget
*
l_parent_wid
,
viewer_eType
l_type
,
QWidget
**
w
)
:
PnViewerNav
(
l_parent_ctx
,
l_type
)
{
debug_print
(
"creating a scrolledbrowwidgetqt
\n
"
);
form_widget
=
scrolledbrowwidgetqt_new
(
PnViewerNav
::
init_brow_cb
,
this
,
&
brow_widget
);
...
...
profibus/exe/profinet_viewer/qt/profinet_viewer_qt.cpp
View file @
497d030e
...
...
@@ -49,54 +49,28 @@
#include <QApplication>
typedef
struct
{
QWidget
*
toplevel
;
PnViewer
*
viewer
;
}
tViewer
;
static
void
usage
()
{
printf
(
"
\n
Usage: profinet_viewer [-l language] [device]
\n
"
);
}
static
void
viewer_close
(
void
*
c
)
{
debug_print
(
"Shutting down...
\n
"
);
exit
(
0
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
i
;
int
sts
;
tViewer
*
ctx
;
char
dev_name
[
20
]
=
"eth1"
;
setDebug
(
1
);
QApplication
app
(
argc
,
argv
);
QApplication
::
setStyle
(
new
PwrStyle
());
ctx
=
(
tViewer
*
)
calloc
(
1
,
sizeof
(
tViewer
));
setlocale
(
LC_NUMERIC
,
"POSIX"
);
setlocale
(
LC_TIME
,
"en_US"
);
ctx
->
toplevel
=
new
QWidget
();
ctx
->
toplevel
->
setMinimumSize
(
100
,
100
);
ctx
->
toplevel
->
setWindowTitle
(
fl
(
"Profinet Viewer"
));
ctx
->
toplevel
->
setAttribute
(
Qt
::
WA_DeleteOnClose
);
// Create help window
CoXHelpQt
*
xhelp
=
new
CoXHelpQt
(
ctx
->
toplevel
,
0
,
xhelp_eUtility_Wtt
,
(
int
*
)
&
sts
);
CoXHelpQt
::
set_default
(
xhelp
);
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
streq
(
argv
[
i
],
"-h"
))
{
usage
(
);
debug_print
(
"Shutting down...
\n
"
);
exit
(
0
);
printf
(
"
\n
Usage: profinet_viewer [-l language] [device]
\n
"
);
exit
(
0
);
}
else
if
(
streq
(
argv
[
i
],
"-l"
))
{
if
(
i
+
1
>=
argc
)
{
usage
(
);
debug_print
(
"Shutting down...
\n
"
);
exit
(
0
);
printf
(
"
\n
Usage: profinet_viewer [-l language] [device]
\n
"
);
exit
(
0
);
}
Lng
::
set
(
argv
[
i
+
1
]);
i
++
;
...
...
@@ -106,19 +80,20 @@ int main(int argc, char* argv[])
}
// Open window
PnViewerQt
*
viewer
;
try
{
ctx
->
viewer
=
new
PnViewerQt
(
ctx
,
ctx
->
toplevel
,
"Profinet Viewer"
,
dev_name
,
&
sts
);
ctx
->
viewer
->
close_cb
=
viewer_close
;
viewer
=
new
PnViewerQt
(
"Profinet Viewer"
,
dev_name
,
&
sts
);
}
catch
(
co_error
&
e
)
{
printf
(
"** Exception: %s
\n
"
,
e
.
what
().
c_str
());
debug_print
(
"Shutting down...
\n
"
);
exit
(
0
);
}
ctx
->
toplevel
->
show
();
// Create help window
CoXHelpQt
*
xhelp
=
new
CoXHelpQt
(
viewer
->
toplevel
,
0
,
xhelp_eUtility_Wtt
,
(
int
*
)
&
sts
);
CoXHelpQt
::
set_default
(
xhelp
);
try
{
ctx
->
viewer
->
update_devices
();
viewer
->
update_devices
();
}
catch
(
co_error
&
e
)
{
printf
(
"** Exception: %s
\n
"
,
e
.
what
().
c_str
());
}
...
...
profibus/lib/cow/qt/cow_pb_gsd_attr_qt.cqt
View file @
497d030e
...
...
@@ -255,7 +255,7 @@ GsdAttrQt::GsdAttrQt(QWidget* a_parent_wid, void* a_parent_ctx, void* a_object,
addMenuItem(toplevel, view, "Zoom &Out", SLOT(activate_zoom_out()), "CTRL+O",
"zoom-out");
addMenuItem(toplevel, view, "Zoom &Reset", SLOT(activate_zoom_reset()), "",
"zoom-
reset
");
"zoom-
original
");
// Help entry
QMenu* help = menu_bar->addMenu(translate_utf8("&Help"));
...
...
profibus/lib/cow/qt/cow_pn_gsdml_attr_qt.cqt
View file @
497d030e
...
...
@@ -310,7 +310,7 @@ GsdmlAttrQt::GsdmlAttrQt(QWidget* a_parent_wid, void* a_parent_ctx,
addMenuItem(toplevel, view, "Zoom &Out", SLOT(activate_zoom_out()), "CTRL+O",
"zoom-out");
addMenuItem(toplevel, view, "Zoom &Reset", SLOT(activate_zoom_reset()), "",
"zoom-
reset
");
"zoom-
original
");
// Help entry
QMenu* help = menu_bar->addMenu(translate_utf8("&Help"));
...
...
@@ -335,7 +335,7 @@ GsdmlAttrQt::GsdmlAttrQt(QWidget* a_parent_wid, void* a_parent_ctx,
cmd_entry = new CoWowEntryQt(&value_recall);
cmd_entry->setFixedHeight(25);
QObject::connect(cmd_entry, SIGNAL(
editing_finish
ed()), toplevel,
QObject::connect(cmd_entry, SIGNAL(
returnPress
ed()), toplevel,
SLOT(valchanged_cmd_entry()));
statusbar->addWidget(msg_label);
...
...
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