Ejemplo n.º 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            // Display library version
            textBoxInfo.Text = string.Concat("Using Quantis library version ", Quantis.GetLibVersion(), Environment.NewLine);

            // Count Quantis devices
            int countPci = Quantis.Count(QuantisDeviceType.QUANTIS_DEVICE_PCI);
            int countUsb = Quantis.Count(QuantisDeviceType.QUANTIS_DEVICE_USB);

            textBoxInfo.Text += string.Concat("Found: ", Environment.NewLine);
            textBoxInfo.Text += string.Concat("   - ", countPci, " Quantis PCI/PCIe", Environment.NewLine);
            textBoxInfo.Text += string.Concat("   - ", countUsb, " Quantis USB", Environment.NewLine);
            textBoxInfo.Text += Environment.NewLine;

            // Select first available device
            // Note that in a real application, it would be better to let the user choose the device he wants to use...
            if (countPci > 0)
            {
                deviceType        = QuantisDeviceType.QUANTIS_DEVICE_PCI;
                deviceNumber      = 0;
                textBoxInfo.Text += string.Concat("Using PCI card #", deviceNumber, Environment.NewLine);
            }
            else if (countUsb > 0)
            {
                deviceType        = QuantisDeviceType.QUANTIS_DEVICE_USB;
                deviceNumber      = 0;
                textBoxInfo.Text += string.Concat("Using USB device #", deviceNumber, Environment.NewLine);
            }
            else
            {
                textBoxInfo.Text     = string.Concat("ERROR: No Quantis found!", Environment.NewLine);
                groupBoxData.Enabled = false;
                return;
            }

            // Display information about used device
            try
            {
                Quantis quantis = new Quantis(deviceType, deviceNumber);
                textBoxInfo.Text += string.Concat("   core version:  ", quantis.GetBoardVersion().ToString("X"), Environment.NewLine);
                textBoxInfo.Text += string.Concat("   serial number: ", quantis.GetSerialNumber(), Environment.NewLine);
                textBoxInfo.Text += string.Concat("   manufacturer: ", quantis.GetManufacturer(), Environment.NewLine);
            }
            catch (QuantisException ex)
            {
                textBoxInfo.Text += string.Concat("ERROR while retrieving Quantis information: ", ex.Message, Environment.NewLine);
            }
        }
Ejemplo n.º 2
0
 private static extern int QuantisReadFloat_01(QuantisDeviceType deviceType,
                                               uint deviceNumber,
                                               out float data);
Ejemplo n.º 3
0
 private static extern int QuantisReadScaledDouble(QuantisDeviceType deviceType,
                                                   uint deviceNumber,
                                                   out double data,
                                                   double min,
                                                   double max);
Ejemplo n.º 4
0
 private static extern int QuantisReadDouble_01(QuantisDeviceType deviceType,
                                                uint deviceNumber,
                                                out double data);
Ejemplo n.º 5
0
 private static extern int QuantisRead(QuantisDeviceType deviceType,
                                       uint deviceNumber,
                                       byte[] data,
                                       IntPtr size);
Ejemplo n.º 6
0
 private static extern int QuantisModulesReset(QuantisDeviceType deviceType,
                                               uint deviceNumber,
                                               int modulesMask);
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the Quantis class to access the specified device.
 /// </summary>
 /// <param name="deviceType">The type of Quantis device.</param>
 /// <param name="deviceNumber">The Quantis device number. Note that first device is 0.</param>
 public Quantis(QuantisDeviceType deviceType, uint deviceNumber)
 {
     this.deviceType   = deviceType;
     this.deviceNumber = deviceNumber;
 }
Ejemplo n.º 8
0
 private static extern int QuantisReadShort(QuantisDeviceType deviceType,
                                            uint deviceNumber,
                                            out short data);
Ejemplo n.º 9
0
 private static extern IntPtr QuantisGetManufacturer(QuantisDeviceType deviceType,
                                                     uint deviceNumber);
Ejemplo n.º 10
0
 private static extern float QuantisGetDriverVersion(QuantisDeviceType deviceType);
Ejemplo n.º 11
0
 private static extern int QuantisGetBoardVersion(QuantisDeviceType deviceType,
                                                  uint deviceNumber);
Ejemplo n.º 12
0
 private static extern int QuantisCount(QuantisDeviceType deviceType);
Ejemplo n.º 13
0
 private static extern int QuantisBoardReset(QuantisDeviceType deviceType,
                                             uint deviceNumber);
Ejemplo n.º 14
0
 /// <summary>
 /// Returns the number of specific Quantis type devices that have been detected on the system.
 /// </summary>
 /// <param name="deviceType">The type of Quantis device.</param>
 /// <returns>The number of Quantis devices that have been detected on the system.</returns>
 /// <remarks>If an error occurred while counting the devices, 0 is returned.</remarks>
 public static int Count(QuantisDeviceType deviceType)
 {
     return(QuantisCount(deviceType));
 }
Ejemplo n.º 15
0
 private static extern int QuantisReadScaledFloat(QuantisDeviceType deviceType,
                                                  uint deviceNumber,
                                                  out float data,
                                                  float min,
                                                  float max);
Ejemplo n.º 16
0
 private static extern int QuantisReadScaledInt(QuantisDeviceType deviceType,
                                                uint deviceNumber,
                                                out int data,
                                                int min,
                                                int max);
Ejemplo n.º 17
0
 private static extern int QuantisGetModulesStatus(QuantisDeviceType deviceType,
                                                   uint deviceNumber);
Ejemplo n.º 18
0
 private static extern int QuantisReadScaledShort(QuantisDeviceType deviceType,
                                                  uint deviceNumber,
                                                  out short data,
                                                  short min,
                                                  short max);
Ejemplo n.º 19
0
 private static extern IntPtr QuantisGetSerialNumber(QuantisDeviceType deviceType,
                                                     uint deviceNumber);