What does the <tab> attribute mean in gnuradio 3.7 XML and what is its equivalent in 3.8 YML? - gnuradio

I'm trying to find out what does the <tab> attribute mean in gnuradio 3.7 XML and what is its equivalent in 3.8 YML. As I deduced from this post, documentation that describes GRC OOT schema attributes probably doesn't exist. I want to change the gnuradio 3.7 XML block generation program so that it generates gnuradio 3.8 YML blocks. However, I do not know what <tab> means and what's its equivalent in the YML used by gnuradio 3.8.

The <tab> tag inside of <param> specifies in which Propertie's tab the parameter is going to be displayed.
For example here is the XML definition of the Trigger Mode parameter from qtgui_const_sink_x.xml
<param>
<name>Trigger Mode</name>
<key>tr_mode</key>
<value>qtgui.TRIG_MODE_FREE</value>
<type>enum</type>
<hide>part</hide>
<option>
<name>Free</name>
<key>qtgui.TRIG_MODE_FREE</key>
</option>
<option>
<name>Auto</name>
<key>qtgui.TRIG_MODE_AUTO</key>
</option>
<option>
<name>Normal</name>
<key>qtgui.TRIG_MODE_NORM</key>
</option>
<option>
<name>Tag</name>
<key>qtgui.TRIG_MODE_TAG</key>
</option>
<tab>Trigger</tab>
</param>
And here is how it looks like in the GNU Radio Companion when you open the Properties dialog of QT GUI Constellation Sink block.
For gnuradio 3.8 the equivalent parameter is called category, here is the YAML definition of the same parameter (from qtgui_const_sink_x.block.yml)
- id: tr_mode
label: Trigger Mode
category: Trigger
dtype: enum
default: qtgui.TRIG_MODE_FREE
options: [qtgui.TRIG_MODE_FREE, qtgui.TRIG_MODE_AUTO, qtgui.TRIG_MODE_NORM, qtgui.TRIG_MODE_TAG]
option_labels: [Free, Auto, Normal, Tag]
hide: part

Related

A question about Vue.js source code in function _createElement()

In _createElement, I want to ask whether data.is is same to the v-bind:is?
https://github.com/vuejs/vue/blob/0baa129d4cad44cf1847b0eaf07e95d4c71ab494/src/core/vdom/create-element.js#L64
Why tag = data.is?
Thanks for every respondent!
As the comment in the code suggests, that line is specifically to handle the case where is is included inside an object v-bind. e.g.:
<component v-bind="{ is: 'button' }">Button</component>
You can see this for yourself by setting a breakpoint in your browser on that line. I'm using Webpack and Chrome and the relevant file appears under webpack:///./node_modules/vue/dist/vue.esm.js in the Sources tab. Quick search for _createElement and click in the margin to set a breakpoint.
In the example above the is value is intended to be used as the tag, whereas component is just a dummy tag that can be discarded.
The syntax above is equivalent to:
<component is="button">Button</component>
or:
<button>Button</button>
However, neither of these two examples will go into the relevant if section. In these other two cases the tag is already resolved correctly prior to this point.

Robot Framework: passing argument to a keyword that returns an XPath

