private void NextInputPath() { inputPathMode = false; inputPathCorrectnessMode = true; Klub_u.SetInfo("Признак правильности пути = " + (CorrectPath ? "1" : "0") + " "); Klub_u.SetPathNumber(PathNumber, CorrectPath); }
public override void PressButtonK() { inputInfoMode = false; inputPathMode = false; inputPathCorrectnessMode = false; Klub_u.SetInfo(Info); inputCommandMode = true; inputNumberTool.Reset(); }
private void NextInputInfo() { inputInfoParametr++; if (inputInfoParametr >= 5) { inputInfoMode = false; Klub_u.SetInfo(Info); return; } else { Klub_u.SetInfo(InputInfoParametrs[inputInfoParametr] + " - " + TrainParametrs[inputInfoParametr] + " "); } }
public override void PressButtonL() { inputCommandMode = false; inputPathMode = false; inputPathCorrectnessMode = false; if (inputInfoMode) { NextInputInfo(); } else if (ActualSpeed == 0 && HasCassette) { inputInfoMode = true; inputInfoParametr = 0; Klub_u.SetInfo(InputInfoParametrs[inputInfoParametr] + " - " + TrainParametrs[inputInfoParametr] + " "); } }
// a = +1 if press button plus and a = -1 if press minus private void PlusOrMinusParametr(int a) { if (inputInfoMode) { TrainParametrs[inputInfoParametr] += a; Klub_u.SetInfo(InputInfoParametrs[inputInfoParametr] + " - " + TrainParametrs[inputInfoParametr].ToString() + " "); } else if (inputPathMode) { PathNumber += (byte)a; Klub_u.SetInfo("Номер пути = " + PathNumber.ToString() + " "); } else if (inputPathCorrectnessMode) { CorrectPath = !CorrectPath; Klub_u.SetInfo("Признак правильности пути = " + (CorrectPath ? "1" : "0") + " "); } }
public override void PressButtonP() { if (inputPathMode) { NextInputPath(); } else { if (inputPathCorrectnessMode) { NextInputPathCorrectness(); } else { inputCommandMode = false; inputInfoMode = false; inputPathMode = true; Klub_u.SetInfo("Номер пути = " + PathNumber.ToString() + " "); } } }
private void PressNumberButtonN(byte n) { if (inputInfoMode) { TrainParametrs[inputInfoParametr] = TrainParametrs[inputInfoParametr] * 10 + n; Klub_u.SetInfo(InputInfoParametrs[inputInfoParametr] + " - " + TrainParametrs[inputInfoParametr].ToString() + " "); } else if (inputPathMode) { PathNumber = (byte)(PathNumber * 10 + n); Klub_u.SetInfo("Номер пути = " + PathNumber.ToString() + " "); } else if (inputPathCorrectnessMode) { CorrectPath = n == 1; Klub_u.SetInfo("Признак правильности пути = " + (CorrectPath ? "1" : "0") + " "); } else { inputNumberTool.AddSimvol(n); } }
private void NextInputPathCorrectness() { inputPathCorrectnessMode = false; Klub_u.SetInfo(Info); Klub_u.SetPathNumber(PathNumber, CorrectPath); }