Page 1 of 1

device.Setup()

Posted: Thu Oct 04, 2012 11:10 pm
by simp513
Setup Opens and closes imediatly.
If I comment out the _deviceManager.Devices.Current.Close(); and _deviceManager.Close(); it stays open until I close it....Problem is, I'm leaving the device open and I don't want to.
//Scanner Settings
_deviceManager.Open();
if (_deviceManager.Devices.Count > 0)
{
if (_deviceManager.Devices.Select())
{
// get reference to current device
_device = _deviceManager.Devices.Current;
_device.Open();
_device.Setup();

}

_deviceManager.Devices.Current.Close();
}
else
MessageBox.Show("No Compliant Devices!");
// close the device manager
_deviceManager.Close();

Re: device.Setup()

Posted: Fri Oct 05, 2012 8:11 am
by Alex
Hello,

Setup dialog can be shown only when device is opened. Setup dialog closes automatically when device closes.

Here is a step sequence which you need do for setup the device:
  • Call the Setup method
  • Change the device settings in the setup dialog
  • Close the setup dialog
  • Acquire image(s) from the device with or without UI if necessary
  • Close the device
Best regards, Alexander

Re: device.Setup()

Posted: Fri Oct 05, 2012 12:35 pm
by simp513
I understand But there is no event or way of knowing when the setup dialog is closed.

Re: device.Setup()

Posted: Fri Oct 05, 2012 3:46 pm
by Alex
I understand But there is no event or way of knowing when the setup dialog is closed.
You need to subscribe to the StateChanged event of the Device class if you want to know when device is closed.

Device is enabled when the setup dialog is opened, device is opened when the setup dialog is closed.

Best regards, Alexander