/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.4
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.apogee.driver;

public class ApogeeFilterWheel {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public ApogeeFilterWheel(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(ApogeeFilterWheel obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        jlibapogeeJNI.delete_ApogeeFilterWheel(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public ApogeeFilterWheel() {
    this(jlibapogeeJNI.new_ApogeeFilterWheel(), true);
  }

  public void Init(ApogeeFilterWheel.Type type, String DeviceAddr) {
    jlibapogeeJNI.ApogeeFilterWheel_Init(swigCPtr, this, type.swigValue(), DeviceAddr);
  }

  public void Close() {
    jlibapogeeJNI.ApogeeFilterWheel_Close(swigCPtr, this);
  }

  public int GetVendorId() {
    return jlibapogeeJNI.ApogeeFilterWheel_GetVendorId(swigCPtr, this);
  }

  public int GetProductId() {
    return jlibapogeeJNI.ApogeeFilterWheel_GetProductId(swigCPtr, this);
  }

  public int GetDeviceId() {
    return jlibapogeeJNI.ApogeeFilterWheel_GetDeviceId(swigCPtr, this);
  }

  public String GetUsbFirmwareRev() {
    return jlibapogeeJNI.ApogeeFilterWheel_GetUsbFirmwareRev(swigCPtr, this);
  }

  public ApogeeFilterWheel.Type GetType() {
    return ApogeeFilterWheel.Type.swigToEnum(jlibapogeeJNI.ApogeeFilterWheel_GetType(swigCPtr, this));
  }

  public String GetName() {
    return jlibapogeeJNI.ApogeeFilterWheel_GetName(swigCPtr, this);
  }

  public ApogeeFilterWheel.Status GetStatus() {
    return ApogeeFilterWheel.Status.swigToEnum(jlibapogeeJNI.ApogeeFilterWheel_GetStatus(swigCPtr, this));
  }

  public int GetMaxPositions() {
    return jlibapogeeJNI.ApogeeFilterWheel_GetMaxPositions(swigCPtr, this);
  }

  public void SetPosition(int Position) {
    jlibapogeeJNI.ApogeeFilterWheel_SetPosition(swigCPtr, this, Position);
  }

  public int GetPosition() {
    return jlibapogeeJNI.ApogeeFilterWheel_GetPosition(swigCPtr, this);
  }

  public final static class Type {
    public final static ApogeeFilterWheel.Type UNKNOWN_TYPE = new ApogeeFilterWheel.Type("UNKNOWN_TYPE", jlibapogeeJNI.ApogeeFilterWheel_UNKNOWN_TYPE_get());
    public final static ApogeeFilterWheel.Type FW50_9R = new ApogeeFilterWheel.Type("FW50_9R", jlibapogeeJNI.ApogeeFilterWheel_FW50_9R_get());
    public final static ApogeeFilterWheel.Type FW50_7S = new ApogeeFilterWheel.Type("FW50_7S", jlibapogeeJNI.ApogeeFilterWheel_FW50_7S_get());
    public final static ApogeeFilterWheel.Type AFW50_10S = new ApogeeFilterWheel.Type("AFW50_10S", jlibapogeeJNI.ApogeeFilterWheel_AFW50_10S_get());
    public final static ApogeeFilterWheel.Type AFW31_17R = new ApogeeFilterWheel.Type("AFW31_17R", jlibapogeeJNI.ApogeeFilterWheel_AFW31_17R_get());

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static Type swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + Type.class + " with value " + swigValue);
    }

    private Type(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private Type(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private Type(String swigName, Type swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static Type[] swigValues = { UNKNOWN_TYPE, FW50_9R, FW50_7S, AFW50_10S, AFW31_17R };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

  public final static class Status {
    public final static ApogeeFilterWheel.Status UNKNOWN_STATUS = new ApogeeFilterWheel.Status("UNKNOWN_STATUS");
    public final static ApogeeFilterWheel.Status NOT_CONNECTED = new ApogeeFilterWheel.Status("NOT_CONNECTED");
    public final static ApogeeFilterWheel.Status READY = new ApogeeFilterWheel.Status("READY");
    public final static ApogeeFilterWheel.Status ACTIVE = new ApogeeFilterWheel.Status("ACTIVE");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static Status swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + Status.class + " with value " + swigValue);
    }

    private Status(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private Status(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private Status(String swigName, Status swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static Status[] swigValues = { UNKNOWN_STATUS, NOT_CONNECTED, READY, ACTIVE };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
