简体   繁体   English

如何通过CAPL更改CANalyzer面板中Switch / Indicator元素的路径图像属性?

[英]How to change a path image property of a Switch/Indicator element in CANalyzer's Panel from CAPL?

I'm using a Switch/Indicator Panel element in CANalyzer for visualising some system states with an image. 我正在CANalyzer中使用“开关/指示器面板”元素来形象化某些系统状态。 I would like to change the path from where the Switch/Indicator gets this image by means of a CAPL program configured inside a Program Node in a Mesaurement Setup. 我想通过在Mesaurement设置的“程序”节点中配置的CAPL程序来更改从开关/指示器获取此图像的路径。 So, are there a way to change a property like "image path" of a Switch/Indicator Panel element from CAPL? 因此,有没有办法从CAPL更改诸如“开关/指示器面板”元素的“图像路径”之类的属性?

There is a PictureBox element in the CANalyzer Panel whose file path can be loaded in measurement time with the SetPictureBoxImage() CAPL Panel function. CANalyzer面板中有一个PictureBox元素,可以使用SetPictureBoxImage() CAPL面板函数在测量时间内加载其文件路径。 The advantage of doing so (PictureBox instead Switch/Indicator element Panel) been that if you need to represent a very large number of states (N), the Switch/Indicator method will need a unique very large image file (maybe not manageable), whereas the PictureBox will need N little images. 这样做的优点(用PictureBox代替Switch / Indicator元素面板)是,如果您需要表示非常多的状态(N),则Switch / Indicator方法将需要一个唯一的非常大的图像文件(可能无法管理),而PictureBox将需要N张小图像。

"Switch/Indicator" has property "Image". “开关/指示器”具有属性“图像”。 To change it from CAPL in runtime: 要在运行时从CAPL进行更改:

setControlProperty("Panel name", "Switch/Indicator name", "Image", "c:\1.bmp");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM