MCPcopy Create free account
hub / github.com/Kitware/VeloView / createRPMBehaviour

Function createRPMBehaviour

Application/Ui/python/lidarview/applogic.py:1827–1855  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1825
1826
1827def createRPMBehaviour():
1828 # create and customize a label to display the rpm
1829 rpm = smp.Text(guiName="RPM", Text="No RPM")
1830 representation = smp.GetRepresentation(rpm)
1831 representation.FontSize = 8
1832 representation.Color = [1,1,0]
1833 # create an python animation cue to update the rpm value in the label
1834 PythonAnimationCue1 = smp.PythonAnimationCue()
1835 PythonAnimationCue1.Script= """
1836import paraview.simple as smp
1837def start_cue(self):
1838 pass
1839
1840def tick(self):
1841 rpm = smp.FindSource("RPM")
1842 lidar = smp.FindSource("Data")
1843 if (lidar):
1844 value = int(lidar.Interpreter.GetClientSideObject().GetFrequency())
1845 rpm.Text = str(value) + " RPM"
1846 else:
1847 rpm.Text = "No RPM"
1848
1849def end_cue(self):
1850 pass
1851"""
1852 smp.GetAnimationScene().Cues.append(PythonAnimationCue1)
1853 # force to be consistant with the UI
1854 toggleRPM()
1855 smp.SetActiveSource(None)
1856
1857
1858def onIgnoreZeroDistances():

Callers 1

startFunction · 0.85

Calls 1

toggleRPMFunction · 0.85

Tested by

no test coverage detected