Esempio n. 1
0
 private void SetUIState(IOBitState state)
 {
     if (state == IOBitState.High)
     {
         labelState.Text      = "HI";
         labelState.BackColor = Color.Yellow;
         labelState.ForeColor = Color.Black;
     }
     else
     {
         labelState.Text      = "LO";
         labelState.BackColor = Color.Black;
         labelState.ForeColor = Color.Yellow;
     }
 }
Esempio n. 2
0
 private void checkBoxDirection_CheckedChanged(object sender, EventArgs e)
 {
     try {
         if (checkBoxDirection.Checked) {
             m_channel.SetChannelDirection(IODirection.Output);
             m_channel.WriteBit(State);
         }
         else {
             m_channel.SetChannelDirection(IODirection.Input);
             State = m_channel.ReadBit();
             SetUIState(State);
         }
     }
     catch { }
 }
Esempio n. 3
0
        internal void UpdateState(bool AITestDirection)
        {
            IODirection dir = m_channel.GetChannelDirection();
            if (AITestDirection) {
                //try{
                //     if (dir == IODirection.Input)
                //         m_channel.SetChannelDirection(IODirection.Output);
                //       else
                //         m_channel.SetChannelDirection(IODirection.Input);
                //     m_channel.SetChannelDirection(dir);
                // }
                //catch{
                //    checkBoxDirection.Enabled = false;
                //    if (dir == IODirection.Output)
                //        m_channel.WriteBit(State);
                //}
                if (m_channel.IsDirectionFixed()) {
                    checkBoxDirection.Enabled = false;

                }

            }
            if (dir == IODirection.Input)
                checkBoxDirection.Checked = false;
            else
                checkBoxDirection.Checked = true;
            if (!checkBoxDirection.Checked)
                State = m_channel.ReadBit();
            SetUIState(State);
        }
Esempio n. 4
0
 private void SwitchState()
 {
     if (State == IOBitState.Low)
         State = IOBitState.High;
     else
         State = IOBitState.Low;
 }
Esempio n. 5
0
 private void SetUIState(IOBitState state)
 {
     if (state == IOBitState.High) {
         labelState.Text = "HI";
         labelState.BackColor = Color.Yellow;
         labelState.ForeColor = Color.Black;
     }
     else {
         labelState.Text = "LO";
         labelState.BackColor = Color.Black;
         labelState.ForeColor = Color.Yellow;
     }
 }