Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DIOT reliability studies project
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
DIOT reliability studies project
Merge requests
!3
An error occurred while fetching the assigned milestone of the selected merge_request.
WIP: added new script
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
WIP: added new script
loggin-cp400x
into
master
Overview
0
Commits
6
Pipelines
0
Changes
1
Open
Alén Arias Vázquez
requested to merge
loggin-cp400x
into
master
2 years ago
Overview
0
Commits
6
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
version 4
version 6
bcb639a0
2 years ago
version 5
6eff859f
2 years ago
version 4
da5b5bd5
2 years ago
version 3
3d5ce932
2 years ago
version 2
cae648ac
2 years ago
version 1
b9ce5e79
2 years ago
master (HEAD)
and
latest version
latest version
bcb639a0
6 commits,
7 months ago
version 6
bcb639a0
6 commits,
2 years ago
version 5
6eff859f
5 commits,
2 years ago
version 4
da5b5bd5
4 commits,
2 years ago
version 3
3d5ce932
3 commits,
2 years ago
version 2
cae648ac
2 commits,
2 years ago
version 1
b9ce5e79
1 commit,
2 years ago
Show latest version
1 file
+
5
−
3
Expand all files
Preferences
File browser
List view
Tree view
Compare changes
Inline
Side-by-side
Show whitespace changes
Show one file at a time
cpx400dp/cpx400dp_log.py
+
5
−
3
Options
@@ -41,17 +41,19 @@ class CPX400DPLog(object):
def
get_data
(
self
,
interval
=
1.0
):
self
.
create_directory
()
log_file_name
=
self
.
get_file_name
(
filename
=
'
psu_logging
'
,
number
=
0
)
log_file
=
open
(
log_file_name
,
'
w
'
)
log_file
=
open
(
log_file_name
,
'
w
+
'
)
log_file
.
write
(
"
TIME,V1,I1,V2,I2
\n
"
)
while
True
:
V1
,
V2
,
I1
,
I2
=
self
.
psu
.
get_parameters
()
log_file
.
write
(
"
{},{},{},{},{}
\n
"
.
format
(
time
.
strftime
(
"
%Y-%m-%d %H:%M:%S
"
,
time
.
localtime
(
time
.
time
())),
V1
,
I1
,
V2
,
I2
))
log_file
.
close
()
time
.
sleep
(
interval
)
log_file
=
open
(
log_file_name
,
'
a+
'
)
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
'
CPX400DP logging
'
,
formatter_class
=
argparse
.
ArgumentDefaultsHelpFormatter
)
parser
.
add_argument
(
'
--dir
'
,
"
-d
"
,
type
=
str
,
default
=
'
test
'
,
help
=
"
Directory to storage results
"
)
parser
.
add_argument
(
'
--time
'
,
"
-t
"
,
type
=
float
,
default
=
1.0
,
help
=
"
Logging interval in seconds
"
)
parser
.
add_argument
(
'
--dir
'
,
"
-d
"
,
type
=
str
,
default
=
'
log_cpx400dp
'
,
help
=
"
Directory to storage results
"
)
parser
.
add_argument
(
'
--time
'
,
"
-t
"
,
type
=
float
,
default
=
1.0
,
help
=
"
Logging interval in seconds
"
)
args
=
parser
.
parse_args
()
test
=
CPX400DPLog
(
dirname
=
args
.
dir
)