Exemplo n.º 1
0
 /// <summary>
 /// メインウィンドウ終了イベント
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     try
     {
         myparts.myDialog dialog = new myparts.myDialog("全プロセスを終了します.");
         if (dialog.ShowDialog() == false)
         {
             e.Cancel = true;
         }
         if (e.Cancel == false)
         {
             this.serialport.Close();
         }
     }
     catch (Exception ex)
     {
         while (true)
         {
             myparts.myDialog dialog = new myparts.myDialog(ex.Message);
             if (dialog.ShowDialog() == true)
             {
                 break;
             }
         }
     }
 }
Exemplo n.º 2
0
        private void Button_PPMS_Serial_Connect_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                myparts.myDialog dlg = new myparts.myDialog("シリアルポートに接続します");
                if (dlg.ShowDialog() != true)
                {
                    return;
                }

                this.serialport          = new System.IO.Ports.SerialPort("COM" + this.TextBox_PPMS_COMPORT.Text, int.Parse(this.TextBox_PPMS_BaudRate.Text), System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.One);
                this.serialport.Encoding = Encoding.ASCII;

                byte[] endsign = { 170, 255 };
                this.serialport.NewLine = Encoding.ASCII.GetString(endsign, 0, 1);
                this.serialport.Open();

                this.fps = new FPSAdjuster.FPSAdjuster();
                fps.Fps  = int.Parse(this.TextBox_PPMS_FPS.Text);
                fps.Start();

                this.CTS      = new CancellationTokenSource();
                this.maintask = new Task(new Action(this.MainTask_PPMS), this.CTS.Token);
                this.maintask.Start();
            }
            catch (Exception ex)
            {
                myparts.myDialog dlg = new myparts.myDialog(ex.Message);
                dlg.ShowDialog();
            }
        }
 private void Button_Connect_Click(object sender, RoutedEventArgs e)
 {
     myparts.myDialog mydialog = new myparts.myDialog("接続を開始します");
     if (mydialog.ShowDialog() != true)
     {
         return;
     }
     this.StackPanel_ConnectSetting.IsEnabled = false;
     this.IsConnectSetuped = true;
     this.pushedtime = System.DateTime.Now.ToString();
     this.TabControl_CIPCConnection.SelectedIndex = 1;
     this.mainwindow.serverconnection.SetupUDP();
 }
Exemplo n.º 4
0
 private void Button_MKCL_Serial_Close_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         myparts.myDialog dlg = new myparts.myDialog("シリアルポートを切断します");
         if (dlg.ShowDialog() != true)
         {
             return;
         }
         this.CloseComport();
     }
     catch (Exception ex)
     {
         myparts.myDialog dlg = new myparts.myDialog(ex.Message);
         dlg.ShowDialog();
     }
 }
Exemplo n.º 5
0
 private void Button_MKCL_Serial_Close_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         myparts.myDialog dlg = new myparts.myDialog("シリアルポートを切断します");
         if (dlg.ShowDialog() != true)
         {
             return;
         }
         this.CloseComport();
     }
     catch (Exception ex)
     {
         myparts.myDialog dlg = new myparts.myDialog(ex.Message);
         dlg.ShowDialog();
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// 終了ボタンのクリックイベント
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Button_Close_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         this.Close();
     }
     catch (Exception ex)
     {
         while (true)
         {
             myparts.myDialog dialog = new myparts.myDialog(ex.Message);
             if (dialog.ShowDialog() == true)
             {
                 break;
             }
         }
     }
 }
Exemplo n.º 7
0
 private void Change_StatusBar_TextBlock(string text)
 {
     try
     {
         this.TextBlock_StatusCaption.Text = text;
     }
     catch (Exception ex)
     {
         while (true)
         {
             myparts.myDialog dialog = new myparts.myDialog(ex.Message);
             if (dialog.ShowDialog() == true)
             {
                 break;
             }
         }
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// 終了ボタンのクリックイベント
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Button_Close_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         this.Close();
     }
     catch (Exception ex)
     {
         while (true)
         {
             myparts.myDialog dialog = new myparts.myDialog(ex.Message);
             if (dialog.ShowDialog() == true)
             {
                 break;
             }
         }
     }
 }
Exemplo n.º 9
0
 private void Button_MKCL_Serial_Connect_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         myparts.myDialog dlg = new myparts.myDialog("シリアルポートに接続します");
         if (dlg.ShowDialog() != true)
         {
             return;
         }
         this.serialport          = new System.IO.Ports.SerialPort("COM" + this.TextBox_MKCL_COMPORT.Text, int.Parse(this.TextBox_MKCL_BaudRate.Text), System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.One);
         this.serialport.Encoding = Encoding.ASCII;
         this.serialport.Open();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Exemplo n.º 10
0
 public void start()
 {
     try
     {
         System.Diagnostics.Process[] CIPC = System.Diagnostics.Process.GetProcessesByName("CentralInterProcessCommunicationServer");
         if (CIPC.Length == 0)
         {
             System.Diagnostics.Process.Start(this.window.TextBox_Local_CIPCServerPath.Text);
         }
     }
     catch (Exception ex)
     {
         while (true)
         {
             myparts.myDialog mydialog = new myparts.myDialog(ex.Message);
             if (mydialog.ShowDialog() == true)
             {
                 break;
             }
         }
     }
 }
Exemplo n.º 11
0
 private void Button_Network_AddFolder_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         string FolderName;
         System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
         folderBrowserDialog1.Description = "公開するフォルダを選択してください.(注意:他人に公開されます.公序良俗に反するものや,個人情報の含まれるものは指定しないようにお気を付けください.)";
         if (folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             FolderName = folderBrowserDialog1.SelectedPath;
             this.AddFolderByPath(FolderName);
         }
     }
     catch (Exception ex)
     {
         myparts.myDialog dlg = new myparts.myDialog(ex.Message);
         dlg.ShowDialog();
     }
 }
Exemplo n.º 12
0
 /// <summary>
 /// statusbarの状態を変更する
 /// </summary>
 /// <param name="text"></param>
 public void Change_StatusBar_TextBlock(string text)
 {
     try
     {
         this.Dispatcher.BeginInvoke(new Action(() =>
         {
             this.TextBlock_StatusCaption.Text = text;
         }));
     }
     catch (Exception ex)
     {
         while (true)
         {
             myparts.myDialog dialog = new myparts.myDialog(ex.Message);
             if (dialog.ShowDialog() == true)
             {
                 break;
             }
         }
     }
 }
Exemplo n.º 13
0
 private void Change_StatusBar_TextBlock(string text)
 {
     try
     {
         this.TextBlock_StatusCaption.Text = text;
     }
     catch (Exception ex)
     {
         while (true)
         {
             myparts.myDialog dialog = new myparts.myDialog(ex.Message);
             if (dialog.ShowDialog() == true)
             {
                 break;
             }
         }
     }
 }
Exemplo n.º 14
0
        private void Button_PPMS_Serial_Connect_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                myparts.myDialog dlg = new myparts.myDialog("シリアルポートに接続します");
                if (dlg.ShowDialog() != true)
                {
                    return;
                }

                this.serialport = new System.IO.Ports.SerialPort("COM" + this.TextBox_PPMS_COMPORT.Text, int.Parse(this.TextBox_PPMS_BaudRate.Text), System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.One);
                this.serialport.Encoding = Encoding.ASCII;

                this.serialport.Open();

                this.fps = new FPSAdjuster.FPSAdjuster();
                fps.Fps = int.Parse( this.TextBox_PPMS_FPS.Text);
                fps.Start();

                this.CTS = new CancellationTokenSource();
                this.maintask = new Task(new Action(this.MainTask_PPMS), this.CTS.Token);
                this.maintask.Start();
            }
            catch (Exception ex)
            {
                myparts.myDialog dlg = new myparts.myDialog(ex.Message);
                dlg.ShowDialog();
            }
        }
Exemplo n.º 15
0
 private void Button_Test_Click(object sender, RoutedEventArgs e)
 {
     CIPCNetwork.Protocols.Message msg = new CIPCNetwork.Protocols.Message();
     msg.Header = CIPCNetwork.Protocols.Message.HeaderType.GetFileList;
     msg.Data = "asdasdasdasd";
     CIPCNetwork.Protocols.Message msg2 = CIPCNetwork.Protocols.Message.SetFromString(msg.ToString());
     myparts.myDialog mydialog = new myparts.myDialog(msg2.ToString());
     mydialog.ShowDialog();
 }
Exemplo n.º 16
0
        /// <summary>
        /// メインウィンドウ終了イベント
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            try
            {

                myparts.myDialog dialog = new myparts.myDialog("全プロセスを終了します.");
                if (dialog.ShowDialog() == false)
                {
                    e.Cancel = true;
                }
                if (e.Cancel == false)
                {
                    this.dispatchertimer.Stop();
                    this.Close_ChildWindows();
                    this.Dispose_Classes();
                }

            }
            catch (Exception ex)
            {
                while (true)
                {
                    myparts.myDialog dialog = new myparts.myDialog(ex.Message);
                    if (dialog.ShowDialog() == true)
                    {
                        break;
                    }
                }
            }
        }
Exemplo n.º 17
0
 private void Button_MKCL_Serial_Connect_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         myparts.myDialog dlg = new myparts.myDialog("シリアルポートに接続します");
         if (dlg.ShowDialog() != true)
         {
             return;
         }
         this.serialport = new System.IO.Ports.SerialPort("COM" + this.TextBox_MKCL_COMPORT.Text, int.Parse(this.TextBox_MKCL_BaudRate.Text), System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.One);
         this.serialport.Encoding = Encoding.ASCII;
         this.serialport.Open();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Exemplo n.º 18
0
 private void Button_StopConnect_Click(object sender, RoutedEventArgs e)
 {
     myparts.myDialog mydialog = new myparts.myDialog("接続を停止します");
     if (mydialog.ShowDialog() != true)
     {
         return;
     }
     this.StackPanel_ConnectSetting.IsEnabled = true;
     this.IsConnectSetuped = false;
     this.TabControl_CIPCConnection.SelectedIndex = 0;
     this.mainwindow.serverconnection.closeUDP();
 }
Exemplo n.º 19
0
        /// <summary>
        /// メインウィンドウ終了イベント
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            try
            {

                myparts.myDialog dialog = new myparts.myDialog("全プロセスを終了します.");
                if (dialog.ShowDialog() == false)
                {
                    e.Cancel = true;
                }
                if (e.Cancel == false)
                {
                    this.serialport.Close();
                }

            }
            catch (Exception ex)
            {
                while (true)
                {
                    myparts.myDialog dialog = new myparts.myDialog(ex.Message);
                    if (dialog.ShowDialog() == true)
                    {
                        break;
                    }
                }
            }
        }