Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
Takin
mag-core
Commits
50b23590
Verified
Commit
50b23590
authored
Jun 17, 2022
by
Tobias WEBER
Browse files
bz: added qx and qy variables
parent
1a44bc90
Changes
2
Hide whitespace changes
Inline
Side-by-side
tools/bz/bz.cpp
View file @
50b23590
...
...
@@ -268,7 +268,7 @@ BZDlg::BZDlg(QWidget* pParent) : QDialog{pParent},
m_formulas
->
verticalHeader
()
->
setVisible
(
false
);
m_formulas
->
setAlternatingRowColors
(
true
);
m_formulas
->
setColumnCount
(
NUM_FORMULAS_COLS
);
m_formulas
->
setHorizontalHeaderItem
(
COL_FORMULA
,
new
QTableWidgetItem
{
"Formula to Plot"
});
m_formulas
->
setHorizontalHeaderItem
(
COL_FORMULA
,
new
QTableWidgetItem
{
"Formula to Plot
(Variables are Qx and Qy)
"
});
m_formulas
->
setColumnWidth
(
COL_FORMULA
,
500
);
QToolButton
*
btnAdd
=
new
QToolButton
(
formulaspanel
);
...
...
tools/bz/bz_calc.cpp
View file @
50b23590
...
...
@@ -428,6 +428,8 @@ void BZDlg::CalcFormulas()
if
(
m_max_x
<
m_min_x
)
return
;
t_real
plane_d
=
m_cutD
->
value
()
*
m_cut_norm_scale
;
std
::
vector
<
std
::
string
>
formulas
=
GetFormulas
();
for
(
const
std
::
string
&
formula
:
formulas
)
{
...
...
@@ -448,7 +450,11 @@ void BZDlg::CalcFormulas()
for
(
t_real
x
=
m_min_x
;
x
<=
m_max_x
;
x
+=
x_delta
)
{
t_vec
QinvA
=
m_cut_plane
*
tl2
::
create
<
t_vec
>
({
x
,
0.
,
plane_d
});
parser
.
register_var
(
"x"
,
x
);
parser
.
register_var
(
"Qx"
,
QinvA
[
0
]);
parser
.
register_var
(
"Qy"
,
QinvA
[
1
]);
t_real
y
=
parser
.
eval
();
if
(
y
<
m_min_y
||
y
>
m_max_y
)
continue
;
...
...
@@ -471,9 +477,9 @@ void BZDlg::CalcFormulas()
*/
void
BZDlg
::
BZCutMouseMoved
(
t_real
x
,
t_real
y
)
{
t_real
d
=
m_cutD
->
value
()
*
m_cut_norm_scale
;
t_real
plane_
d
=
m_cutD
->
value
()
*
m_cut_norm_scale
;
t_vec
QinvA
=
m_cut_plane
*
tl2
::
create
<
t_vec
>
({
x
,
y
,
d
});
t_vec
QinvA
=
m_cut_plane
*
tl2
::
create
<
t_vec
>
({
x
,
y
,
plane_
d
});
t_mat
B_inv
=
m_crystA
/
(
t_real
(
2
)
*
tl2
::
pi
<
t_real
>
);
t_vec
Qrlu
=
B_inv
*
QinvA
;
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment