Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pmt-view
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mattia Mancini
pmt-view
Commits
568769cd
Commit
568769cd
authored
1 year ago
by
Mattia Mancini
Browse files
Options
Downloads
Patches
Plain Diff
Adapt to new pmt interface and fix invalid read
parent
827327c3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pmt-view/main.py
+9
-6
9 additions, 6 deletions
pmt-view/main.py
with
9 additions
and
6 deletions
pmt-view/main.py
+
9
−
6
View file @
568769cd
from
argparse
import
ArgumentParser
import
pmt
import
py
pmt
import
time
from
bokeh.plotting
import
figure
from
bokeh.io
import
show
...
...
@@ -7,6 +7,7 @@ from bokeh.embed import file_html
from
bokeh.io
import
curdoc
from
bokeh.models
import
ColumnDataSource
import
config
import
pmt
def
parse_args
():
...
...
@@ -78,20 +79,22 @@ class Display:
def
callback
(
self
):
if
self
.
state
is
None
:
#first read is garbage
self
.
state
=
self
.
sensor
.
read
()
self
.
state
=
self
.
sensor
.
read
()
time
.
sleep
(
1
)
n_state
=
self
.
sensor
.
read
()
self
.
cur_second
+=
p
mt
.
seconds
(
self
.
state
,
n_state
)
self
.
cur_second
+=
p
ypmt
.
PMT
.
seconds
(
self
.
state
,
n_state
)
row
=
{
"
Joules
"
:
[
p
mt
.
joules
(
self
.
state
,
n_state
),
p
ypmt
.
PMT
.
joules
(
self
.
state
,
n_state
),
],
"
Watts
"
:
[
p
mt
.
joules
(
self
.
state
,
n_state
)],
"
Watts
"
:
[
p
ypmt
.
PMT
.
joules
(
self
.
state
,
n_state
)],
"
Average watts
"
:
[
p
mt
.
joules
(
self
.
state
,
n_state
)
/
p
mt
.
seconds
(
self
.
state
,
n_state
)
p
ypmt
.
PMT
.
joules
(
self
.
state
,
n_state
)
/
p
ypmt
.
PMT
.
seconds
(
self
.
state
,
n_state
)
],
"
Average joules
"
:
[
p
mt
.
watts
(
self
.
state
,
n_state
)
/
p
mt
.
seconds
(
self
.
state
,
n_state
)
p
ypmt
.
PMT
.
watts
(
self
.
state
,
n_state
)
/
p
ypmt
.
PMT
.
seconds
(
self
.
state
,
n_state
)
],
"
Seconds
"
:
[
self
.
cur_second
],
}
...
...
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