//
// $
//

package edu.gemini.wdba.tcc;

import edu.gemini.spModel.gemini.altair.AltairParams;
import edu.gemini.spModel.gemini.gmos.GmosNorthType;
import edu.gemini.spModel.gemini.gmos.InstGmosNorth;
import edu.gemini.spModel.target.obsComp.PwfsGuideProbe;
import edu.gemini.spModel.telescope.IssPort;
import org.junit.Test;

import static edu.gemini.spModel.gemini.altair.AltairParams.GuideStarType.LGS;
import static edu.gemini.spModel.gemini.altair.AltairParams.GuideStarType.NGS;

/**
 * Test cases for GMOS instrument support.
 */
public final class GmosNorthSupportTest extends InstrumentSupportTestBase<InstGmosNorth>{

    public GmosNorthSupportTest() {
        super(InstGmosNorth.SP_TYPE);
    }

    @Test public void testNoAoNoIfuPointOrig() throws Exception {
        verifyPointOrig(getSouthResults(), "gmos");
    }

    @Test public void testNoAoYesIfuPointOrig() throws Exception {
        InstGmosNorth gmos = getInstrument();
        gmos.setFPUnit(GmosNorthType.FPUnitNorth.IFU_1);
        setInstrument(gmos);

        verifyPointOrig(getSouthResults(), "gmos_ifu");
    }

    @Test public void testLgsPointOrig() throws Exception {
        addAltair(LGS); verifyPointOrig(getSouthResults(), "lgs2gmos");
    }

    @Test public void testLgsP1PointOrig() throws Exception {
        addAltair(AltairParams.Mode.LGS_P1);
        addGuideStar(PwfsGuideProbe.pwfs1);
        verifyPointOrig(getSouthResults(), "lgs2gmos_p1");
    }

    @Test public void testNgsPointOrig() throws Exception {
        addAltair(NGS); verifyPointOrig(getSouthResults(), "ngs2gmos");
    }

    @Test public void testNoAoSideLooking() throws Exception {
        setPort(IssPort.SIDE_LOOKING);
        verifyInstrumentConfig(getNorthResults(), "GMOS5");
    }

    @Test public void testNoAoUpLooking() throws Exception {
        setPort(IssPort.UP_LOOKING);
        verifyInstrumentConfig(getNorthResults(), "GMOS");
    }

    @Test public void testAoSideLooking() throws Exception {
        setPort(IssPort.SIDE_LOOKING);
        addAltair();
        verifyInstrumentConfig(getNorthResults(), "AO2GMOS5");
    }

    @Test public void testAoUpLooking() throws Exception {
        setPort(IssPort.UP_LOOKING);
        addAltair();
        verifyInstrumentConfig(getNorthResults(), "AO2GMOS");
    }

}

@@ -142,16 +142,75 @@
 thType;%0A
+import edu.gemini.spModel.gemini.gmos.GmosOiwfsGuideProbe;%0A
 import e
@@ -1536,110 +1536,813 @@
 test
-NgsPointOrig() throws Exception %7B%0A        addAltair(NGS); verifyPointOrig(getSouthResults(), %22ngs2gmos
+LgsOiPointOrig() throws Exception %7B%0A        addAltair(AltairParams.Mode.LGS_OI);%0A        addGuideStar(GmosOiwfsGuideProbe.instance);%0A        verifyPointOrig(getSouthResults(), %22lgs2gmos_oi%22);%0A    %7D%0A%0A    @Test public void testLgsP1OiPointOrig() throws Exception %7B%0A        addAltair(AltairParams.Mode.LGS_P1);%0A        addGuideStar(PwfsGuideProbe.pwfs1);%0A        addGuideStar(GmosOiwfsGuideProbe.instance);%0A        verifyPointOrig(getSouthResults(), %22lgs2gmos_p1_oi%22);%0A    %7D%0A%0A    @Test public void testNgsPointOrig() throws Exception %7B%0A        addAltair(NGS); verifyPointOrig(getSouthResults(), %22ngs2gmos%22);%0A    %7D%0A%0A    @Test public void testNgsOiPointOrig() throws Exception %7B%0A        addAltair(NGS);%0A        addGuideStar(GmosOiwfsGuideProbe.instance);%0A        verifyPointOrig(getSouthResults(), %22ngs2gmos_oi
 %22);%0A

add test cases for new pointing origins