コード例 #1
0
 public TextFileMonitor(Form1 mainForm, string filename, DelegateAddString addStringFunc, int timeout, long maxBytes)
 {
     mMainForm       = mainForm; // reference to main form so we can invoke our add string delegate
     mAddStringFunc  = addStringFunc;
     mFilename       = filename;
     mSleepTimeout   = timeout;
     mMaxBytesToLoad = maxBytes;
 }
コード例 #2
0
 public TextFileMonitor(Form1 mainForm, string filename, DelegateAddString addStringFunc, int timeout, long maxBytes)
 {
     mMainForm = mainForm;  // reference to main form so we can invoke our add string delegate
     mAddStringFunc = addStringFunc;
     mFilename = filename;
     mSleepTimeout = timeout;
     mMaxBytesToLoad = maxBytes;
 }
コード例 #3
0
        // ...

        public MainForm()
        {
            InitializeComponent();

            // Initialize delegates
            m_DelegateAddString      = new DelegateAddString(this.AddString);
            m_DelegateThreadFinished = new DelegateThreadFinished(this.ThreadFinished);

            // Initialize events
            m_EventStopThread    = new ManualResetEvent(false);
            m_EventThreadStopped = new ManualResetEvent(false);
        }
コード例 #4
0
        public MainForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            // initialize delegates
            m_DelegateAddString      = new DelegateAddString(this.AddString);
            m_DelegateThreadFinished = new DelegateThreadFinished(this.ThreadFinished);

            // initialize events
            m_EventStopThread    = new ManualResetEvent(false);
            m_EventThreadStopped = new ManualResetEvent(false);
        }
コード例 #5
0
ファイル: ConverterForm.cs プロジェクト: kbogatyrev/Zal
        public ConverterForm()
        {
            InitializeComponent();

            this.StartPosition = FormStartPosition.CenterScreen;

            sm_Event = new AutoResetEvent(false);

            m_DelegateAddString         = new DelegateAddString(this.AddString);
            m_DelegateUpdateProgressbar = new DelegateUpdateProgressBar(this.UpdateProgressBar);
            m_DelegateShowCurrentWord   = new DelegateShowCurrentWord(this.ShowCurrentWord);
            m_DelegateSignalCompletion  = new DelegateSignalCompletion(this.OnConversionEnd);

            buttonOK.Enabled = false;

            if (numericUpDownStopAfter.Enabled)
            {
                m_iStopAfter = (int)numericUpDownStopAfter.Value;
            }
            else
            {
                m_iStopAfter = -1;
            }

            m_iSelectedTab     = tabControl.SelectedIndex;
            m_bSaveTempData    = false;
            m_bTextBoxOverflow = false;

            textBoxSourcePath.Text      = Properties.Settings.Default.SourcePath;
            textBoxDbLocation.Text      = Properties.Settings.Default.DbPath;
            textBoxLogPath.Text         = Properties.Settings.Default.LogPath;
            textBoxUnprocessedPath.Text = Properties.Settings.Default.UnprocessedPath;
            textBoxSearchSource.Text    = Properties.Settings.Default.SearchSourcePath;
            textBoxSearchLog.Text       = Properties.Settings.Default.SearchLogPath;
            textBoxSearchString.Text    = Properties.Settings.Default.SearchString;
        }
コード例 #6
0
        public ConverterForm()
        {
            InitializeComponent();

            this.StartPosition = FormStartPosition.CenterScreen;

            sm_Event = new AutoResetEvent (false);

            m_DelegateAddString = new DelegateAddString (this.AddString);
            m_DelegateUpdateProgressbar = new DelegateUpdateProgressBar (this.UpdateProgressBar);
            m_DelegateShowCurrentWord = new DelegateShowCurrentWord (this.ShowCurrentWord);
            m_DelegateSignalCompletion = new DelegateSignalCompletion (this.OnConversionEnd);

            buttonOK.Enabled = false;

            if (numericUpDownStopAfter.Enabled)
            {
                m_iStopAfter = (int)numericUpDownStopAfter.Value;
            }
            else
            {
                m_iStopAfter = -1;
            }

            m_iSelectedTab = tabControl.SelectedIndex;
            m_bSaveTempData = false;
            m_bTextBoxOverflow = false;

            textBoxSourcePath.Text = Properties.Settings.Default.SourcePath;
            textBoxDbLocation.Text = Properties.Settings.Default.DbPath;
            textBoxLogPath.Text = Properties.Settings.Default.LogPath;
            textBoxUnprocessedPath.Text = Properties.Settings.Default.UnprocessedPath;
            textBoxSearchSource.Text = Properties.Settings.Default.SearchSourcePath;
            textBoxSearchLog.Text = Properties.Settings.Default.SearchLogPath;
            textBoxSearchString.Text = Properties.Settings.Default.SearchString;
        }
