private void FillRelays() { cmbRelayID.Items.Clear(); foreach (YRelay relay in CmdYocto.IterateRelays()) { cmbRelayID.Items.Add(relay.SAWName); } }
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); } }
public YoctoEditor() { m_Filling = true; InitializeComponent(); Strings.Translate(this); if (CmdYocto.RegisterYocto(false)) { FillRelays(); } m_Filling = false; }
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); }
public frmYocto() { InitializeComponent(); Strings.Translate(this); GUIUtilities.ScaleDPI(this); if (CmdYocto.RegisterYocto(false)) { FillList(); } lstRelays_SelectedIndexChanged(this, null); }
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); }
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; } }