private void submit_OnClick(object sender, RoutedEventArgs e) { bool? fb = fileButton.IsChecked; bool? cb = cameraButton.IsChecked; bool fileChosen = false; bool cameraChosen = false; if (fb.HasValue) fileChosen = (bool) fb; if (cb.HasValue) cameraChosen = (bool)cb; if (fileChosen) machineInputSourceKind = MachineInputSourceKind.SourceFile; else if (cameraChosen) { machineInputSourceKind = MachineInputSourceKind.SourceWebcam; String text2 = cameraFrameRate.Text; String text = cameraNumberManual.Text; // The default value is zero, but could crash if there is no detectable camera. if (cameraList.IsEnabled) cameraNumber = cameraList.SelectedIndex; if (advancedSettingsVisible && text.Length > 0) cameraNumber = Int32.Parse(text); if (text2 == "") ; else cameraFps = Int32.Parse(text2); } bool? rd = resourceDisposal.IsChecked; if (rd.HasValue) resDisposal = (bool)rd; distance = (int) distanceThresholdSlider.Value; // Start the main window once all of the necessary parameters have been received. mainWindow = new MainWindow(trainMachine, faceIdentity, trainingName, GetCameraNumber(), GetCameraFrameRate(), GetResourceDisposal(), GetDistanceThresholdValue(), GetMachineInputSourceKind(), GetMainWindowTitle(), GetMachineStartPage(), GetUIKind()); mainWindow.Show(); initialized = true; // Close the input selection window. Close(); }
private void timerTick(object sender, EventArgs args) { if (creditsPart) { Tuple<int, int> tup = printNonCyclicText(credits, line, pos); line = tup.Item1; pos = tup.Item2; if (line >= credits.Length) { creditsPart = false; firstPart = true; line = 0; pos = 0; machineText.Text = ""; dispatchTimer.Interval = new TimeSpan(0, 0, 0, 0, 1); Thread.Sleep(500); } } else if (firstPart) { Tuple<int, int> tup = printNonCyclicText(systemBootPart1, line, pos); line = tup.Item1; pos = tup.Item2; if (line >= systemBootPart1.Length) { firstPart = false; secondPart = true; line = 0; pos = 0; machineText.Text = ""; } } else if (secondPart) { Tuple<int, int> tup = printNonCyclicText(systemBootPart2, line, pos); line = tup.Item1; pos = tup.Item2; if (line >= systemBootPart2.Length) { secondPart = false; thirdPart = true; line = 0; pos = 0; machineText.Text = ""; } } else if (thirdPart) { Tuple<int, int> tup = printCyclicText(systemBootPart3, line, pos); line = tup.Item1; pos = tup.Item2; } else if (fourthPart) { Tuple<int, int> tup = printCyclicText(systemBootPart4, line, pos); line = tup.Item1; pos = tup.Item2; } else dispatchTimer.Stop(); if (seekedAdmin && !initialWindowShown) { if (trainMachine) inputSelection = new InputSelection(trainMachine, false, "ADMIN", InputSelection.TrainTitle, machine.MainWindow.TrainTitle, FaceIdentity.FaceAdmin, this, uikind); else inputSelection = new InputSelection(trainMachine, true, "", InputSelection.ExecutionTitle, machine.MainWindow.ExecutionTitle, FaceIdentity.FaceNone, this, uikind); inputSelection.Show(); mainWindow = inputSelection.GetMainWindow(); seekedAdmin = false; initialWindowShown = true; } }