コード例 #7
0
ファイル: Form_Main.cs プロジェクト: salih18200/orcs
        //CONSOLE
        /////////////
        public Robot1()
        {
            //ACCELEROMETER
            this.usrCtrlAxis2D = new UsrCtrlAxis2D();
            this.usrCtrlAxis2D.Size = new Size(350, 350);
            this.usrCtrlAxis2D.Location = new Point(0, 0);
            this.usrCtrlAxis2D.BackColor = Color.AliceBlue;
            //this.tabPage19.Controls.Add(this.usrCtrlAxis2D);

            InitializeComponent();

            batt.aktualne_nap = 0.1f; //initial value for battery monitor
            SetMap();
            Robot1.CheckForIllegalCrossThreadCalls = false;
            comboBox1.SelectedItem = "nothing";
            comboBox2.SelectedItem = "nothing";
            comboBox3.SelectedItem = "nothing";
            comboBox4.SelectedItem = "nothing";
            comboBox5.SelectedItem = "nothing";
            comboBox6.SelectedItem = "nothing";
            comboBox7.SelectedItem = "nothing";
            comboBox8.SelectedItem = "nothing";
            comboBox9.SelectedItem = "nothing";
            comboBox10.SelectedItem = "nothing";
            //Trajectory activation
            button12.Enabled = true;
            button14.Enabled = false;
            button17.Enabled = false;
            button13.Enabled = false;
            button18.Enabled = false;
            button15.Enabled = false;
            //Audio stream
            foreach (IPAddress ip in System.Net.Dns.GetHostAddresses(""))
            {
                m_pLocalIP.Items.Add(ip.ToString());
            }
            m_pLocalIP.SelectedIndex = m_pLocalIP.Items.Count-2;
            //m_pLocalIP.SelectedIndex = 0;
            m_pCodec.Items.Add("G711 a-law");
            m_pCodec.Items.Add("G711 u-law");
            m_pCodec.Enabled = false;
            LoadWaveDevices();
            m_pActiveCodec = new PCMA();
            //Bootloader
            comboBoxport.SelectedIndex = 0;
            comboBoxMCU.SelectedIndex = 0;
            //Inicialize TCP Client
            groupDirectionAndMotion.Enabled = false;
            groupCameraRotation.Enabled = false;
            groupCameraRot2.Enabled = false;
            groupComPortSettings.Enabled = false;
            groupComPortDefault.Enabled = false;
            groupTcpClientServerSettings.Enabled = true;
            groupTcpClientServerDefault.Enabled = true;
            textTCPClientServerIPAddress.ReadOnly = false;
            textTCPCommunicationType.Text = "CLIENT";
            labelCommunicationType.Text = "TCP Client";
            toolStripconnect.Enabled = true;
            ThreadCheckStat = new Thread(CheckStatus);
            ThreadCheckStat.Start();
            //Small Cam
            o = new Options();
            combo_streams.SelectedText = "1";
            //AUDIO DELEGATE
            m_DelegateAddString = new DelegateAddString(this.AddString);
            m_DelegateAddString1 = new DelegateAddString1(this.AddString1);

            //ACCELEROMETER
            //this.usrCtrlAxis3D = new UsrCtrlAxis3D();
            //this.usrCtrlAxis3D.Size = new Size(350, 350);
            //this.usrCtrlAxis3D.Location = new Point(0, 0);
            //this.Controls.Add(this.usrCtrlAxis3D);
            this.mySerialPort = new SerialPort("COM4", 9600, Parity.None, 8, StopBits.One);
            this.mySerialPort.Handshake = Handshake.None;
            this.mySerialPort.RtsEnable = true;
            this.mySerialPort.DataReceived += new SerialDataReceivedEventHandler(MySerialPort_DataReceived);
        }
