Okay, now that you have an empty array try writing to it and see how caQtDm displays the result:
caput -S name "This is a long string that is supposed to exceed 40 characters in length"
- Andrew
On May 19, 2020, at 4:57 PM, Paul Nord via Tech-talk <tech-talk at aps.anl.gov> wrote:
Good thought, Andrew.
I changed np.str to np.uint8 and now I get:
caget -S name
name
$ cainfo name
name
State: connected
Host: xyzzy.gov:5064
Access: read, write
Native data type: DBF_CHAR
Request type: DBR_CHAR
Element count: 999
On Tue, May 19, 2020 at 4:47 PM Johnson, Andrew N. <anj at anl.gov> wrote:
I agree with Mark, I suspect the problem is the datatype you’re giving the waveform, i.e. this:
a_PV = builder.Waveform("name",length=999,datatype=np.str)
That np.str should probably be some kind of a character type, not a string type.
Most EPICS developers don’t use the python softioc builder so we don’t recognize what that’s doing very well.
- Andrew
On May 19, 2020, at 4:43 PM, Mark Rivers via Tech-talk <tech-talk at aps.anl.gov> wrote:
OK, so it looks like the problem is the server, not the client. caget and caQtDM agree, correct?
What does cainfo show?
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Paul Nord via Tech-talk
Sent: Tuesday, May 19, 2020 4:35 PM
To: tech-talk <tech-talk at aps.anl.gov>
Subject: Re: Displaying string Waveform in CaQtDM
That's exactly the same.
$ caget -S name
name 999
$
On Tue, May 19, 2020 at 4:31 PM Mark Rivers <rivers at cars.uchicago.edu> wrote:
You used a lowercase –s, it should be uppercase.
caget –S name
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Paul Nord via Tech-talk
Sent: Tuesday, May 19, 2020 4:26 PM
To: EPICS tech-talk <tech-talk at aps.anl.gov>
Subject: Re: Displaying string Waveform in CaQtDM
$ caget -s name
name 999
$
It appears that there are probably 999 blank spaces.
Paul
On Tue, May 19, 2020 at 4:17 PM Mark Rivers <rivers at cars.uchicago.edu> wrote:
What happens if you do:
caget -S name
from the Linux or Windows shell?
Mark
________________________________
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Paul Nord via Tech-talk <tech-talk at aps.anl.gov>
Sent: Tuesday, May 19, 2020 3:59 PM
To: EPICS tech-talk
Subject: Re: Displaying string Waveform in CaQtDM
Thanks, Mark.
But that doesn't work. I don't see any of my text appear.
Is there an example using the python ioc that works?
Or, can you make a CaQtDM window work with the code I included?
Paul
On Tue, May 19, 2020 at 1:44 PM Mark Rivers <rivers at cars.uchicago.edu<mailto:rivers at cars.uchicago.edu>>
wrote:
Hi Paul,
areaDetector has lots of caQtDM files that are autoconverted from medm. These can display waveforms as
strings.
This is an example of a text entry widget to input the file path from
areaDetector/ADCore/ADApp/op/ui/autoconvert/NDFileBase.ui.
<widget class="caTextEntry" name="caTextEntry_3">
<property name="geometry">
<rect>
<x>166</x>
<y>33</y>
<width>500</width>
<height>20</height>
</rect>
</property>
<property name="fontScaleMode">
<enum>caLineEdit::WidthAndHeight</enum>
</property>
<property name="channel">
<string>$(P)$(R)FilePath</string>
</property>
<property name="foreground">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="background">
<color alpha="255">
<red>115</red>
<green>223</green>
<blue>255</blue>
</color>
</property>
<property name="limitsMode">
<enum>caLineEdit::Channel</enum>
</property>
<property name="limitsMode">
<enum>caLineEdit::Channel</enum>
</property>
<property name="precisionMode">
<enum>caLineEdit::Channel</enum>
</property>
<property name="minValue">
<double>0.0</double>
</property>
<property name="maxValue">
<double>1.0</double>
</property>
<property name="colorMode">
<enum>caLineEdit::Static</enum>
</property>
<property name="formatType">
<enum>string</enum>
</property>
</widget>
The readback field (non-editable) is generated as this:
<widget class="caLineEdit" name="caLineEdit_5">
<property name="geometry">
<rect>
<x>166</x>
<y>10</y>
<width>385</width>
<height>18</height>
</rect>
</property>
<property name="fontScaleMode">
<enum>caLineEdit::WidthAndHeight</enum>
</property>
<property name="channel">
<string>$(P)$(R)FilePath_RBV</string>
</property>
<property name="foreground">
<color alpha="255">
<red>10</red>
<green>0</green>
<blue>184</blue>
</color>
</property>
<property name="background">
<color alpha="255">
<red>187</red>
<green>187</green>
<blue>187</blue>
</color>
</property>
<property name="limitsMode">
<enum>caLineEdit::Channel</enum>
</property>
<property name="limitsMode">
<enum>caLineEdit::Channel</enum>
</property>
<property name="precisionMode">
<enum>caLineEdit::Channel</enum>
</property>
<property name="minValue">
<double>0.0</double>
</property>
<property name="maxValue">
<double>1.0</double>
</property>
<property name="alignment">
<set>Qt::AlignAbsolute|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="formatType">
<enum>string</enum>
</property>
<property name="colorMode">
<enum>caLineEdit::Static</enum>
</property>
</widget>
Mark
________________________________
From: Tech-talk <tech-talk-bounces at aps.anl.gov<mailto:tech-talk-bounces at aps.anl.gov>> on behalf of Paul Nord
via Tech-talk <tech-talk at aps.anl.gov<mailto:tech-talk at aps.anl.gov>>
Sent: Tuesday, May 19, 2020 1:21 PM
To: tech-talk at aps.anl.gov<mailto:tech-talk at aps.anl.gov>
Subject: Displaying string Waveform in CaQtDM
I'm stumped on finding a working example.
I would like to put a long text string into a waveform PV and simply display it using CaQtDM. I believe
that I've got the string working since I can access it from other parts of the program. The
caMultiLineString widget suggests that it can display a waveform character string as text. But it's not
working out.
I'm using the python softioc builder.
from softioc import builder
import numpy as np
a_PV = builder.Waveform("name",length=999,datatype=np.str)
a_PV.set("This is some text")
print(bytes(bytearray(a_PV.get())).decode('ascii'))
But it's not clear how to make that string display in CaQtDM.
Any suggestions? Is there a complete example I could look at?
Paul
--
Complexity comes for free, simplicity you have to work for.
--
Complexity comes for free, simplicity you have to work for.