예제 #1
0
        public override void _Process(float delta)
        {
            int simulationSteps = LookupTargetSimulationCycles();

            for (int i = 0; i < simulationSteps; i++)
            {
                switch (_testStep)
                {
                case TestStep.Deploy:
                    TestStepDeploy();
                    break;

                case TestStep.Power:
                case TestStep.FirstOff:
                case TestStep.FirstOn:
                case TestStep.SecondOff:
                case TestStep.SecondOn:
                case TestStep.Wait:
                    _testStep = _testCases[_testStep].Check(_testStep);
                    break;

                case TestStep.Both:
                    TestStepBoth();
                    break;

                case TestStep.Report:
                    TestStepReport();
                    break;
                }
                if (_isExecutable)
                {
                    SimulationMaster.UpdateSimulation(16);
                }
            }
        }
예제 #2
0
        private void setupMainWindow()
        {
            this.network = new Network(workerMode, ipAddress);
            master       = new SimulationMaster(this, this.network, this.simplePath);
            master.setClusterSize(clusterSize);
            List <Agent> agents = MapSync.getProducedAgents();

            setWindowSize(master.getMapHeight() + 200, master.getMapWidth() + 100);
            setUpCanvas(master.getMapHeight(), master.getMapWidth());
            numAgents.Text = "" + master.getNumAgents();
            ipTextBox.Text = "" + ipAddress;
        }
예제 #3
0
 /// <summary>
 /// Initializes the whole twat viewer. Called before the node is added to the tree by the lesson controller.
 /// </summary>
 public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson)
 {
     _openedLesson    = openedLesson;
     Simulation       = GetNode <CircularSawModel>("ViewportContainer/Viewport/CircularSawModel");
     SimulationMaster = DiagramSimulationLoader.LoadTemp(openedLesson, Simulation);
     if (SimulationMaster != null)
     {
         Simulation.InitialiseWith(mainNode, openedLesson);
         _isExecutable = SimulationMaster.IsProgramSimulationValid();
         SetupTestSteps();
     }
     else
     {
         _isExecutable = false;
     }
 }
예제 #4
0
 /// <summary>
 /// Initializes the whole test viewer. Called before the node is added to the tree by the lesson controller.
 /// </summary>
 public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson)
 {
     _openedLesson    = openedLesson;
     Simulation       = GetNode <MassTestChamber>(_testChamberPath);
     SimulationMaster = DiagramSimulationLoader.LoadTemp(openedLesson, Simulation);
     if (SimulationMaster != null)
     {
         Simulation.InitialiseWith(mainNode, openedLesson);
         IsExecutable = SimulationMaster.IsProgramSimulationValid();
     }
     else
     {
         IsExecutable = false;
     }
     PaperLog = GetNode <PaperLog>("PaperLog");
     PaperLog.Setup();
     TestController = new TestController(this);
     TestController.Setup();
 }
 void Awake()
 {
     simulationMasterScript = Camera.main.GetComponent <SimulationMaster> ();
 }