Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CoincellExperimentController
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Klemm, Carl Philipp
CoincellExperimentController
Commits
d5a9aafd
Commit
d5a9aafd
authored
1 year ago
by
Carl Philipp Klemm
Browse files
Options
Downloads
Patches
Plain Diff
allow the masking of heaters
parent
4acf4f8e
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
heater.cpp
+11
-1
11 additions, 1 deletion
heater.cpp
heaters.h
+2
-1
2 additions, 1 deletion
heaters.h
main.cpp
+1
-1
1 addition, 1 deletion
main.cpp
options.h
+12
-3
12 additions, 3 deletions
options.h
with
26 additions
and
6 deletions
heater.cpp
+
11
−
1
View file @
d5a9aafd
#include
<coincellhell/coincellhell.h>
#include
<coincellhell/usbcommands.h>
#include
<cstdint>
#include
<ctime>
#include
<memory>
#include
<thread>
...
...
@@ -9,7 +10,7 @@
Heaters
::
Heaters
(
const
std
::
vector
<
uint16_t
>
serials
,
std
::
function
<
void
(
int
device
,
uint16_t
serial
,
int
code
)
>
deviceFailCbIn
,
std
::
function
<
void
(
int
heater
,
int
device
)
>
heaterFailCbIn
)
:
std
::
function
<
void
(
int
heater
,
int
device
)
>
heaterFailCbIn
,
const
std
::
set
<
uint16_t
>&
maskedSerials
)
:
deviceFailCb
(
deviceFailCbIn
),
heaterFailCb
(
heaterFailCbIn
)
{
Log
(
Log
::
INFO
)
<<
"inializeing "
<<
serials
.
size
()
<<
" coincellhell devices with "
<<
serials
.
size
()
*
HEATERS_PER_DEVICE
<<
" heaters"
;
...
...
@@ -22,6 +23,15 @@ deviceFailCb(deviceFailCbIn), heaterFailCb(heaterFailCbIn)
{
devices
[
i
].
mutex
=
std
::
make_unique
<
std
::
mutex
>
();
int
ret
=
coincellhell_connect
(
&
devices
[
i
].
device
,
serials
[
i
]);
if
(
maskedSerials
.
contains
(
serials
[
i
]))
{
if
(
ret
!=
0
)
Log
(
Log
::
WARN
)
<<
"Could not connect to masked heater device with the serial "
<<
serials
[
i
];
devices
[
i
].
bad
=
true
;
continue
;
}
if
(
ret
!=
0
)
{
throw
startup_failure
(
"Unable to connect to coincellhell with serial "
+
std
::
to_string
(
serials
[
i
]));
...
...
This diff is collapsed.
Click to expand it.
heaters.h
+
2
−
1
View file @
d5a9aafd
...
...
@@ -6,6 +6,7 @@
#include
<functional>
#include
<mutex>
#include
<memory>
#include
<set>
#include
"log.h"
...
...
@@ -51,7 +52,7 @@ public:
Heaters
(
const
std
::
vector
<
uint16_t
>
serials
,
std
::
function
<
void
(
int
device
,
uint16_t
serial
,
int
code
)
>
deviceFailCb
,
std
::
function
<
void
(
int
heater
,
int
device
)
>
heaterFailCb
);
std
::
function
<
void
(
int
heater
,
int
device
)
>
heaterFailCb
,
const
std
::
set
<
uint16_t
>&
maskedHeaters
=
{}
);
bool
wait
(
int
timeout
=
-
1
);
bool
allReady
();
std
::
vector
<
bool
>
getBadDevices
();
...
...
This diff is collapsed.
Click to expand it.
main.cpp
+
1
−
1
View file @
d5a9aafd
...
...
@@ -221,7 +221,7 @@ int main(int argc, char** argv)
Log
(
Log
::
INFO
)
<<
"Aquireing heaters and multiplexers"
;
Heaters
heaters
(
config
.
heaterSerials
,
[
&
psu
](
int
device
,
uint16_t
serial
,
int
code
){
devicefailed
(
psu
,
device
,
serial
,
code
);},
&
heaterfailed
);
&
heaterfailed
,
config
.
maskedHeaters
);
Multiplexers
multiplexers
(
config
.
multiplexerSerials
);
std
::
vector
<
std
::
unique_ptr
<
CoinCell
>>
coinCells
=
asign_coincells
(
config
.
cells
,
&
heaters
,
&
multiplexers
);
...
...
This diff is collapsed.
Click to expand it.
options.h
+
12
−
3
View file @
d5a9aafd
...
...
@@ -5,6 +5,7 @@
#include
<vector>
#include
<argp.h>
#include
<filesystem>
#include
<set>
#include
"log.h"
#include
"tokenize.h"
...
...
@@ -21,6 +22,7 @@ static struct argp_option options[] =
{
"out"
,
'o'
,
"[DIRECTORY]"
,
0
,
"Directory where to save the output mesurements"
},
{
"muliplexers"
,
'm'
,
"[SERIALS]"
,
0
,
"List the serial numbers of the involved multiplexers"
},
{
"heaters"
,
'r'
,
"[SERIALS]"
,
0
,
"set the serial numbers of the involved coincellhells"
},
{
"heater-mask"
,
'x'
,
"[SERIALS]"
,
0
,
"disable the actual driveing of the given heaters"
},
{
"psuport"
,
'p'
,
"[PORT]"
,
0
,
"sets the serial port where the psu is connected"
},
{
"biocontrol"
,
'b'
,
"[PATH]"
,
0
,
"sets the path where the biocontrol application is stored"
},
{
"bioip"
,
'i'
,
"[IPADDR]"
,
0
,
"the ip address of the biologic device"
},
...
...
@@ -28,8 +30,8 @@ static struct argp_option options[] =
{
"voltage"
,
'u'
,
"[VOLTAGE]"
,
0
,
"sets the voltage at wich to operate the heaters"
},
{
"current"
,
'l'
,
"[CURRENT]"
,
0
,
"sets the current limit at wich to operate the heaters"
},
{
"step"
,
's'
,
"[STEP NUMBER]"
,
0
,
"sets the global setp at wich to start the expirament"
},
{
"sub-step"
,
'k'
,
"[STEP NUMBER]"
,
0
,
"sets the subse
t
of the expirament"
},
{
"stepfile"
,
'f'
,
"[PATH]"
,
0
,
"set
s
th
e subset of the expirament
"
},
{
"sub-step"
,
'k'
,
"[STEP NUMBER]"
,
0
,
"sets the subse
p
of the expirament"
},
{
"stepfile"
,
'f'
,
"[PATH]"
,
0
,
"
if
set th
is file is used to save the step and substep
"
},
{
"skip-start"
,
'z'
,
0
,
0
,
"skipps the startup sequence"
},
{
"watchdog"
,
'w'
,
0
,
0
,
"enable mcu watchdogs"
},
{
0
}
...
...
@@ -39,6 +41,7 @@ struct Config
{
std
::
vector
<
uint16_t
>
multiplexerSerials
=
{
1
,
2
,
3
,
4
,
5
};
std
::
vector
<
uint16_t
>
heaterSerials
=
{
1
,
2
,
3
,
4
,
5
,
6
};
std
::
set
<
uint16_t
>
maskedHeaters
;
std
::
string
psuPort
=
"/dev/ttyUSB0"
;
std
::
filesystem
::
path
biocontrolpath
=
"/home/philipp/programming/biocontrol/build/biocontrol.exe"
;
std
::
string
bioip
=
"10.2.0.2"
;
...
...
@@ -85,6 +88,12 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state)
case
'r'
:
config
->
heaterSerials
=
parseList
(
arg
);
break
;
case
'x'
:
{
std
::
vector
<
uint16_t
>
list
=
parseList
(
arg
);
config
->
maskedHeaters
.
insert
(
list
.
begin
(),
list
.
end
());
break
;
}
case
'p'
:
config
->
psuPort
=
arg
;
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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