Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Gertulla, Janis Luca
UE49Interlock
Commits
95f53c54
Commit
95f53c54
authored
Oct 09, 2020
by
Gertulla, Janis Luca
Browse files
Hotfix 3
parent
bbed0e57
Changes
8
Hide whitespace changes
Inline
Side-by-side
UE49Interlock.pro.user
View file @
95f53c54
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.13.1, 2020-10-09T1
3:24:40
. -->
<!-- Written by QtCreator 4.13.1, 2020-10-09T1
5:08:38
. -->
<qtcreator>
<data>
<variable>
EnvironmentId
</variable>
...
...
client.cpp
View file @
95f53c54
...
...
@@ -124,7 +124,7 @@ void Client::handleData()
if
(
data
.
length
()
<
msgLen
+
2
)
{
emit
log
(
"partial data: "
+
QString
::
number
(
data
.
length
())
+
"
uint8_t
s"
);
emit
log
(
"partial data: "
+
QString
::
number
(
data
.
length
())
+
"
byte
s"
);
return
;
}
else
...
...
ino/ControllerMduino57Plus/ControllerMduino57Plus.ino
View file @
95f53c54
...
...
@@ -41,8 +41,8 @@ uint8_t R0_1 = 6;
uint8_t
R0_2
=
7
;
uint8_t
R0_3
=
8
;
uint8_t
R0_4
=
9
;
uint8_t
R0_5
=
1
0
;
uint8_t
R0_6
=
1
1
;
uint8_t
R0_5
=
1
2
;
uint8_t
R0_6
=
1
3
;
#endif
...
...
@@ -253,14 +253,14 @@ void write_bools(byte **buf, bool b1, bool b2, bool b3, bool b4, bool b5, bool b
void
read_bools
(
byte
**
buf
,
bool
*
b1
,
bool
*
b2
,
bool
*
b3
,
bool
*
b4
,
bool
*
b5
,
bool
*
b6
,
bool
*
b7
,
bool
*
b8
)
{
if
(
b1
)
*
b1
=
(
**
buf
&
1
<<
7
)
?
true
:
false
;
if
(
b2
)
*
b2
=
(
**
buf
&
1
<<
6
)
?
true
:
false
;
if
(
b3
)
*
b3
=
(
**
buf
&
1
<<
5
)
?
true
:
false
;
if
(
b4
)
*
b4
=
(
**
buf
&
1
<<
4
)
?
true
:
false
;
if
(
b5
)
*
b5
=
(
**
buf
&
1
<<
3
)
?
true
:
false
;
if
(
b6
)
*
b6
=
(
**
buf
&
1
<<
2
)
?
true
:
false
;
if
(
b7
)
*
b7
=
(
**
buf
&
1
<<
1
)
?
true
:
false
;
if
(
b8
)
*
b8
=
(
**
buf
&
1
<<
0
)
?
true
:
false
;
if
(
b1
)
*
b1
=
(
**
buf
&
(
1
<<
7
)
)
?
true
:
false
;
if
(
b2
)
*
b2
=
(
**
buf
&
(
1
<<
6
)
)
?
true
:
false
;
if
(
b3
)
*
b3
=
(
**
buf
&
(
1
<<
5
)
)
?
true
:
false
;
if
(
b4
)
*
b4
=
(
**
buf
&
(
1
<<
4
)
)
?
true
:
false
;
if
(
b5
)
*
b5
=
(
**
buf
&
(
1
<<
3
)
)
?
true
:
false
;
if
(
b6
)
*
b6
=
(
**
buf
&
(
1
<<
2
)
)
?
true
:
false
;
if
(
b7
)
*
b7
=
(
**
buf
&
(
1
<<
1
)
)
?
true
:
false
;
if
(
b8
)
*
b8
=
(
**
buf
&
(
1
<<
0
)
)
?
true
:
false
;
(
*
buf
)
++
;
}
...
...
@@ -290,10 +290,12 @@ void measure_turbopumps()
void
handle_message
(
client_t
&
client
)
{
byte
msg_type
;
byte
msg_len
;
byte
*
local
=
client
.
data
;
byte
**
p
=
&
local
;
read_byte
(
p
,
&
msg_type
);
read_byte
(
p
,
&
msg_type
);
read_byte
(
p
,
&
msg_len
);
if
(
msg_type
==
0
)
// ping
{
...
...
@@ -323,42 +325,42 @@ void handle_message(client_t &client)
// change rules
if
(
req_state
.
sysOverride
!=
new
_state
.
sysOverride
)
if
(
req_state
.
sysOverride
!=
current
_state
.
sysOverride
)
{
new_state
.
sysOverride
=
req_state
.
sysOverride
;
}
else
if
(
req_state
.
linked
!=
new
_state
.
linked
)
else
if
(
req_state
.
linked
!=
current
_state
.
linked
)
{
new_state
.
linked
=
req_state
.
linked
;
}
else
if
(
req_state
.
pGratActive
!=
new
_state
.
pGratActive
)
else
if
(
req_state
.
pGratActive
!=
current
_state
.
pGratActive
)
{
new_state
.
pGratActive
=
req_state
.
pGratActive
;
}
else
if
(
req_state
.
pMcpActive
!=
new
_state
.
pMcpActive
)
else
if
(
req_state
.
pMcpActive
!=
current
_state
.
pMcpActive
)
{
new_state
.
pMcpActive
=
req_state
.
pMcpActive
;
}
else
if
(
req_state
.
pVvActive
!=
new
_state
.
pVvActive
)
else
if
(
req_state
.
pVvActive
!=
current
_state
.
pVvActive
)
{
new_state
.
pVvActive
=
req_state
.
pVvActive
;
}
else
if
(
req_state
.
tDetActive
!=
new
_state
.
tDetActive
)
else
if
(
req_state
.
tDetActive
!=
current
_state
.
tDetActive
)
{
new_state
.
tDetActive
=
req_state
.
tDetActive
;
}
else
if
(
req_state
.
tDpsActive
!=
new
_state
.
tDpsActive
)
else
if
(
req_state
.
tDpsActive
!=
current
_state
.
tDpsActive
)
{
new_state
.
tDpsActive
=
req_state
.
tDpsActive
;
}
else
if
(
req_state
.
vTdetOpen
!=
new
_state
.
vTdetOpen
)
else
if
(
req_state
.
vTdetOpen
!=
current
_state
.
vTdetOpen
)
{
if
(
req_state
.
vTdetOpen
==
false
)
{
...
...
@@ -366,7 +368,7 @@ void handle_message(client_t &client)
}
else
{
if
(
new
_state
.
sysOverride
||
!
(
new
_state
.
tDetActive
&&
(
tp_states
[
TP_DET
]
<
t_det_cutoff
)))
if
(
current
_state
.
sysOverride
||
!
(
current
_state
.
tDetActive
&&
(
tp_states
[
TP_DET
]
<
t_det_cutoff
)))
{
new_state
.
vTdetOpen
=
true
;
}
...
...
@@ -388,13 +390,13 @@ void handle_message(client_t &client)
}
else
{
if
(
new
_state
.
sysOverride
||
!
((
new
_state
.
tDetActive
&&
(
tp_states
[
TP_DET
]
<
t_det_cutoff
)
||
(
new
_state
.
pGratActive
&&
(
gauge_pressures
[
GRAT
]
>
p_grat_cutoff
))
||
(
new
_state
.
pMcpActive
&&
(
gauge_pressures
[
MCP
]
>
p_mcp_cutoff
)))))
if
(
current
_state
.
sysOverride
||
!
((
current
_state
.
tDetActive
&&
(
tp_states
[
TP_DET
]
<
t_det_cutoff
)
||
(
current
_state
.
pGratActive
&&
(
gauge_pressures
[
GRAT
]
>
p_grat_cutoff
))
||
(
current
_state
.
pMcpActive
&&
(
gauge_pressures
[
MCP
]
>
p_mcp_cutoff
)))))
{
new_state
.
vDetOpen
=
true
;
if
(
new
_state
.
linked
)
{
if
(
current
_state
.
linked
)
{
new_state
.
vFoilOpen
=
false
;
}
}
...
...
@@ -410,16 +412,16 @@ void handle_message(client_t &client)
if
(
req_state
.
vFoilOpen
==
true
)
{
new_state
.
vFoilOpen
=
true
;
if
(
new
_state
.
linked
){
if
(
current
_state
.
linked
){
new_state
.
vDetOpen
=
false
;
}
}
else
{
if
(
new
_state
.
sysOverride
||
!
(
new
_state
.
pGratActive
&&
(
gauge_pressures
[
GRAT
]
>
p_grat_cutoff
)))
if
(
current
_state
.
sysOverride
||
!
(
current
_state
.
pGratActive
&&
(
gauge_pressures
[
GRAT
]
>
p_grat_cutoff
)))
{
new_state
.
vFoilOpen
=
false
;
if
(
new
_state
.
linked
){
if
(
current
_state
.
linked
){
new_state
.
vDetOpen
=
true
;
}
}
...
...
@@ -438,7 +440,7 @@ void handle_message(client_t &client)
}
else
{
if
(
new
_state
.
sysOverride
||
!
(
new
_state
.
pGratActive
&&
(
gauge_pressures
[
GRAT
]
>
p_grat_cutoff
)))
if
(
current
_state
.
sysOverride
||
!
(
current
_state
.
pGratActive
&&
(
gauge_pressures
[
GRAT
]
>
p_grat_cutoff
)))
{
new_state
.
vDpsOpen
=
true
;
}
...
...
@@ -458,7 +460,7 @@ void handle_message(client_t &client)
}
else
{
if
(
new
_state
.
sysOverride
||
!
(
new
_state
.
pGratActive
&&
(
gauge_pressures
[
GRAT
]
>
p_grat_cutoff
)))
if
(
current
_state
.
sysOverride
||
!
(
current
_state
.
pGratActive
&&
(
gauge_pressures
[
GRAT
]
>
p_grat_cutoff
)))
{
new_state
.
pumpEnabled
=
true
;
}
...
...
@@ -529,12 +531,12 @@ void write_state(byte *msg)
write_bools
(
p
,
current_state
.
sysOverride
,
current_state
.
linked
,
current_state
.
pGratActive
,
current_state
.
pMcpActive
,
current_state
.
pVvActive
,
current_state
.
tDetActive
,
current_state
.
tDpsActive
,
0
);
false
);
write_bools
(
p
,
current_state
.
vTdetOpen
,
current_state
.
vDetOpen
,
current_state
.
vFoilOpen
,
current_state
.
vDpsOpen
,
current_state
.
hvmcpHigh
,
current_state
.
rbeamlineHigh
,
current_state
.
pumpEnabled
,
0
);
false
);
}
void
send_state
(
EthernetClient
&
client
)
...
...
@@ -657,11 +659,11 @@ bool update_state()
if
(
current_state
.
hvmcpHigh
==
false
)
{
updated
=
true
;
}
current_state
.
hvmcpHigh
=
true
;
current_state
.
hvmcpHigh
=
true
;
}
else
{
if
(
current_state
.
hvmcpHigh
==
true
)
updated
=
fals
e
;
if
(
current_state
.
hvmcpHigh
==
true
)
updated
=
tru
e
;
current_state
.
hvmcpHigh
=
false
;
}
...
...
@@ -744,7 +746,7 @@ void setup()
RS232
.
begin
(
9600
);
#endif
log
(
NONE
,
"UE49Interlock starting up...
\n
"
);
log
(
NONE
,
"UE49Interlock
v0.2
starting up...
\n
"
);
log
(
NETWORK
,
"Setting up Ethernet
\n
"
);
...
...
lib.h
View file @
95f53c54
...
...
@@ -2,6 +2,7 @@
#define LIB_H
#include <QtCore>
#include <QLabel>
#include <memory>
enum
MsgType
{
...
...
maintab.cpp
View file @
95f53c54
...
...
@@ -35,7 +35,6 @@ MainTab::MainTab(QWidget *parent) : QWidget(parent), ui(std::make_unique<Ui::Mai
connect
(
ui
->
pumpStartButton
,
&
QPushButton
::
clicked
,
this
,
&
MainTab
::
onPumpStartButtonClicked
);
connect
(
ui
->
linkButton
,
&
QPushButton
::
clicked
,
this
,
&
MainTab
::
onLinkButtonClicked
);
connect
(
ui
->
tDetActive
,
&
QCheckBox
::
stateChanged
,
this
,
&
MainTab
::
onTDetActiveCheckboxClicked
);
connect
(
ui
->
tDpsActive
,
&
QCheckBox
::
stateChanged
,
this
,
&
MainTab
::
onTDpsActiveCheckboxClicked
);
}
...
...
@@ -87,7 +86,6 @@ void MainTab::onNewState(PlcState &msg)
ui
->
pumpRunningLabel
->
setText
(
state
->
pumpEnabled
?
"RUNNING"
:
"STOPPED"
);
ui
->
pumpStartButton
->
setText
(
state
->
pumpEnabled
?
"STOP"
:
"START"
);
ui
->
tDetActive
->
setCheckState
(
state
->
tDetActive
?
Qt
::
Checked
:
Qt
::
Unchecked
);
ui
->
tDpsActive
->
setCheckState
(
state
->
tDpsActive
?
Qt
::
Checked
:
Qt
::
Unchecked
);
}
void
MainTab
::
onDisconnect
()
...
...
@@ -221,16 +219,3 @@ void MainTab::onTDetActiveCheckboxClicked(int val)
emit
log
(
"Error: not connected."
);
}
}
void
MainTab
::
onTDpsActiveCheckboxClicked
(
int
val
)
{
// if(connected)
// {
// PlcState newStat(state.get());
// newStat.tDpsActive = val ? 1 : 0;
// emit sendState(newStat);
// }
// else
// {
// emit log("Error: not connected.");
// }
}
maintab.h
View file @
95f53c54
#ifndef MAINTAB_H
#define MAINTAB_H
#include <memory>
#include <QWidget>
#include <QPushButton>
...
...
@@ -79,7 +78,6 @@ private slots:
void
onPumpStartButtonClicked
();
void
onTDetActiveCheckboxClicked
(
int
state
);
void
onTDpsActiveCheckboxClicked
(
int
state
);
};
...
...
maintab.ui
View file @
95f53c54
...
...
@@ -624,7 +624,7 @@
<property
name=
"geometry"
>
<rect>
<x>
110
</x>
<y>
5
4
0
</y>
<y>
5
7
0
</y>
<width>
88
</width>
<height>
22
</height>
</rect>
...
...
@@ -633,19 +633,6 @@
<string>
tDet
</string>
</property>
</widget>
<widget
class=
"QCheckBox"
name=
"tDpsActive"
>
<property
name=
"geometry"
>
<rect>
<x>
110
</x>
<y>
580
</y>
<width>
88
</width>
<height>
22
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
tDPS
</string>
</property>
</widget>
</widget>
<resources>
<include
location=
"visuals.qrc"
/>
...
...
window.cpp
View file @
95f53c54
...
...
@@ -59,7 +59,7 @@ Window::Window(QWidget *parent) : QMainWindow(parent), ui(std::make_unique<Ui::W
connect
(
ui
->
settings
,
&
SettingsTab
::
log
,
this
,
&
Window
::
log
);
log
(
"UE49Interlock v0.
1
Setup finished!"
);
log
(
"UE49Interlock v0.
2
Setup finished!"
);
}
Window
::~
Window
()
...
...
@@ -92,7 +92,7 @@ void Window::onSystembarOverrideButtonClicked()
newState
.
override
=
!
newState
.
override
;
if
(
newState
.
override
){
bool
ok
;
auto
input
=
QInputDialog
::
getText
(
this
,
tr
(
"Override Password"
),
tr
(
"password:"
),
QLineEdit
::
Normal
,
""
,
&
ok
);
auto
input
=
QInputDialog
::
getText
(
this
,
tr
(
"Override Password"
),
tr
(
"password:"
),
QLineEdit
::
Password
,
""
,
&
ok
);
if
(
ok
)
{
if
(
input
==
"Grace4"
){
...
...
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