| 1825 | |
| 1826 | |
| 1827 | def 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= """ |
| 1836 | import paraview.simple as smp |
| 1837 | def start_cue(self): |
| 1838 | pass |
| 1839 | |
| 1840 | def 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 | |
| 1849 | def 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 | |
| 1858 | def onIgnoreZeroDistances(): |