In my RF-Selenium project I have a language selection with a couple different options to choose from, which I locate through xpath. I usually separate my high-level keywords, locators/global variables and tests in 3 different files, so I need to get the xpath in one file and keywords in other.
The xpath that I tested and works when hardcoded looks like this: //select[#id="language"]/option[#value="?hl=es"] (and then change the 'es' to any other language identifier to locate other options). So, following the suggestions here I built a "GET LOCATOR" keyword to take a language identifier as a parameter and return the correct xpath:
GET LOCATOR
[Arguments] ${language}
${option locator} Replace String ${LANG} placeholder ${language}
[Return] ${option locator}
I have two different keywords that would use the return value from the GET LOCATOR keyword: in one of them I verify the currently selected language is disabled in the selection list:
${current} Get Element Attribute html#lang
Element Should Be Disabled GET LOCATOR ${current}
and then I actually select a different language and check the page has switched to it:
Select From List By Value ${LANGUAGE SWITCH} es
Wait Until Page Contains Element GET LOCATOR 'es'
All of these is in the Resources file, while the ${LANGUAGE SWITCH} and ${LANG} variables are in a different file (and the Replace String keyword is in the String RF standard library).
The ${LANGUAGE SWITCH} variable holds a css selector that successfully locates the language dropdown. And I already did some tests without the GET LOCATOR keyword and they passed, like:
${current} Get Element Attribute html#lang
Element Should Be Selected xpath=//select[#id="language"]/option[#value="?hl=${current}"]
So I suspect there's a problem with my placeholder xpath, stored in the ${LANG} variable: xpath = //select[#id="language-switch"]/option[#value="?hl=placeholder"]
And this is the DOM part with the language selection dropdown:
<select id="language">
<option value="?hl=ar">Arabic</option>
<option value="?hl=zh-TW">Chinese (Traditional)</option>
<option value="?hl=nl">Dutch - Nederlands‎</option>
<option value="?hl=en" selected="" disabled="">English</option>
<option value="?hl=el">Greek</option>
<option value="?hl=es">Spanish‎</option>
</select>
To make things worse, the test using this keyword fails with no error message, as I only get:
| FAIL |
en
So... what am I doing wrong here?
You cannot call a second keyword from Element should be disabled and Wait Until Page Contains Element. What is happening is that Element should be disabled thinks the locator is the string GET LOCATOR (which obviously doesn't exist), and the custom error message is es.
You will need to break that down into two steps:
${locator}= GET LOCATOR ${current}
Element should be disabled ${locator}

Selected attribute ignored by Dojo/Dijit/SpringJS

I have the following source code for a select:
<select id="_conteneurNum_id" name="conteneurNum" data-dojo-type="dijit.form.FilteringSelect">
<option selected="selected" value="">Tous</option>
<option value="1">951</option>
<option value="2">753</option>
<option value="3">753159</option>
</select>
Which get rendered as follows:
It seems that the selected attribute is ignored by Dojo/Dijit/SpringJS (notice that the user is first presented with a white label instead of "Tous".
Can anyone please help?
Are there any errors in the console?
I have a fiddle that does exactly what you want with your code:
http://jsfiddle.net/cswing/eJP3U/
I just found a workaround after some hours wrestling with MyEclipse 2014, Spring 3.1 and old Dojo/Dijit versions, I know this is old but MyEclipse packs these old versions of everything.
I tried FilteringSelect, Select with null value, html option with value, and replacing dojo libraries which messed the rest of the project. So I'll post this here if it could help anybody:
This case is common if you want a dummy prompt option in your select like '-- Select item --' with a null value. Dojo/dijit version packed with MyEclipse into spring-js-2.3.1.RELEASE, replaces option with null values with separators showed in the dropdown list.
In a few last versions of Dojo/Dijit this behaviour seems to be corrected as you can see in the fiddle of Craig Swing.
If the property you bind is not a string, you can assign a single espace as value of dummy option instead of null, because later will be binded as null in the controller, so the dummy option will be showed. Ex:
<option selected="selected" value="">Tous</option>
But if the property is a String, this way you will find with an unwished blank space in the property in your controller.
So I finally opted to directly modify Select.js
Place it in your project in webapps/resources/dijit/form/Select.js
Comment this lines:
/*
if(!_1.value){
return new dijit.MenuSeparator();
}else{
*/
var _2=dojo.hitch(this,"_setValueAttr",_1);
var _3=new dijit.MenuItem({option:_1,label:_1.label,onClick:_2,disabled:_1.disabled||false});
dijit.setWaiRole(_3.focusNode,"listitem");
return _3;
/*
}
*/
And don't forget to override this path for Resource Servlet in web.xml:
<servlet-mapping>
<servlet-name>My Servlet</servlet-name>
<url-pattern>/resources/dijit/form/Select.js</url-pattern>
</servlet-mapping>

locating html elements with selenese in a test

while writing some acceptance tests for my webapp (playframework based),I got confused by the usage of some selenium commands.
In my html page,I have a submit button like this
<input type="submit" id="removecartitem" value="remove"/>
to locate this,I used
assertElementPresent(id='removecartitem')
however,this fails,
assertElementPresent id='removecartitem' false
The selenium documentation says
id=id: Select the element with the specified #id attribute.
but,if i simply put
assertElementPresent('removecartitem')
Then,the test is executed correctly.This is the source for confusion, since the default way is to select the element whose name attribute is 'removecartitem' ,and I haven't mentioned any name attribute in my html
Any idea why this happens?
It looks like you need to remove the single quotes according to the documentation you provided...e.g:
assertElementPresent(id=removecartitem)

XML configuration of Zend_Form: child nodes and attributes not always equal?

A set of forms (using Zend_Form) that I have been working on were causing me some headaches trying to figure out what was wrong with my XML configuration, as I kept getting unexpected HTML output for a particular INPUT element. It was supposed to be getting a default value, but nothing appeared.
It appears that the following 2 pieces of XML are not equal when used to instantiate Zend_Form:
Snippet #1:
<form>
<elements>
<test type="hidden">
<options ignore="true" value="foo"/>
</test>
</elements>
</form>
Snippet #2:
<form>
<elements>
<test type="hidden">
<options ignore="true">
<value>foo</value>
</options>
</test>
</elements>
</form>
The type of the element doesn't appear to make a difference, so it doesn't appear to be related to hidden fields.
Is this expected or not?
As it was rather quiet on here, I took a look further into the source code and documentation.
On line 259 of Zend_Config_Xml, the SimpleXMLElement object attributes are converted to a string, resulting in:
options Object of: SimpleXMLElement
#attributes Array [2]
label (string:7) I can't see this because
value (string:21) something happens to this
becoming
options (string:21) something happens to this
So, I hunted through the documentation only to find that "value" is a reserved keyword when used as an attribute in an XML file that is loaded into Zend_Config_Xml:
Example #2 Using Tag Attributes in Zend_Config_Xml
"..Zend_Config_Xml also supports two
additional ways of defining nodes in
the configuration. Both make use of
attributes. Since the extends and the
value attributes are reserved keywords
(the latter one by the second way of
using attributes), they may not be
used..."
Thus, it would appear to be "expected" according to the documentation.
I'm not entirely happy that this is a good idea though, considering "value" is an attribute of form elements.
Don't worry about this. The reserved keywords were moved to their own namespace, and the previous attributes were depricated. In Zend Framework 2.0 the non-namespaced attributes will be removed so you can use them again.