BuffergasHardwareControl.ControlWindow.WriteToConsole C# (CSharp) Метод

WriteToConsole() публичный Метод

public WriteToConsole ( string text ) : void
text string
Результат void
        public void WriteToConsole(string text)
        {
            setRichTextBox(consoleRichTextBox, ">> " + text + "\n");
        }

Usage Example

Пример #1
0
        //  #region Saving and loading experimental parameters
        //   //Saving the parameters when closing the controller
        //  public void SaveParametersWithDialog()
        //  {
        //      SaveFileDialog saveFileDialog1 = new SaveFileDialog();
        //      saveFileDialog1.Filter = "shc parameters|*.bin";
        //      saveFileDialog1.Title = "Save parameters";
        //      saveFileDialog1.InitialDirectory = profilesPath;
        //      if (saveFileDialog1.ShowDialog() == DialogResult.OK)
        //      {
        //          if (saveFileDialog1.FileName != "")
        //          {
        //              StoreParameters(saveFileDialog1.FileName);
        //          }
        //      }
        //  }

        //private void StoreParameters(String dataStoreFilePath)
        //  {
        //      stateRecord = readValuesOnUI();
        //      BinaryFormatter s = new BinaryFormatter();
        //      FileStream fs = new FileStream(dataStoreFilePath, FileMode.Create);
        //     try
        //     {
        //          s.Serialize(fs, dataStore);
        //          s.Serialize(fs, stateRecord);
        //      }
        //      catch (Exception)
        //      {
        //          Console.Out.WriteLine("Saving failed");
        //      }
        //      finally
        //      {
        //          fs.Close();
        //          window.WriteToConsole("Saved parameters to " + dataStoreFilePath);
        //      }

        //  }

        //  Load parameters when opening the controller
        //  public void LoadParametersWithDialog()
        //  {
        //      OpenFileDialog dialog = new OpenFileDialog();
        //      dialog.Filter = "shc parameters|*.bin";
        //      dialog.Title = "Load parameters";
        //      dialog.InitialDirectory = profilesPath;
        //      dialog.ShowDialog();
        //      if (dialog.FileName != "") stateRecord = loadParameters(dialog.FileName);
        //      setValuesDisplayedOnUI(stateRecord);
        //  }


        //  #endregion

        #region Remoting stuff

        /// <summary>
        /// This is used when you want another program to take control of some/all of the hardware. The hc then just saves the
        /// last hardware state, then prevents you from making any changes to the UI. Use this if your other program wants direct control of hardware. In the buffer gas case this is only used for the camera at the moment.
        /// </summary>
        public void StartRemoteControl()
        {
            // if (HCState == SHCUIControlState.OFF)
            //{
            if (!ImageController.IsCameraFree())
            {
                StopCameraStream();
                window.WriteToConsole("Remoting Started!");
            }
            // StoreParameters(profilesPath + "tempParameters.bin");
            // HCState = SHCUIControlState.REMOTE;
            // window.UpdateUIState(HCState);

            //}
            else
            {
                MessageBox.Show("Controller is busy");
            }
        }