Ejemplo n.º 1
0
        private void SearchDevices()
        {
            long deviceNum = 0L;

            Cursor = Cursors.WaitCursor;
            try
            {
                deviceNum            = K8055DLLWrapper.SearchDevices();
                checkBoxDev0.Checked = (deviceNum & 1L) != 0L;
                checkBoxDev1.Checked = (deviceNum & 2L) != 0L;
                checkBoxDev2.Checked = (deviceNum & 4L) != 0L;
                checkBoxDev3.Checked = (deviceNum & 8L) != 0L;
            }
            finally
            {
                Cursor = Cursors.Default;
            }
            if ((deviceNum & 15L) == 0L)
            {
                //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
                MessageBoxForm.msgIcon = SystemIcons.Exclamation;                 //this is used if you want to add a system icon to the message form.
                var messageBox = new MessageBoxForm("No devices were found.", "Vixen", false, false);
                messageBox.ShowDialog();
            }
        }
Ejemplo n.º 2
0
 public override void UpdateState(int chainIndex, ICommand[] outputStates)
 {
     for (int i = 0; i < 4; i++)
     {
         if (_Data.Modules[i].Enabled)
         {
             _commandHandler.Reset();
             int      start   = _Data.Modules[i].StartChannel - _Offset;
             int      end     = Math.Min(start + 8, outputStates.Length);
             byte     data    = 0;
             ICommand command = outputStates[start++];
             if (command != null)
             {
                 while (start < end)
                 {
                     data >>= 1;
                     if (_commandHandler.Value > 0)
                     {
                         data |= (byte)0x80;
                     }
                     else
                     {
                         data |= (byte)0;
                     }
                 }
             }
             else
             {
                 data >>= 1;
                 data  |= (byte)0;
             }
             K8055DLLWrapper.Write(i, (long)data);
         }
     }
 }
Ejemplo n.º 3
0
 public override void Stop()
 {
     for (int i = 0; i < 4; i++)
     {
         if (_Data.Modules[i].Enabled)
         {
             K8055DLLWrapper.Close(i);
         }
     }
     base.Stop();
 }
Ejemplo n.º 4
0
        public override void Start()
        {
            long numdevices = K8055DLLWrapper.SearchDevices();

            for (int i = 0; i < 4; i++)
            {
                _Data.Modules[i].Enabled = (numdevices & (((int)1) << i)) != 0L;
                if (_Data.Modules[i].Enabled)
                {
                    K8055DLLWrapper.Open(i);
                }
            }
            base.Start();
        }
Ejemplo n.º 5
0
        private void SearchDevices()
        {
            long deviceNum = 0L;

            Cursor = Cursors.WaitCursor;
            try
            {
                deviceNum            = K8055DLLWrapper.SearchDevices();
                checkBoxDev0.Checked = (deviceNum & 1L) != 0L;
                checkBoxDev1.Checked = (deviceNum & 2L) != 0L;
                checkBoxDev2.Checked = (deviceNum & 4L) != 0L;
                checkBoxDev3.Checked = (deviceNum & 8L) != 0L;
            }
            finally
            {
                Cursor = Cursors.Default;
            }
            if ((deviceNum & 15L) == 0L)
            {
                MessageBox.Show("No devices were found.", "Vixen", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Ejemplo n.º 6
0
 private void driverVersionButton_Click(object sender, EventArgs e)
 {
     K8055DLLWrapper.Version();
 }