Ejemplo n.º 1
0
        private void loadValues()
        {
            string strRoutineName = "loadValues";

            try
            {
                SPORTSlave sSport = sSportList.ElementAt(editIndex);
                if (sSport != null)
                {
                    ucsSPORT.txtSlaveNum.Text        = sSport.SlaveNum;
                    ucsSPORT.cmbPortNo.SelectedIndex = ucsSPORT.cmbPortNo.FindStringExact(sSport.PortNum);
                    //Ajay: 27/08/2018
                    //ucsSPORT.txtSPORTType.Text = sSport.SportType;
                    ucsSPORT.cmbSportType.SelectedIndex = ucsSPORT.cmbSportType.FindStringExact(sSport.SportType);
                    ucsSPORT.txtASDUaddress.Text        = sSport.ASDUAddress;
                    ucsSPORT.cmbIOASize.SelectedIndex   = ucsSPORT.cmbIOASize.FindStringExact(sSport.IOASize);
                    ucsSPORT.txtEventQSize.Text         = sSport.EventQSize;
                    ucsSPORT.txtFirmwareVersion.Text    = sSport.AppFirmwareVersion;
                    ucsSPORT.cmbDebug.SelectedIndex     = ucsSPORT.cmbDebug.FindStringExact(sSport.DEBUG);
                    //Ajay: 31/08/2018
                    if (sSport.Event.ToLower() == "yes")
                    {
                        ucsSPORT.chkbxEvent.Checked = true;
                    }
                    else
                    {
                        ucsSPORT.chkbxEvent.Checked = false;
                    }
                    //Ajay: 31/08/2018
                    if (sSport.Run.ToLower() == "yes")
                    {
                        ucsSPORT.chkRun.Checked = true;
                    }
                    else
                    {
                        ucsSPORT.chkRun.Checked = false;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
        private void fillOptions()
        {
            string strRoutineName = "fillOptions";

            try
            {
                ucsSPORT.cmbPortNo.Items.Clear();
                foreach (String br in SPORTSlave.getPortNo())
                {
                    ucsSPORT.cmbPortNo.Items.Add(br.ToString());
                }
                ucsSPORT.cmbPortNo.SelectedIndex = 0;

                //Fill IOA size...
                ucsSPORT.cmbIOASize.Items.Clear();
                foreach (String ioa in SPORTSlave.getIOAsizes())
                {
                    ucsSPORT.cmbIOASize.Items.Add(ioa.ToString());
                }
                ucsSPORT.cmbIOASize.SelectedIndex = 0;

                //Fill Debug levels...
                ucsSPORT.cmbDebug.Items.Clear();
                for (int i = 1; i <= Globals.MAX_DEBUG_LEVEL; i++)
                {
                    ucsSPORT.cmbDebug.Items.Add(i.ToString());
                }
                ucsSPORT.cmbDebug.SelectedIndex = 0;
                //Ajay: 27/08/2018  Fill Sport Type...
                ucsSPORT.cmbSportType.Items.Clear();
                foreach (String st in SPORTSlave.getSportTypes())
                {
                    ucsSPORT.cmbSportType.Items.Add(st.ToString());
                }
                if (ucsSPORT.cmbSportType.Items.Count > 0)
                {
                    ucsSPORT.cmbSportType.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }