Beispiel #1
0
 private void addTimer(TimerIO t)
 {
     addInput(t);
     addOutput(t);
 }
Beispiel #2
0
        public Processor(Part part, Modules.ModuleKpuProcessor module)
        {
            mRandom = new System.Random();
            mPart = part;
            hasLevelTrigger = module.hasLevelTrigger;
            hasLogicOps = module.hasLogicOps;
            hasArithOps = module.hasArithOps;
            imemWords = module.imemWords;
            latches = module.latches;
            timers = module.timers;
            isRunning = module.isRunning;
            instructions = new List<Instruction>();
            if (latches > 0)
            {
                latchState = new List<bool>(latches);
                for (int i = 0; i < latches; i++)
                {
                    latchState.Add(false);
                    addLatch(new LatchIO(this, i));
                }
            }
            if (timers > 0)
            {
                timerState = new List<TimerIO>(timers);
                for (int i = 0; i < timers; i++)
                {
                    TimerIO t = new TimerIO(this, i);
                    timerState.Add(t);
                    addTimer(t);
                }
            }
            addInput(new Batteries(this));
            addInput(new Gear(this));
            addInput(new SrfHeight(this));
            addInput(new SrfSpeed(this));
            addInput(new SrfVerticalSpeed(this));
            addInput(new VesselTMR(this));
            addInput(new LocalG(this));
            addInput(new Altitude(this));
            addInput(new Latitude(this));
            addInput(new Longitude(this));
            addInput(new OrbSpeed(this));
            addInput(new Periapsis(this));
            addInput(new Apoapsis(this));
            addInput(new Inclination(this));
            addInput(new ANLongitude(this));
            addInput(new PeriLongitude(this));
            addInput(new Heading(this));
            addOutput(new Throttle());
            addOutput(new Orient());
            addOutput(new Stage());
            addOutput(new GearOutput());
            addOutput(new Brakes());
            addOutput(new Lights());
            addOutput(new Abort());
            addOutput(new SolarPanels());
            addOutput(new RTAntennas());
            addOutput(new RoverMotors());
            addOutput(new RoverSteer());

            initPIDParameters();
        }