Beispiel #1
0
 private void FillRelays()
 {
     cmbRelayID.Items.Clear();
     foreach (YRelay relay in CmdYocto.IterateRelays())
     {
         cmbRelayID.Items.Add(relay.SAWName);
     }
 }
Beispiel #2
0
 private void FillList()
 {
     lstRelays.Items.Clear();
     m_Relays = new List <YRelay>();
     foreach (YRelay relay in CmdYocto.IterateRelays())
     {
         m_Relays.Add(relay);
         lstRelays.Items.Add(relay.FriendlyName);
     }
 }
Beispiel #3
0
 public YoctoEditor()
 {
     m_Filling = true;
     InitializeComponent();
     Strings.Translate(this);
     if (CmdYocto.RegisterYocto(false))
     {
         FillRelays();
     }
     m_Filling = false;
 }
Beispiel #4
0
 public string GetValidationError()
 {
     if (CmdYocto.CommandUsesTime(m_Command.Command) && !txtDuration.IsValidAndNotEmpty)
     {
         return("[Script_Error_BadYoctoTime]");
     }
     if (rdoSingle.Checked && string.IsNullOrWhiteSpace(cmbRelayID.Text))
     {
         return("[Script_Error_YoctoIDEmpty]");
     }
     return(null);
 }
Beispiel #5
0
        public frmYocto()
        {
            InitializeComponent();
            Strings.Translate(this);
            GUIUtilities.ScaleDPI(this);

            if (CmdYocto.RegisterYocto(false))
            {
                FillList();
            }
            lstRelays_SelectedIndexChanged(this, null);
        }
Beispiel #6
0
        private void ChangedID()
        {         // called when any of the controls which can specify the ID has changed value
            string id = rdoAll.Checked ? CmdYocto.ALLID : cmbRelayID.Text;

            lblRelayNotFound.Visible = rdoSingle.Checked && !CmdYocto.FindRelay(id).Any();
            if (m_Filling)
            {
                return;
            }
            m_Command.RelayID = id;
            m_Command.UpdateParams();
            UserChanged?.Invoke(this, EventArgs.Empty);
        }
Beispiel #7
0
 private void FillUI()
 {
     m_Filling = true;
     try
     {
         rdoAll.Checked    = m_Command.IsAll;
         rdoSingle.Checked = !m_Command.IsAll;
         if (!m_Command.IsAll)
         {
             cmbRelayID.Text = m_Command.RelayID;
         }
         cmbAction.SelectedIndex = (int)m_Command.Command;
         if (CmdYocto.CommandUsesTime(m_Command.Command))
         {
             txtDuration.Value = m_Command.Millisecond;
         }
         else
         {
             txtDuration.Value = 1000;
         }
     }
     finally { m_Filling = false; }
 }