syntax = "proto3";

package biopb.ome;

option java_package = "biopb.ome";
option java_multiple_files = true;

import "biopb/ome/manufacturer_spec.proto";

// Laser types are specified using two attributes - the Type and the
// LaserMedium.
//
message Laser {
    // laser types
    enum Type {
        UNSPECIFIED = 0;
        EXCIMER = 1;
        GAS = 2;
        METAL_VAPOR = 3;
        SOLID_STATE = 4;
        DYE = 5;
        SEMICONDUCTOR = 6;
        FREE_ELECTRON = 7;
        OTHER = 8;
    }

    Type type = 2;

    // The Medium attribute specifies the actual lasing medium
    // for a given laser type.
    // NOTE: OME-XML uses Enum here
    string laser_medium = 3;

    // The Wavelength of the laser. Units are set by WavelengthUnit.
    optional float Wavelength = 4;

    // default is "nm"
    string wavelength_unit = 5;

    // FrequencyMultiplication that may be specified. [units:none]
    optional int32 fequency_multiplication = 6;

    // Whether or not the laser is Tuneable [flag]
    optional bool tunable = 7;

    // The Pulse mode of the laser, e.g. "CW", "QSwitch"
    // NOTE: OME-XML uses an Enum here
    string pulse = 8;

    // If true the laser has a PockelCell to rotate the polarization of the
    // beam. [flag]
    optional bool pockel_cell = 9;

    // The is the rate in Hz at which the laser pulses if the Pulse type is
    // 'Repetitive'. hertz[Hz] Units are set by RepetitionRateUnit.
    optional uint32 repetition_rate = 10;

    string repetition_rate_unit = 11;
}


// The Arc element is used to describe various kinds of Arc lamps - Hg, Xe,
// HgXe. The Power of the Arc is now stored in the LightSource.
//
message Arc {
    // The type of Arc lamp.
    enum Type {
        UNSPECIFIED = 0;
        HG = 1;
        XE = 2;
        HG_XE = 3;
        OTHER = 4;
    }
    Type type = 2;
}


// The Filament element is used to describe various kinds of filament bulbs such
// as Incadescent or Halogen. The Power of the Filament is now stored in the
// LightSource.
//
message Filament {
    enum Type {
        UNSPECIFIED = 0;
        INCANDESCENT = 1;
        HALOGEN = 2;
        OTHER = 3;
    }
    Type type = 2;
}


// The LightEmittingDiode element is used to describe various kinds of LED
// lamps.
//
// As the LightEmittingDiode is inside a LightSource it already has available
// the values from ManufacturerSpec (Manufacturer, Model, SerialNumber,
// LotNumber) And the values from LightSource which includes Power in milliwatts
//
// We have looked at extending this element but have had a problem producing a
// generic solution.
//
// Possible attributes talked about adding include: Power in lumens - but this
// is complicated by multi-channel devices like CoolLED where each channel's
// power is different Wavelength Range - not a simple value so would require
// multiple attributes or a child element Angle of Projection - this would be
// further affected by the optics used for filtering the naked LED or that
// combine power from multiple devices
//
// These values are further affected if you over-drive the LED resulting in a
// more complex system
//
// Another issue is that LED's may not be used directly for illumination but as
// drivers for secondary emissions from doped fiber optics. This would require
// the fiber optics to be modeled.
//
// Thanks to Paul Goodwin of Applied Precision of information about this topic.
//
message LightEmittingDiode {
}


// The GenericExcitationSource element is used to represent a source as a
// collection of key/value pairs, stored in a Map. The other lightsource objects
// should always be used in preference to this if possible.
//
message GenericExcitationSource {
    map<string, string> attributes = 2;
}

// The lightsource for the instrument.  An instrument may have several light
// sources. The type of lightsource is specified by one of the child-elements
// which are 'Laser', 'Filament', 'Arc' or 'LightEmittingDiode'. Each of the
// light source types has its own Type attribute to further differentiate the
// light source (eg, Nd-YAG for Laser or Hg for Arc).
//
message LightSource {
    ManufacturerSpec manufacturer_spec = 2;

    // The light-source power. Units are set by PowerUnit.
    optional float power = 3;

    // The units of the Power - default:milliwatts[mW]
    string power_units = 4;

    // References
    string annotation_ids = 5;

    oneof light_source {
        Laser laser = 6;
        Arc arc = 7;
        Filament filament = 8;
        LightEmittingDiode light_emitting_diode = 9;
        GenericExcitationSource generic_excitation_source = 10;
    }
}
