private static string readPointsStateMachine() { switch (currentState) { case (int)READ_STATE.READ_POINT: { // Read each cal point if (readCount < NUM_CAL_POINTS) { // Request data point uiForm.lru0.setCalReadF(locCount); return("next"); } else { // Shut this state off //readPointsRunning = false; CalGyro.setReadRunningState(false); // Button color uiForm.btStartGyroRead.BackColor = System.Drawing.Color.DarkGreen; // Check for chain if (uiForm.cbChainGyroToAtp.Checked) { // Start Test cycle AtpGyro.setAhrsAtpRunningSate(true); // return ("wait"); } return("end"); } } case (int)READ_STATE.WAIT_POINT: { // See if value is back // TODO address sign if (!uiForm.lru0.returnReady) { return("wait"); } else { addTableEntry(movePointDesc[readCount], uiForm.lru0.senBoardFbValF, "READ"); readCount++; locCount++; // Loop back to next point currentState = (int)READ_STATE.READ_POINT; return("other"); } } default: { return("end"); } } }
private static string readPointsStateMachine() { switch (currentState) { case (int)READ_STATE.READ_POINT: { // Read each cal point if (readCount < NUM_CAL_POINTS) { // Request data point uiForm.lru0.setCalReadF(locCount); uiForm.setConsoleText("LRU0", ">" + locCount.ToString("D2")); return("next"); } else { // Shut this state off setReadRunningState(false); //readPointsRunning = false; // Button color uiForm.btStartAccelRead.BackColor = System.Drawing.Color.DarkGreen; // Check for chain if (uiForm.cbChainAccelToGyro.Checked) { // Start Test cycle System.Threading.Thread.Sleep(3000); CalGyro.setBiasRunningSate(true); //return ("wait"); } return("end"); } } case (int)READ_STATE.WAIT_POINT: { // See if value is back // TODO address sign if (!uiForm.lru0.returnReady) { return("wait"); } else { uiForm.dgAccelCalLru0Data.Rows.Add(uiForm.lru0.senBoardFbValF.ToString("00.00000"), "READ"); readCount++; locCount++; // Loop back to next point currentState = (int)READ_STATE.READ_POINT; return("other"); } } default: { return("end"); } } }