예제 #1
0
 public void slewValue(Instruction.Value rate)
 {
 }
예제 #2
0
 public void setValue(Instruction.Value value)
 {
     if (value.typ == Instruction.Type.BOOLEAN)
     {
         if (value.b)
             startTime = Planetarium.GetUniversalTime();
         else
             startTime = -1.0;
     }
 }
예제 #3
0
 public void setValue(Instruction.Value value)
 {
     if (value.typ == Instruction.Type.BOOLEAN)
     {
         mValue = value.b;
         mChange = true;
     }
 }
예제 #4
0
 public void setValue(Instruction.Value value)
 {
     if (value.typ == Instruction.Type.DOUBLE)
     {
         setTo(value.d);
     }
 }
예제 #5
0
 public void slewValue(Instruction.Value rate)
 {
     if (rate.typ == Instruction.Type.DOUBLE)
     {
         mSlewRate += rate.d;
     }
 }
예제 #6
0
 public void hibernate(Instruction src)
 {
     if (isHibernating) return;
     if (!instructions.Contains(src)) // can't happen
         throw new Instruction.ExecError("hibernated instruction not in program");
     hibernationLine = instructions.IndexOf(src);
     isHibernating = true;
     Logging.Log(string.Format("Hibernated from line {0:D}: {1}", hibernationLine, src.ToString()));
 }
예제 #7
0
 public void setValue(Instruction.Value value)
 {
     if (value.typ == Instruction.Type.BOOLEAN && value.b)
     {
         mQueued++;
     }
 }
예제 #8
0
 public bool AddInstruction(string text, bool lastValue, bool skip)
 {
     Instruction i;
     try
     {
         i = new Instruction(text);
     }
     catch (Instruction.ParseError exc)
     {
         Logging.Message(exc.ToString());
         return false;
     }
     if (i.imemWords > imemWords)
     {
         Logging.Message("Insufficient IMEM for " + i.mText);
         return false;
     }
     if (i.requiresLevelTrigger && !hasLevelTrigger)
     {
         Logging.Message("Processor does not support level triggers");
         Logging.Message("  " + i.mText);
         return false;
     }
     if (i.requiresLogicOps && !hasLogicOps)
     {
         Logging.Message("Processor does not support logical operators");
         Logging.Message("  " + i.mText);
         return false;
     }
     if (i.requiresArithOps && !hasArithOps)
     {
         Logging.Message("Processor does not support arithmetic operators");
         Logging.Message("  " + i.mText);
         return false;
     }
     instructions.Add(i);
     imemWords -= i.imemWords;
     //Logging.Log("Added instruction: " + i.mText);
     return true;
 }
예제 #9
0
 public void setValue(Instruction.Value value)
 {
     if (value.typ == Instruction.Type.NAME)
     {
         mValue = value.n;
     }
     else if (value.typ == Instruction.Type.TUPLE && value.l.Count == 2)
     {
         Instruction.Value hdg = value.l[0], pitch = value.l[1];
         if (hdg.typ == Instruction.Type.DOUBLE && pitch.typ == Instruction.Type.DOUBLE)
         {
             mValue = string.Format("customHP({0},{1})", hdg.d, pitch.d);
             mHdg = hdg.d;
             mPitch = pitch.d;
         }
     }
     else if (value.typ == Instruction.Type.TUPLE && value.l.Count == 3)
     {
         Instruction.Value hdg = value.l[0], pitch = value.l[1], roll = value.l[2];
         if (hdg.typ == Instruction.Type.DOUBLE && pitch.typ == Instruction.Type.DOUBLE && roll.typ == Instruction.Type.DOUBLE)
         {
             mValue = string.Format("customHPR({0},{1},{2})", hdg.d, pitch.d, roll.d);
             mHdg = hdg.d;
             mPitch = pitch.d;
             mRoll = roll.d;
         }
     }
 }
예제 #10
0
 public void setValue(Instruction.Value value)
 {
     if (value.typ == Instruction.Type.BOOLEAN)
     {
         mProcessor.latchState[mIndex] = value.b;
     }
 }
예제 #11
0
파일: Processor.cs 프로젝트: ec429/kpu_mod
 public void wake(Instruction.Value dest)
 {
     if (dest.typ != Instruction.Type.NAME)
         return;
     Processor pDest = mProcessor.findByName(dest.n);
     if (pDest == null)
     {
         Logging.Log(String.Format("No processor \"{0}\" found", dest.n));
         return;
     }
     pDest.wakeup();
 }
예제 #12
0
파일: Processor.cs 프로젝트: ec429/kpu_mod
 public void irq(Instruction.Value value)
 {
     Instruction.Value dest = null, vector = null;
     if (value.typ == Instruction.Type.TUPLE && value.l.Count == 2)
     {
         dest = value.l[0];
         vector = value.l[1];
     }
     else if (value.typ == Instruction.Type.NAME)
     {
         dest = value;
         vector = new Instruction.Value(0.0);
     }
     if (dest.typ != Instruction.Type.NAME)
         return;
     if (vector.typ != Instruction.Type.DOUBLE)
         return;
     Processor pDest = mProcessor.findByName(dest.n);
     if (pDest == null)
     {
         Logging.Log(String.Format("No processor \"{0}\" found", dest.n));
         return;
     }
     int vect = (int)Math.Round(vector.d);
     pDest.setLatch(vect);
 }