コード例 #8
0
ファイル: Form_Main.cs プロジェクト: salih18200/orcs
        public Robot1()
        {
            //ACCELEROMETER
            this.usrCtrlAxis2D = new UsrCtrlAxis2D();
            this.usrCtrlAxis2D.Size = new Size(350, 350);
            this.usrCtrlAxis2D.Location = new Point(0, 0);
            this.usrCtrlAxis2D.BackColor = Color.AliceBlue;
            this.usrCtrlAxis3D = new UsrCtrlAxis3D();
            this.usrCtrlAxis3D.Size = new Size(350, 350);
            this.usrCtrlAxis3D.Location = new Point(0, 0);

            InitializeComponent();

            //VERSION UPDATE PUBLISH
            Version version2 = new Version();
            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                System.Deployment.Application.ApplicationDeployment ad = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                version2 = ad.CurrentVersion;
            }

            //VERSION UPDATE BUILD
            Version vrs = new Version(Application.ProductVersion);
            this.Text = "CONTROL APPLICATION  ORCS ROBOT G4 (SECURITY GUARD ROBOT) / AssemblyBuid " + vrs.Major + "." + vrs.Minor + "." + vrs.Build + "." + vrs.Revision + " / Publish Version ClickOnce " + PublishVersion().ToString() + " / RC" + version2.Revision.ToString(); //String.Format("ClickOnce Version {0}.{1}.{2}.{3}", version.Major, version.Minor, version.Revision, version.Build);

            //BATTERY
            batt.aktualne_nap = 0.1f; //initial value for battery monitor
            SetMap();
            Robot1.CheckForIllegalCrossThreadCalls = false;
            comboBox1.SelectedItem = "nothing";
            comboBox2.SelectedItem = "nothing";
            comboBox3.SelectedItem = "nothing";
            comboBox4.SelectedItem = "nothing";
            comboBox5.SelectedItem = "nothing";
            comboBox6.SelectedItem = "nothing";
            comboBox7.SelectedItem = "nothing";
            comboBox8.SelectedItem = "nothing";
            comboBox9.SelectedItem = "nothing";
            comboBox10.SelectedItem = "nothing";
            //Trajectory activation
            button12.Enabled = true;
            button14.Enabled = false;
            button17.Enabled = false;
            button13.Enabled = false;
            button18.Enabled = false;
            button15.Enabled = false;
            //Audio stream
            foreach (IPAddress ip in System.Net.Dns.GetHostAddresses(""))
            {
                m_pLocalIP.Items.Add(ip.ToString());
            }
            m_pLocalIP.SelectedIndex = m_pLocalIP.Items.Count-2;
            //m_pLocalIP.SelectedIndex = 0;
            m_pCodec.Items.Add("G711 a-law");
            m_pCodec.Items.Add("G711 u-law");
            m_pCodec.Enabled = false;
            LoadWaveDevices();
            m_pActiveCodec = new PCMA();
            //Bootloader
            comboBoxport.SelectedIndex = 0;
            comboBoxMCU.SelectedIndex = 0;
            //Inicialize TCP Client
            groupDirectionAndMotion.Enabled = false;
            groupCameraRotation.Enabled = false;
            groupCameraRot2.Enabled = false;
            textTCPClientServerIPAddress.ReadOnly = false;
            textTCPCommunicationType.Text = "CLIENT";
            labelCommunicationType.Text = "TCP Client";
            toolStripconnect.Enabled = true;
            ThreadCheckStat = new Thread(CheckStatus);
            ThreadCheckStat.Start();
            //Small Cam
            o = new Options();
            combo_streams.SelectedText = "1";
            //AUDIO DELEGATE
            m_DelegateAddString = new DelegateAddString(this.AddString);
            m_DelegateAddString1 = new DelegateAddString1(this.AddString1);

            //ACCELEROMETER
            //this.usrCtrlAxis3D = new UsrCtrlAxis3D();
            //this.usrCtrlAxis3D.Size = new Size(350, 350);
            //this.usrCtrlAxis3D.Location = new Point(0, 0);
            //this.Controls.Add(this.usrCtrlAxis3D);
            this.panelMEMS.Controls.Add(this.usrCtrlAxis2D);
            this.panelMEMS.Controls.Add(this.usrCtrlAxis3D);
            CreateGraph(); //MEMS Create Graph

            this.mySerialPort = new SerialPort("COM5", 9600, Parity.None, 8, StopBits.One);
            this.mySerialPort.Handshake = Handshake.None;
            this.mySerialPort.RtsEnable = true;
            this.mySerialPort.DataReceived += new SerialDataReceivedEventHandler(MySerialPort_DataReceived);

            //GPS
            GPS.GPSFileLogCreate();
        }
コード例 #9
0
ファイル: Form1.cs プロジェクト: KevinABoucher/Quail
        private void MonitorFile(string fileName)
        {
            mFileName = fileName;

              if (File.Exists(mFileName))
              {
            mruMenu.AddFile(mFileName); // add file to MRU list
            mruMenu.SaveToRegistry();
              }

              if (mThread != null)
              {
            // Request that mThread be stopped
            mThread.Abort();

            // Wait until mThread finishes.
            mThread.Join(1000);
              }

              ClearLog();

              mDelegateAddString = AddString;
              Text = "Quail - " + fileName;

              mMonitor = new TextFileMonitor(this, fileName, mDelegateAddString, mTailTimeout, mMaxBytesToLoad);
              mThread = new Thread(mMonitor.DoTail);
              mThread.Start();
        }