I'm currently learning HDF5 and need to figure out how to add attributes to an empty group with C++. I know how to do it via HDFView, but I can't seem to find any documentation about adding attributes to a simple group, only datasets (is this even possible?).
In HDFView, if you add a group then right-click that group and select "Show properties", a new window will pop up with tabs for 'General' and 'Attributes'. In the 'Attributes' tab you can add multiple attributes. I basically want to do this, but through code.
My code below adds a single group to a new H5 file:
//Create a new file using default properties
H5File file("NewH5.h5", H5F_ACC_TRUNC);
//Create PLATFORM_t and SONAR_t groups in the file
Group groupPlatform(file.createGroup("/PLATFORM_t"));
The operations on attributes attached to files, groups, datasets etc. are the member functions of the H5Location class. In order to write an attribute named "some_attribute" of type double in your group you simply call
double value=42;
DataSpace dspace(H5S_SCALAR);
Attribute att = groupPlatform.createAttribute("some_attribute",PredType::NATIVE_DOUBLE,dspace);
att.write(PredType::NATIVE_DOUBLE,&value);
More complex attributes are possible if you use more complex dataspaces.
Related
I get the option of ifelse() in the Functions list when I am trying to add a calculated field while editing the data, but do not get it from the 'Add' option where I get the option to Add title, Add description, Add calculated field, Add parameter. I get options like sumif, avgif, countif but there I can provide only one condition.
I want to create an ifelse(0) function with multiple conditions dependent on a parameter value which user selects from a dropdown.
If you want to add ifelse() function you have to add it at the Dataset section. it is not available in Data analysis section.
If you want to add multiple choice values in the parameter, then you have to add the list of items by
click on Add Parameter
in the "Create new parameter" dialogue box, select multiple values then write the list of items by each line in the below text area.
then click on the create.
Currently IfEsle() is not supported in analysis based on SPICE dataset. If you want to use IfElse() in analysis convert SPICE dataset to a Direct Query dataset.
In my project I have to create my own multiple sorting and multiple grouping dialogs. Basically user can choose which columns should be included, select order and direction of operation.
For multiple sorting I use this function and it works
.igGridSorting( "sortMultiple", [exprs:array] );
The problem is now with grouiping. Is there any function which will behave similary? I mean executing with array of grouping expressions (which define columns to group by, order of grouping and direction of grouping (acs / desc)) as parameter? (this feature is supported by ignite-ui built-in dialog)
In the documentation I have found:
.igGridGroupBy( "groupByColumns" );
The description is "Adds a column to the group by columns list, executes the group by operation and updates the view."
But there is nothing about how add this columns.
There is no public API method for grouping multiple columns.
The build-in dialog sets the expressions into the datasource and also takes care to rebind the grid and rebuild the grouping area. Unfortunately none of this is exposed as public API.
So the easiest approach would be to go around the columns you need to group and invoke groupByColumn for each column.
Another thing you can do is to re-create the grid with another set of columnSettings for the GroupBy feature.
i want to add sub option with description depends On parent Option Like
eye wear frame power type(single vision,zero power)
sub options for single vision and and zero power
You can add a new field to the database, or utilize an existing one that you don't currently use.
For example:
EAN
If you don't use EAN, you can simply change the name in the language files:
your_directory/admin/language/en-gb/catalog/product.php
Change:
$_['entry_ean'] = 'EAN';
to
$_['entry_ean'] = 'Single Vision';
and similarly for catalog.
Tags are also used in similar fashion, for items to link/group similar products. (If you want all 'single vision' items to be linkable/grouped together, tags would be the easiest way to go.)
I am writing a Maya plugin in c++, and have a custom MPxLocatorNode.I have added numerous custom attributes to this node with:
MFnNumericAttribute nAttr;
Attrib1 = nAttr.create( "Attribute1", "att1", MFnNumericData::kInt,1.0 );
nAttr.setKeyable(false);
nAttr.setStorable(true);
nAttr.setReadable(true);
nAttr.setWritable(true);
nAttr.setHidden(false);
addAttribute( unitId );
Attrib2 = nAttr.create( "Attribute2", "att2", MFnNumericData::kInt,1.0 );
nAttr.setKeyable(false);
...
However I need to add plenty of these attributes and would therefore like to group them when displayed in the attribute editor. Is there a way to dynamically create groups or separators ?
I am a bit confused by the word grouping, but I'll answer the 2 grouping options.
The first one is to group attributes as a compound. A good example of a compound is a point compound. In short you got a point attribute which owns 3 double attributes. So the x, y, z coordinates are grouped under the Point attribute. If now you go in the Channel Editor, you'll see the grouping effect. In the Attribute Editor and for known / predefined types, controls will be assigned automatically, doing some grouping as well.
Now, and because you mentioned the Attribute Panel, I think you are more interested on how you teach the Attribute Editor to have a different layout than the default one. If you create an AE<my custom node name>Template.mel file, with a function of the same name in it, then you can take control on how the layout is done and group, show, hide, change controls of each individual attributes.
For example I got a custom node which you can download from here. Since it is Python and MEL, you can get the full source code from there.
The node name is adskMathNode.
So I created a AEadskMathNodeTemplate.mel file.
This file contains a function declare like this:
global proc AEasdkMathNodeTemplate (string $nodeName) {
editorTemplate -beginScrollLayout ;
...
}
This is where you describe the new layout.
You'll get plenty of bigger example in the Maya folder at
/scripts/AETemplates
I need to populate a few subreports with lists of different objects. Basically lets say i have the following:
Subreport on used Vehicles
Subreport on new Vehicles
I create a vehicle bean class with variables as strings and create getter and setter methods for the same. Then in my datasource I pass in a List<List<String>> as detailRows. detailRows contains a list for new vehicles and a list for used vehicles. So lets say, i pass detailRows in the data source.
Question is how do i pass these two lists to the two sub-reports? Can i use
new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{newVehiclesList}) as a datasource for sub report 1 and
new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{usedVehiclesList}) as datasource for sub report 2?
Is there anything else that needs to be done apart from what i mentioned? Do i need to create and pass any variables? Is the appropriate use of the list of lists as i have listed above or is it $F{detailRows}.get(0)?
I created a field detailRows in the main report as type list. I then pass the following to the subreport data source expression, new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{detailRows}
Is there any way i can pass the newVehiclesList from detailRows to the sub-report?
Thanks!
Selecting your SubReport you can set the property "Connection type" as "Use a data source expression" and inside the property "Data Source Expression" you set this:
new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{yourFieldHere})
Where your "yourFieldHere" is a list (don't forget to set the "Field Class" inside your field properties as a java.util.List as well)
Ok, then you need create two fields with the Field Class as java.util.List, one for each list (newVehiclesList and usedVehiclesList).
Put your two SubReports wherever you want and click on each one doing the following steps:
Change the "Connection type" to "Use a datasource expression" then change the "Data Source Expression" to new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{yourField})
Done.
ps: In order to use the fields inside your newVehiclesList and usedVehiclesList you have to create them inside of their own subReports.
i was the same problems with you and i solved it using the tag List of jasper, i used datasource in my class java, for example:
parameter.put("MyList", new JRBeanCollectionDataSource(ListObjects));
in JRXML
In palete of Jasper, choose the tag LIST and drag and drop in your relatory
after choose
create new dataset
create new dataset from a connection… ...
in data adapter choose new data adapter - collection of javabeans
use a JRDatasource expression
go in lis of parameters and choose you list op objects (MyList)
now go to outline of jasper and
- dataset properties
- edit and query filter ... ...
- javabean
- search you class (I using eclipse, so it's easy to search my class)
- add fields to use