Exemplo n.º 1
0
 private void frmEditConfigurationAutoReplyBtn_Click(object sender, EventArgs e)
 {
     string filepath = string.Empty;
     if ((this.configFilePathVal.Text.Length == 0) || !File.Exists(this.configFilePathVal.Text))
     {
         filepath = clsGlobal.InstalledDirectory + @"\scripts\SiRFLiveAutomationSetupAutoReply.cfg";
     }
     else
     {
         filepath = this.configFilePathVal.Text;
     }
     frmAutoReply reply = new frmAutoReply();
     reply.AutoReplyConfigFilePath = filepath;
     reply.CommWindow = new CommunicationManager();
     reply.CommWindow.ReadAutoReplyData(filepath);
     reply.ShowDialog();
     this.loadConfigFile();
     reply.CommWindow.Dispose();
     reply.CommWindow = null;
     reply.Dispose();
     reply = null;
 }
Exemplo n.º 2
0
 private void frmEditConfigurationAutoReplyBtn_Click(object sender, EventArgs e)
 {
     string path = this._configFilePath;
     if (!File.Exists(path))
     {
         MessageBox.Show(string.Format("Configuration file not found!\n {0}", path), "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
     else
     {
         frmAutoReply reply = new frmAutoReply();
         reply.AutoReplyConfigFilePath = path;
         reply.CommWindow = new CommunicationManager();
         reply.CommWindow.ReadAutoReplyData(path);
         if (reply.ShowDialog() == DialogResult.Cancel)
         {
             reply.CommWindow.Dispose();
             reply.CommWindow = null;
             reply.Dispose();
             reply = null;
         }
         else
         {
             if (reply.CommWindow.AutoReplyCtrl.HWCfgCtrl.FreqAidEnabled == 0)
             {
                 this.frm3GPPConfigNoFreqReqRadioBtn.Checked = true;
             }
             else if (reply.CommWindow.AutoReplyCtrl.HWCfgCtrl.FreqAidMethod == 0)
             {
                 this.frm3GPPConfigCounterRadioBtn.Checked = true;
             }
             else
             {
                 this.frm3GPPConfigNonCounterRadioBtn.Checked = true;
             }
             if (this.frm3GPPConfigTest1ChkBox.Checked)
             {
                 this.frm3GPPConfigTest1RelFreqAccTxtBox.Text = reply.CommWindow.AutoReplyCtrl.FreqTransferCtrl.Accuracy.ToString();
                 this.frm3GPPConfigTest1HrzQoSTxtBox.Text = reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.HorrErrMax.ToString();
                 this.frm3GPPConfigTest1VrtQoSTxtBox.Text = reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.VertErrMax.ToString();
                 this.frm3GPPConfigTest1RespMaxTimeTxtBox.Text = reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.RespTimeMax.ToString();
                 if (reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority == 0)
                 {
                     this.frm3GPPConfigTest1PriorityTxtBox.Text = "No Priority";
                 }
                 else if (reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority == 1)
                 {
                     this.frm3GPPConfigTest1PriorityTxtBox.Text = "Response Time";
                 }
                 else if (reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority == 2)
                 {
                     this.frm3GPPConfigTest1PriorityTxtBox.Text = "Position Error";
                 }
                 else if (reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority == 3)
                 {
                     this.frm3GPPConfigTest1PriorityTxtBox.Text = "Use Entire Response Time";
                 }
                 else
                 {
                     this.frm3GPPConfigTest1PriorityTxtBox.Text = "Response Time";
                 }
             }
             if (this.frm3GPPConfigTest2ChkBox.Checked)
             {
                 this.frm3GPPConfigTest2RelFreqAccTxtBox.Text = reply.CommWindow.AutoReplyCtrl.FreqTransferCtrl.Accuracy.ToString();
                 this.frm3GPPConfigTest2HrzQoSTxtBox.Text = reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.HorrErrMax.ToString();
                 this.frm3GPPConfigTest2VrtQoSTxtBox.Text = reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.VertErrMax.ToString();
                 this.frm3GPPConfigTest2RespMaxTimeTxtBox.Text = reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.RespTimeMax.ToString();
                 if (reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority == 0)
                 {
                     this.frm3GPPConfigTest2PriorityTxtBox.Text = "No Priority";
                 }
                 else if (reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority == 1)
                 {
                     this.frm3GPPConfigTest2PriorityTxtBox.Text = "Response Time";
                 }
                 else if (reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority == 2)
                 {
                     this.frm3GPPConfigTest2PriorityTxtBox.Text = "Position Error";
                 }
                 else if (reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority == 3)
                 {
                     this.frm3GPPConfigTest2PriorityTxtBox.Text = "Use Entire Response Time";
                 }
                 else
                 {
                     this.frm3GPPConfigTest2PriorityTxtBox.Text = "Response Time";
                 }
             }
             if (this.frm3GPPConfigTest3ChkBox.Checked)
             {
                 this.frm3GPPConfigTest3RelFreqAccTxtBox.Text = reply.CommWindow.AutoReplyCtrl.FreqTransferCtrl.Accuracy.ToString();
                 this.frm3GPPConfigTest3HrzQoSTxtBox.Text = reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.HorrErrMax.ToString();
                 this.frm3GPPConfigTest3VrtQoSTxtBox.Text = reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.VertErrMax.ToString();
                 this.frm3GPPConfigTest3RespMaxTimeTxtBox.Text = reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.RespTimeMax.ToString();
                 if (reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority == 0)
                 {
                     this.frm3GPPConfigTest3PriorityTxtBox.Text = "No Priority";
                 }
                 else if (reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority == 1)
                 {
                     this.frm3GPPConfigTest3PriorityTxtBox.Text = "Response Time";
                 }
                 else if (reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority == 2)
                 {
                     this.frm3GPPConfigTest3PriorityTxtBox.Text = "Position Error";
                 }
                 else if (reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority == 3)
                 {
                     this.frm3GPPConfigTest3PriorityTxtBox.Text = "Use Entire Response Time";
                 }
                 else
                 {
                     this.frm3GPPConfigTest3PriorityTxtBox.Text = "Response Time";
                 }
             }
             if (this.frm3GPPConfigTest4ChkBox.Checked)
             {
                 this.frm3GPPConfigTest4RelFreqAccTxtBox.Text = reply.CommWindow.AutoReplyCtrl.FreqTransferCtrl.Accuracy.ToString();
                 this.frm3GPPConfigTest4HrzQoSTxtBox.Text = reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.HorrErrMax.ToString();
                 this.frm3GPPConfigTest4VrtQoSTxtBox.Text = reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.VertErrMax.ToString();
                 this.frm3GPPConfigTest4RespMaxTimeTxtBox.Text = reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.RespTimeMax.ToString();
                 if (reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority == 0)
                 {
                     this.frm3GPPConfigTest4PriorityTxtBox.Text = "No Priority";
                 }
                 else if (reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority == 1)
                 {
                     this.frm3GPPConfigTest4PriorityTxtBox.Text = "Response Time";
                 }
                 else if (reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority == 2)
                 {
                     this.frm3GPPConfigTest4PriorityTxtBox.Text = "Position Error";
                 }
                 else if (reply.CommWindow.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority == 3)
                 {
                     this.frm3GPPConfigTest4PriorityTxtBox.Text = "Use Entire Response Time";
                 }
                 else
                 {
                     this.frm3GPPConfigTest4PriorityTxtBox.Text = "Response Time";
                 }
             }
             reply.CommWindow.Dispose();
             reply.CommWindow = null;
             reply.Dispose();
             reply = null;
         }
     }
 }