예제 #1
0
 /// <summary>
 /// Show media settings.
 /// </summary>
 private void MediaSettingsMnu_Click(object sender, EventArgs e)
 {
     try
     {
         if (media is GXNet)
         {
             (media as GXNet).ConfigurableSettings = Gurux.Net.AvailableMediaSettings.All & ~Gurux.Net.AvailableMediaSettings.Server;
         }
         else if (media is GXSerial)
         {
         }
         if (media.Properties(this))
         {
             if (media is GXNet)
             {
                 Settings.Default.PlcNetworkSettings = media.Settings;
             }
             else if (!Settings.Default.HdlcAddressUseOpticalProbe)
             {
                 Settings.Default.PlcSerialSettings = media.Settings;
             }
             UpdateStatus("Ready.");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #2
0
 /// <summary>
 /// Show Serial port settings.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void AdvancedBtn_Click(object sender, EventArgs e)
 {
     try
     {
         ((GXSerial)SelectedMedia).PortName = this.SerialPortCB.Text;
         if (SelectedMedia.Properties(this))
         {
             this.SerialPortCB.Text = ((GXSerial)SelectedMedia).PortName;
         }
     }
     catch (Exception Ex)
     {
         MessageBox.Show(this, Ex.Message, Properties.Resources.CTT, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }