pj: update thermal layout + layout test (#26224)

old-commit-hash: bc7fc481d5
taco
Adeeb Shihadeh 3 years ago committed by GitHub
parent ed9c040be9
commit e3ef65ab4a
  1. 93
      tools/plotjuggler/layouts/thermal_debug.xml
  2. 22
      tools/plotjuggler/test_plotjuggler.py

@ -1,82 +1,83 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<root> <root>
<tabbed_widget name="Main Window" parent="main_window"> <tabbed_widget name="Main Window" parent="main_window">
<Tab containers="1" tab_name="tab1"> <Tab tab_name="tab1" containers="1">
<Container> <Container>
<DockSplitter count="5" sizes="0.200198;0.199703;0.200198;0.199703;0.200198" orientation="-"> <DockSplitter orientation="-" count="5" sizes="0.199688;0.200468;0.199688;0.200468;0.199688">
<DockArea name="..."> <DockArea name="...">
<plot style="Lines" mode="TimeSeries" flip_x="false" flip_y="false"> <plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range bottom="63.929997" top="96.270000" right="2052.279275" left="0.000000"/> <range left="0.001973" right="4522.285082" bottom="59.907502" top="80.592498"/>
<limitY/> <limitY/>
<curve color="#1f77b4" name="/deviceState/cpuTempC/0"/> <curve name="/deviceState/cpuTempC/0" color="#1f77b4"/>
<curve color="#d62728" name="/deviceState/cpuTempC/1"/> <curve name="/deviceState/cpuTempC/1" color="#d62728"/>
<curve color="#1ac938" name="/deviceState/cpuTempC/2"/> <curve name="/deviceState/cpuTempC/2" color="#1ac938"/>
<curve color="#ff7f0e" name="/deviceState/cpuTempC/3"/> <curve name="/deviceState/cpuTempC/3" color="#ff7f0e"/>
<curve color="#f14cc1" name="/deviceState/cpuTempC/4"/> <curve name="/deviceState/cpuTempC/4" color="#f14cc1"/>
<curve color="#9467bd" name="/deviceState/cpuTempC/5"/> <curve name="/deviceState/cpuTempC/5" color="#9467bd"/>
<curve color="#17becf" name="/deviceState/cpuTempC/6"/> <curve name="/deviceState/cpuTempC/6" color="#17becf"/>
<curve color="#bcbd22" name="/deviceState/cpuTempC/7"/> <curve name="/deviceState/cpuTempC/7" color="#bcbd22"/>
</plot> </plot>
</DockArea> </DockArea>
<DockArea name="..."> <DockArea name="...">
<plot style="Lines" mode="TimeSeries" flip_x="false" flip_y="false"> <plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range bottom="55.402226" top="98.526775" right="2052.279275" left="0.000000"/> <range left="0.001973" right="4522.285082" bottom="53.190350" top="81.063652"/>
<limitY/> <limitY/>
<curve color="#1f77b4" name="/deviceState/pmicTempC/0"/> <curve name="/deviceState/pmicTempC/0" color="#1f77b4"/>
<curve color="#d62728" name="/deviceState/gpuTempC/0"/> <curve name="/deviceState/gpuTempC/0" color="#d62728"/>
<curve color="#1ac938" name="/deviceState/gpuTempC/1"/> <curve name="/deviceState/gpuTempC/1" color="#1ac938"/>
<curve color="#f14cc1" name="/deviceState/memoryTempC"/> <curve name="/deviceState/memoryTempC" color="#f14cc1"/>
</plot> </plot>
</DockArea> </DockArea>
<DockArea name="..."> <DockArea name="...">
<plot style="Lines" mode="TimeSeries" flip_x="false" flip_y="false"> <plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range bottom="-0.050000" top="2.050000" right="2052.279275" left="0.000000"/> <range left="0.001973" right="4522.285082" bottom="-0.100000" top="0.100000"/>
<limitY/> <limitY/>
<curve color="#1f77b4" name="/deviceState/thermalStatus"/> <curve name="/deviceState/thermalStatus" color="#1f77b4"/>
</plot> </plot>
</DockArea> </DockArea>
<DockSplitter count="3" sizes="0.333333;0.333333;0.333333" orientation="|"> <DockSplitter orientation="|" count="3" sizes="0.333333;0.333333;0.333333">
<DockArea name="..."> <DockArea name="...">
<plot style="Lines" mode="TimeSeries" flip_x="false" flip_y="false"> <plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range bottom="5.045103" top="12.507322" right="2052.279275" left="0.000000"/> <range left="0.001973" right="4522.285082" bottom="4.522255" top="12.156595"/>
<limitY/> <limitY/>
<curve color="#ff7f0e" name="/deviceState/powerDrawW"/> <curve name="/deviceState/powerDrawW" color="#ff7f0e"/>
</plot> </plot>
</DockArea> </DockArea>
<DockArea name="..."> <DockArea name="...">
<plot style="Lines" mode="TimeSeries" flip_x="false" flip_y="false"> <plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range bottom="0.000000" top="100.000000" right="2052.279275" left="0.000000"/> <range left="0.001973" right="4522.285082" bottom="0.000000" top="100.000000"/>
<limitY min="0" max="100"/> <limitY min="0" max="100"/>
<curve color="#9467bd" name="/deviceState/fanSpeedPercentDesired"/> <curve name="/deviceState/fanSpeedPercentDesired" color="#9467bd"/>
<curve name="/pandaStates/0/fanPower" color="#1f77b4"/>
</plot> </plot>
</DockArea> </DockArea>
<DockArea name="..."> <DockArea name="...">
<plot style="Lines" mode="TimeSeries" flip_x="false" flip_y="false"> <plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range bottom="2409.750000" top="5780.250000" right="2052.279275" left="0.000000"/> <range left="0.001973" right="4522.285082" bottom="-118.075000" top="4841.075000"/>
<limitY/> <limitY/>
<curve color="#1f77b4" name="/peripheralState/fanSpeedRpm"/> <curve name="/peripheralState/fanSpeedRpm" color="#1f77b4"/>
</plot> </plot>
</DockArea> </DockArea>
</DockSplitter> </DockSplitter>
<DockSplitter count="2" sizes="0.502632;0.497368" orientation="|"> <DockSplitter orientation="|" count="2" sizes="0.502445;0.497555">
<DockArea name="..."> <DockArea name="...">
<plot style="Lines" mode="TimeSeries" flip_x="false" flip_y="false"> <plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range bottom="-0.350000" top="98.350000" right="2052.279275" left="0.000000"/> <range left="0.001973" right="4522.285082" bottom="-2.300000" top="94.300000"/>
<limitY/> <limitY/>
<curve color="#1f77b4" name="/deviceState/cpuUsagePercent/0"/> <curve name="/deviceState/cpuUsagePercent/0" color="#1f77b4"/>
<curve color="#d62728" name="/deviceState/cpuUsagePercent/1"/> <curve name="/deviceState/cpuUsagePercent/1" color="#d62728"/>
<curve color="#1ac938" name="/deviceState/cpuUsagePercent/2"/> <curve name="/deviceState/cpuUsagePercent/2" color="#1ac938"/>
<curve color="#ff7f0e" name="/deviceState/cpuUsagePercent/3"/> <curve name="/deviceState/cpuUsagePercent/3" color="#ff7f0e"/>
</plot> </plot>
</DockArea> </DockArea>
<DockArea name="..."> <DockArea name="...">
<plot style="Lines" mode="TimeSeries" flip_x="false" flip_y="false"> <plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range bottom="-2.500000" top="102.500000" right="2052.279275" left="0.000000"/> <range left="0.001973" right="4522.285082" bottom="-2.450000" top="100.450000"/>
<limitY/> <limitY/>
<curve color="#f14cc1" name="/deviceState/cpuUsagePercent/4"/> <curve name="/deviceState/cpuUsagePercent/4" color="#f14cc1"/>
<curve color="#9467bd" name="/deviceState/cpuUsagePercent/5"/> <curve name="/deviceState/cpuUsagePercent/5" color="#9467bd"/>
<curve color="#17becf" name="/deviceState/cpuUsagePercent/6"/> <curve name="/deviceState/cpuUsagePercent/6" color="#17becf"/>
<curve color="#bcbd22" name="/deviceState/cpuUsagePercent/7"/> <curve name="/deviceState/cpuUsagePercent/7" color="#bcbd22"/>
</plot> </plot>
</DockArea> </DockArea>
</DockSplitter> </DockSplitter>
@ -92,8 +93,8 @@
<plugin ID="DataLoad Rlog"/> <plugin ID="DataLoad Rlog"/>
<plugin ID="Cereal Subscriber"/> <plugin ID="Cereal Subscriber"/>
</Plugins> </Plugins>
<!-- - - - - - - - - - - - - - - --> <customMathEquations/>
<!-- - - - - - - - - - - - - - - --> <snippets/>
<!-- - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - -->
</root> </root>

@ -1,5 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import os import os
import glob
import signal import signal
import subprocess import subprocess
import time import time
@ -9,12 +10,14 @@ from common.basedir import BASEDIR
from common.timeout import Timeout from common.timeout import Timeout
from tools.plotjuggler.juggle import install from tools.plotjuggler.juggle import install
PJ_DIR = os.path.join(BASEDIR, "tools/plotjuggler")
class TestPlotJuggler(unittest.TestCase): class TestPlotJuggler(unittest.TestCase):
def test_demo(self): def test_demo(self):
install() install()
pj = os.path.join(BASEDIR, "tools/plotjuggler/juggle.py") pj = os.path.join(PJ_DIR, "juggle.py")
p = subprocess.Popen(f'QT_QPA_PLATFORM=offscreen {pj} --demo None 1 --qlog', p = subprocess.Popen(f'QT_QPA_PLATFORM=offscreen {pj} --demo None 1 --qlog',
stderr=subprocess.PIPE, shell=True, start_new_session=True) stderr=subprocess.PIPE, shell=True, start_new_session=True)
@ -29,5 +32,22 @@ class TestPlotJuggler(unittest.TestCase):
self.assertEqual(p.poll(), None) self.assertEqual(p.poll(), None)
os.killpg(os.getpgid(p.pid), signal.SIGTERM) os.killpg(os.getpgid(p.pid), signal.SIGTERM)
# TODO: also test that layouts successfully load
def test_layouts(self):
bad_strings = (
# if a previously loaded file is defined,
# PJ will throw a warning when loading the layout
"fileInfo",
"previouslyLoaded_Datafiles",
)
for fn in glob.glob(os.path.join(PJ_DIR, "layouts/*")):
name = os.path.basename(fn)
with self.subTest(layout=name):
with open(fn) as f:
layout = f.read()
violations = [s for s in bad_strings if s in layout]
assert len(violations) == 0, f"These should be stripped out of the layout: {str(violations)}"
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()

Loading…
Cancel
Save