| Author |
Message |
snovotill
Joined: Feb 8, 2013 Posts: 80
|
Posted: Oct 6, 2013 10:03 PM Post subject: Seeking within EDF Reader via Setter is unsuccessful |
|
Hi all/Jarek,
I'm trying to use \"Setter\" to initialize the playback starting point of \"EDF Reader\" via \"INTERACTIVE PROPERTIES\" element \"Current Position [%]\", but \"EDF Reader\" is ignoring me and starting playback at 0% when I \"Start\" the design. I know my \"Slider\" is outputting the correct % value into \"Setter\". How do I fix this please?
Also, what is the best way of forcing \"EDF Reader\" to re-load it's \"Input File\" upon hitting \"Start\" in BioEra, so that it can report the correct \"Number of Samples\" to \"Property Getter\"? Currently it's reporting on the previously used file, instead of the current one. Entering and leaving \"EDF Reader\" properties in the \"Signal Diagram\" accomplishes this, but I need it to happen automatically at \"Start\".
Thank you. |
|
 |
jarek
Joined: Oct 22, 2007 Posts: 1073
|
Posted: Oct 6, 2013 10:20 PM Post subject: |
|
1. It works for me. See this snippet (you need to set your own EDF file):
http://proatech.com/design/xdf_read_pos_percent.bpd
2. If you load a new file in a EDF/XDF reader you should generally reinitialize all elements in the design using ReinitAll option in PropertySetter. This is important especially when the input sample rate changes with the new file. |
|
 |
snovotill
Joined: Feb 8, 2013 Posts: 80
|
Posted: Oct 7, 2013 1:58 AM Post subject: |
|
Okay that sheds some light on both problems as follows:
The first issue was caused by use of a 2nd-Setter to Start/Stop the EDF-Reader; it is blowing out the CurrentPosition[%] value injected by the 1st-Setter, but I do need to do this. Both Setters feed into the same EI(Event) input of myEDF-Reader. If I disconnect the 2nd-Setter (Start/Stop) from the EDF-Reader then my design works just as well as yours does. Is there a way to to get around this?
Regarding the second issue, forcing a RE-Init-All in Post-Actions for the Setter, does indeed reset the reader nicely, but again it blows out the value injected by the other 1st-Setter (Playback Start Position in %).
So in both case I have an order of precedence issue. I wonder therefore how best to sequence my initialization steps. No doubt there are several options about this and I wonder if you could enumerate them for us all, as potential solutions to similar Order of Precedence problems. Perhaps this could be a short chapter in the manual?
Thanks kindly ...Stepan |
|
 |
jarek
Joined: Oct 22, 2007 Posts: 1073
|
Posted: Oct 7, 2013 3:04 AM Post subject: |
|
The order is primarily determined by the input/output connection. So if an element's input is connected to element B output, then the element B will be starter first and processed first. But if there is a connection loop, then it may get complicated (and becomes random in some cases).
If the same element is accessed by 2 PropertySetters, then you can use Delay element. For example you can set it to delay 1 loop (all elements are processed sequentially in loops).
Or use option \"with delay\" in PropertySetter, see manual for mode details.
The option with Delay element is probably the most often used and easiest to understand. |
|
 |
snovotill
Joined: Feb 8, 2013 Posts: 80
|
Posted: Oct 7, 2013 10:31 PM Post subject: |
|
That was all helpful. My final solution apart from the above was to use PreProcessor for seting the starting %-position into EDF Reader and I had to use Activate/Deactivate on EDF Reader because Start/Stop always blows out this starting position.
One problem remains; I need a way to get EDF Reader to re-read the EDF file upon design start so that it can know the number of samples, as the file changes while BioEra is running. Reloading the design does this(ReInit All does not) but I'd like to do it much less invasively.
Property setter does support \"File path/path\" but does not support \"Object\" input, so I have not found a way to inject my Text Object into Setter; is there a way? If there is another way to get EDF reader to re-read the EDF file at BioEra Start then that would work too.
Thank you ...Stepan |
|
 |
jarek
Joined: Oct 22, 2007 Posts: 1073
|
Posted: Oct 7, 2013 10:52 PM Post subject: |
|
PropertySetter does support Object input.
You just need to change the \"Input type\" property to \"OBJECT\" (this will change the color of the input pin). Then you can use input text to set the path. |
|
 |
snovotill
Joined: Feb 8, 2013 Posts: 80
|
Posted: Oct 8, 2013 1:30 AM Post subject: |
|
| Jeepers I'm feeling stupid! When I first added \"Property Setter\" to the design it only gave me a choice of SCALAR, DOUBLEFLOAT and FLOAT. What is the purpose of those initial selections? Does it make any difference which one I pick? |
|
 |
jarek
Joined: Oct 22, 2007 Posts: 1073
|
Posted: Oct 8, 2013 2:04 AM Post subject: |
|
Those settings make no difference if you use Object input.
They are used if you want to exchange numbers: one dimensional streams, vectors or matrices. In each case you need a different element for the value type you need. |
|
 |
snovotill
Joined: Feb 8, 2013 Posts: 80
|
Posted: Oct 11, 2013 11:40 PM Post subject: |
|
| My design does exactly what it should now. Setting the filename blew out the % Start value again but at a different level of precedence, so I had to get around that via a 1 processing cycle delay element as suggested above. Thanks for all your help Jarek. |
|