Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gof
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs
gui
gof
Commits
dc145f24
Commit
dc145f24
authored
1 month ago
by
Giacomo Strangolino
Browse files
Options
Downloads
Patches
Plain Diff
format for CorrMaxPercent taken from tango db 'format'
parent
1ca1334f
No related branches found
No related tags found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/circularplotman.cpp
+6
-10
6 additions, 10 deletions
src/circularplotman.cpp
src/main.cpp
+10
-0
10 additions, 0 deletions
src/main.cpp
src/numberdrawable.cpp
+6
-2
6 additions, 2 deletions
src/numberdrawable.cpp
src/numberdrawable.h
+1
-1
1 addition, 1 deletion
src/numberdrawable.h
with
23 additions
and
13 deletions
src/circularplotman.cpp
+
6
−
10
View file @
dc145f24
...
...
@@ -27,9 +27,6 @@ bool PlotObjFilter::eventFilter(QObject *obj, QEvent *event)
sli
->
setOrientation
(
Qt
::
Horizontal
);
sli
->
setMinimumSize
(
QSize
(
250
,
40
));
sliw
->
setDefaultWidget
(
sli
);
// slider value[1-300]. span = pow(10, value/100) --> span 0-1000
// slider with span 20 [-10; 10] --> setValue log10(20) * 100 = 130
sli
->
setMinimum
(
1
);
sli
->
setMaximum
(
300
);
sli
->
setValue
(
obj
->
property
(
"yScale"
).
isNull
()
?
130
:
obj
->
property
(
"yScale"
).
toInt
());
// -10 - 10
...
...
@@ -73,7 +70,6 @@ void CircularPlotMan::setup() {
o
[
TTT
::
Period
]
=
50
;
watchers
[
i
]
->
getContext
()
->
setOptions
(
o
);
connect
(
watchers
[
i
],
SIGNAL
(
newData
(
CuData
)),
this
,
SLOT
(
update
(
CuData
)));
watchers
[
i
+
2
]
=
new
QuWatcher
(
parent
());
watchers
[
i
+
2
]
->
getContext
()
->
setOptions
(
o
);
number_drawables
[
i
]
=
new
NumberDrawable
(
circular_plots
[
i
]);
...
...
@@ -146,14 +142,14 @@ void CircularPlotMan::update(const CuData &da) {
NumberDrawable
*
dra
=
number_drawables
[
dra_i
];
if
(
dra
)
{
QuCircularPlotCurve
*
c
=
idx
==
0
?
plot
->
engine
()
->
findCurve
(
"hordata"
)
:
plot
->
engine
()
->
findCurve
(
"verdata"
);
const
in
t
&
idx
=
c
->
selected
(),
&
siz
=
m_corrnames
.
size
();
const
size_
t
&
idx
=
c
->
selected
(),
&
siz
=
m_corrnames
.
size
();
bool
right
=
idx
>
siz
/
4
&&
idx
<
siz
*
3
/
4
;
// text drawn on the right side
if
(
c
&&
idx
<
y
.
size
()
&&
idx
<
(
int
)
m_corrnames
.
size
())
{
char
v
[
32
];
if
(
c
&&
idx
<
v
.
size
()
&&
idx
<
m_corrnames
.
size
())
{
char
v
s
[
32
];
const
char
*
corr
=
m_corrnames
[
idx
].
c_str
();
if
(
right
)
snprintf
(
v
,
32
,
"%.1f ← %s"
,
y
[
idx
],
corr
);
else
snprintf
(
v
,
32
,
"%s → %.1f"
,
corr
,
y
[
idx
]);
dra
->
setText
(
v
);
if
(
right
)
snprintf
(
v
s
,
32
,
"%.1f ← %s"
,
v
[
idx
],
corr
);
else
snprintf
(
v
s
,
32
,
"%s → %.1f"
,
corr
,
v
[
idx
]);
dra
->
setText
(
v
s
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main.cpp
+
10
−
0
View file @
dc145f24
...
...
@@ -30,6 +30,14 @@
#define VERSION "2.0.0"
int
main
(
int
argc
,
char
**
argv
)
{
if
(
QT_VERSION
<
QT_VERSION_CHECK
(
6
,
0
,
0
))
{
printf
(
"setenv: QT_QPA_PLATFORMTHEME=qt5ct
\n
"
);
setenv
(
"QT_QPA_PLATFORMTHEME"
,
"qt5ct"
,
0
);
}
else
{
printf
(
"setenv: QT_QPA_PLATFORMTHEME=qt6ct
\n
"
);
setenv
(
"QT_QPA_PLATFORMTHEME"
,
"qt6ct"
,
0
);
}
CumbiaPool
*
p
=
new
CumbiaPool
();
CuControlsFactoryPool
fpool
;
QuApplication
a
(
argc
,
argv
,
p
,
&
fpool
);
...
...
@@ -42,6 +50,8 @@ int main( int argc, char ** argv ) {
}
Gof
*
mw
=
new
Gof
(
0
,
argv
[
1
],
argv
[
2
]);
if
(
argc
>
1
&&
strcmp
(
argv
[
1
]
,
"sr/feedback/gof2_profile"
)
==
0
)
mw
->
setWindowTitle
(
"GOF (experimental)"
);
mw
->
show
();
...
...
This diff is collapsed.
Click to expand it.
src/numberdrawable.cpp
+
6
−
2
View file @
dc145f24
...
...
@@ -5,7 +5,7 @@
#include
<qupalette.h>
NumberDrawable
::
NumberDrawable
(
QObject
*
parent
)
:
QObject
(
parent
),
m_s
(
"#"
)
{}
:
QObject
(
parent
),
m_s
(
"#"
)
,
m_fmt
(
"%.1f"
)
{}
void
NumberDrawable
::
setText
(
const
std
::
string
&
t
)
{
m_s
=
t
;
...
...
@@ -26,7 +26,11 @@ std::string NumberDrawable::text() const {
void
NumberDrawable
::
update
(
const
CuData
&
da
)
{
const
std
::
string
&
src
=
da
.
s
(
TTT
::
Src
);
if
(
!
da
.
B
(
TTT
::
Err
))
{
m_s
=
da
.
s
(
TTT
::
Value
);
if
(
da
.
s
(
TTT
::
Type
)
==
"property"
)
{
m_fmt
=
da
.
s
(
TTT
::
NumberFormat
);
}
bool
ok
;
m_s
=
da
[
TTT
::
Value
].
toString
(
&
ok
,
m_fmt
.
c_str
());
}
else
{
m_s
=
"##"
;
}
...
...
This diff is collapsed.
Click to expand it.
src/numberdrawable.h
+
1
−
1
View file @
dc145f24
...
...
@@ -25,7 +25,7 @@ public:
int
z
()
const
;
void
draw
(
QPainter
*
p
,
const
QuCircularPlotEngine
*
plot_e
,
double
inner_radius
,
double
outer_radius
,
const
QRectF
&
rect
,
QWidget
*
widget
);
std
::
string
m_s
;
std
::
string
m_s
,
m_fmt
;
double
m_w
,
m_h
;
QPointF
m_pos
;
QFont
m_font
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment