![]() |
![]() ![]()
Experimental Physics and
| ||||||||||||||
|
Subject:When I implement curve hiding and realising by modifying the StripChart.traces properties, the curves in StripChart are all cleared and reset. How to solve this problem From:C.C.Wang wjj686702 at 163.com Hi: my css-version is phoebus4.7.3 In my sytem has to many PV to display by StripChart, and they need to be in the same StripChart, So it's not convenient to set it up with the visible option in toolbar. pv is DEV001:CH0 DEV001:CH1 DEV001:CH2 DEV001:CH3 DEV002:CH0 DEV002:CH1 DEV002:CH2 DEV002:CH3 ............DEV100:CH0 DEV100:CH1 DEV001:CH2 DEV001:CH3 and so on. There are multiple devices, each with 4 channels of data. Now, Select DEVnum from a Combo Box, and select ch0-ch3 from four Check boxes, In this way, the curve can be displayed or not displayed I tried several ways to control display and hiding in the StripChart's python Script , Although both control the display and hiding of curves, but they all triggered the curve to clear and reset. Here is the code snippet Method 1: Set trace_type if ch0_selected == 1: widget.setPropertyValue('traces[0].trace_type', 2) #2 is Step type else: widget.setPropertyValue('traces[0].trace_type', 0) #0 is Nono Method 2: Set trace_color from org.csstudio.display.builder.model.properties import WidgetColor HIDDEN_COLOR = WidgetColor(0, 0, 0, 0) if ch0_selected == 1: DEFAULT_COLORS[0] = WidgetColor(0, 0, 255, 255) print("set trace 0 color", DEFAULT_COLORS[0]) widget.setPropertyValue('traces[0].color', DEFAULT_COLORS[0]) else: print("set trace 0 clear", HIDDEN_COLOR) widget.setPropertyValue('traces[0].color', HIDDEN_COLOR) Method 3:Change Pv to local Pv if ch0_selected == 1: print("set trace 0 to dev_pv") widget.setPropertyValue('traces[0].y_pv', "DEV002:CH0") else: print("set trace 0 to dummy pv") widget.setPropertyValue('traces[0].y_pv', "loc://dummy") How to solve this problem? Best regards
| ||||||||||||||
ANJ, 15 Apr 2025 |
![]() · Download · Search · IRMIS · Talk · Documents · Links · Licensing · |