Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
DIOT WIC Gateware
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
DIOT WIC Gateware
Commits
1ee2ad23
Commit
1ee2ad23
authored
Sep 25, 2018
by
Projects
Committed by
Grzegorz Daniluk
Nov 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GUI demo: moved the main dialog to a separate class
parent
71f1f8f9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
18 deletions
+73
-18
demo.pro
sw/diot-sw/gui_demo/demo.pro
+2
-2
diot_dialog.cpp
sw/diot-sw/gui_demo/diot_dialog.cpp
+35
-0
diot_dialog.h
sw/diot-sw/gui_demo/diot_dialog.h
+34
-0
main.cpp
sw/diot-sw/gui_demo/main.cpp
+2
-16
No files found.
sw/diot-sw/gui_demo/demo.pro
View file @
1ee2ad23
...
...
@@ -18,9 +18,9 @@ DEFINES += QT_DEPRECATED_WARNINGS
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
# Input
HEADERS
+=
controller
.
h
diot_crate
.
h
HEADERS
+=
controller
.
h
diot_crate
.
h
diot_dialog
.
h
#FORMS += dialog.ui main_win.ui
SOURCES
+=
main
.
cpp
controller
.
cpp
diot_crate
.
cpp
SOURCES
+=
main
.
cpp
controller
.
cpp
diot_crate
.
cpp
diot_dialog
.
cpp
# enable C++11
CONFIG
+=
c
++
11
...
...
sw/diot-sw/gui_demo/diot_dialog.cpp
0 → 100644
View file @
1ee2ad23
/*
* Copyright (C) 2018 CERN
* Author: Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QBoxLayout>
#include "diot_dialog.h"
DIOT_Dialog
::
DIOT_Dialog
(
int
address
,
int
slots_nr
)
:
hw
(
address
,
slots_nr
)
{
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
();
DiotIOController
*
controller
=
new
DiotIOController
(
this
,
hw
,
slots_nr
);
mainLayout
->
addWidget
(
controller
);
DiotDiag
*
diag
=
new
DiotDiag
(
this
,
hw
);
mainLayout
->
addWidget
(
diag
);
setLayout
(
mainLayout
);
hw
.
Start
();
}
sw/diot-sw/gui_demo/diot_dialog.h
0 → 100644
View file @
1ee2ad23
/*
* Copyright (C) 2018 CERN
* Author: Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DIOT_DIALOG_H
#define DIOT_DIALOG_H
#include <QDialog>
#include "controller.h"
class
DIOT_Dialog
:
public
QDialog
{
public
:
DIOT_Dialog
(
int
address
,
int
slots_nr
);
protected
:
DiotHardware
hw
;
};
#endif
/* DIOT_DIALOG_H */
sw/diot-sw/gui_demo/main.cpp
View file @
1ee2ad23
...
...
@@ -18,9 +18,7 @@
#include <iostream>
#include <QtWidgets/QApplication>
#include <QtWidgets/QDialog>
#include <QBoxLayout>
#include "controller.h"
#include "diot_dialog.h"
// Argument values
constexpr
int
ADDRESS_DEFAULT
=
1
;
...
...
@@ -40,7 +38,6 @@ static void usage() {
int
main
(
int
argc
,
char
**
argv
)
{
QApplication
a
(
argc
,
argv
);
QDialog
w
;
// Process arguments
int
address
=
ADDRESS_DEFAULT
;
...
...
@@ -69,18 +66,7 @@ int main( int argc, char **argv ) {
return
0
;
}
DiotHardware
hw
(
address
,
slots_nr
);
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
();
DiotIOController
*
controller
=
new
DiotIOController
(
&
w
,
hw
,
slots_nr
);
mainLayout
->
addWidget
(
controller
);
DiotDiag
*
diag
=
new
DiotDiag
(
&
w
,
hw
);
mainLayout
->
addWidget
(
diag
);
w
.
setLayout
(
mainLayout
);
DIOT_Dialog
w
(
address
,
slots_nr
);
w
.
show
();
hw
.
Start
();
return
a
.
exec
();
}
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