Beispiel #1
0
 public Series_1_2(ESeriesType type, EFreq_1_2 freq)
 {
     //Creates minimal light series
     this.type = type;
     this.freq = freq;
     if (type != ESeriesType.Normal && type != ESeriesType.Light)
     {
         G.Writeln2("*** ERROR: Series constructor error");
         throw new GekkoException();
     }
 }
Beispiel #2
0
        public static GekkoTime_1_2 tNull = new GekkoTime_1_2(EFreq_1_2.A, -12345, 1);  //think of it as a 'null' object (but it is a struct)

        public GekkoTime_1_2(EFreq_1_2 freq2, int super2, int sub2)
        {
            freq  = freq2;
            super = (short)super2;
            sub   = (short)sub2;
            //Sanity checks to follow
            //Problem is that TIME 2010m13 2012m0 can probably parse. If not, the check below is not necessary.
            if (sub < 1)
            {
                G.Writeln2("*** ERROR: subperiod < 1");
                throw new GekkoException();
            }
            if (freq == EFreq_1_2.A)
            {
                if (sub > 1)
                {
                    G.Writeln2("*** ERROR: freq 'a' cannot have subperiod > 1");
                    throw new GekkoException();
                }
            }
            else if (freq == EFreq_1_2.Q)
            {
                if (sub > 4)
                {
                    G.Writeln2("*** ERROR: freq 'q' cannot have subperiod > 4");
                    throw new GekkoException();
                }
            }
            else if (freq == EFreq_1_2.M)
            {
                if (sub > 12)
                {
                    G.Writeln2("*** ERROR: freq 'm' cannot have subperiod > 12");
                    throw new GekkoException();
                }
            }
            else if (freq == EFreq_1_2.U)
            {
                if (sub > 1)
                {
                    G.Writeln2("*** ERROR: freq 'u' cannot have subperiod > 1");
                    throw new GekkoException();
                }
            }
            subsub = 0;
        }