[ome-devel] enum type for acqusition enums

josh.moore at gmx.de josh.moore at gmx.de
Fri Jun 5 10:36:46 BST 2009


Bernhard Holländer writes:
 > Hi Josh!

Tag.

 > Well, I was looking for enum types which define the possible values of
 > the enums in the *.ome.xml files. I would have used them in a switch
 > construct to get the corresponding string value.

Understood. Currently they are only stored in a properties file
("enums.properties") in blitz.jar.

During the code generation rework for 4.1 I'll look into to having
them parsed to Ice enums:

  https://trac.openmicroscopy.org.uk/omero/ticket/1381


Cheers,
~Josh

 > Anyways, thanks for the answer - good to know that I can add values to
 > the enum types in the db.
 > 
 > Best wishes! Bernhard
 > 
 > On Wed, May 27, 2009 at 5:49 PM,  <josh.moore at gmx.de> wrote:
 > >
 > > Bernhard Holländer writes:
 > >  > Hi!
 > >
 > > Hi, Bernhard,
 > >
 > >  > Quick question: are there enum types in OmeroCpp that match the
 > >  > enums defined in acquisition.ome.xml?
 > >
 > > There's possibly some confusion here. There are both enumerations in
 > > Ice and in the OMERO object model. The enums in the *.ome.xml files
 > > become omero.model classes in OmeroCpp. For example,
 > >
 > >        <enum id="ome.model.enums.FilterType">
 > >                <entry name="LongPass"/>
 > >                <entry name="ShortPass"/>
 > >                <entry name="BandPass"/>
 > >                <entry name="MultiPass"/>
 > >                <entry name="Other"/>
 > >                <entry name="Unknown"/>
 > >        </enum>
 > >
 > > becomes omero::model::FilterType, and the entries are created as rows
 > > in your db on initialization. Other values can then be added as
 > > necessary via omero::api::ITypePrx.
 > >
 > > To use them in a graph which you are passing to the server, it
 > > suffices to have an unloaded value with the proper id, or conversely,
 > > an object with only the "value" field loaded:
 > >
 > >  FilterTyprPtr ft = new FilterType();
 > >  ft->setValue( rstring("LongPass") );
 > >
 > > Ice enumerations, on the other hand, are generated as static fields:
 > >
 > >  https://trac.openmicroscopy.org.uk/omero/browser/trunk/examples/OmeroClients/enumerations.cpp
 > >
 > > Hope that clears things up.
 > > ~Josh.


More information about the ome-devel mailing list