5 Replies Latest reply on May 29, 2015 6:50 AM by Harry Simpson

    selecting the device without selecting it from the Select dialog?

    Harry Simpson

      When I use the standard forms Select dialog it loads up the imager b/w and the camera color as choices in the dialog.  For the life of me I can't figure out how to skip this dialog and just use the camera by default.

       

      Also I don't get any intellisense for the Symbol objects - is this normal?

       

      Thanks

      Harry

        • Re: selecting the device without selecting it from the Select dialog?
          Yordan Stoyanov

          Try this

          Device[] automaticSelectDevice;

          if (Symbol.Barcode.Device.AvailableDevices.Length > 0)

          {

             //always use first available device

             automaticSelectDevice = new Device[1] { Symbol.Barcode.Device.AvailableDevices[0] };

           

          Symbol.Generic.Device MyDevice =

               Symbol.StandardForms.SelectDevice.Select(

               Symbol.Barcode.Device.Title,

               automaticSelectDevice);

          }

            • Re: selecting the device without selecting it from the Select dialog?
              Harry Simpson

              Thanks Yordan,

               

               

                 //always use first available device  --I actually want to choose the second device – I want to use the Color camera imager

               

                 automaticSelectDevice = new Device[1] { Symbol.Barcode.Device.AvailableDevices[0] };

               

              Tried to translate this into VB.NET but I’m missing something:

               

                          If (imager Is Nothing) Then

                              Dim MyDevice As Symbol.Imaging.Device()

               

                              If Symbol.Imaging.Device.AvailableDevices.Length > 0 Then

                                  'always use second available device

               

                                  MyDevice = New Symbol.Imaging.Device(1)(Symbol.Imaging.Device.AvailableDevices(1))

                                      ‘Getting error “Symbol.Generic.Device cannot be converted to 1-dimensional array of Symbol.Imaging.Device”

               

               

                              End If

               

               

                              MyDevice = Symbol.StandardForms.SelectDevice.Select(Symbol.Imaging.Device.Title, MyDevice)

                              imager = New Symbol.Imaging.Imager(MyDevice)

                          End If

               

              Can you see what I’m loosing in  the translation here?

               

              Thanks

               

              Harry Simpson

              Sr. Developer

              MAPCO Express / Delek US Holdings, Inc.

              318 Seaboard Lane

              Suite 101

              Franklin, TN 37067

              615-224-7836

                • Re: selecting the device without selecting it from the Select dialog?
                  Yordan Stoyanov

                  I am not sure that work, vb is not my language.

                   

                  Dim automaticSelectDevice(1) As Symbol.Barcode.Device

                  If Symbol.Barcode.Device.AvailableDevices.Length > 0 Then

                        automaticSelectDevice(0) = Symbol.Barcode.Device.AvailableDevices(1)

                   

                        Dim MyDevice As Symbol.Generic.Device

                   

                        MyDevice = Symbol.StandardForms.SelectDevice.Select(Symbol.Barcode.Device.Title, automaticSelectDevice)

                  End If

                    • Re: selecting the device without selecting it from the Select dialog?
                      Harry Simpson

                      If I could understand the Imaging vs Barcode vs Generic and when to properly use them – I want to use the "Image Capture Driver for Color Camera"

                       

                       

                      Dim automaticSelectDevice(1) As Symbol.Barcode.Device

                      If Symbol.Barcode.Device.AvailableDevices.Length > 0 Then

                            automaticSelectDevice(0) = Symbol.Barcode.Device.AvailableDevices(1)

                            Dim MyDevice As Symbol.Generic.Device

                            MyDevice = Symbol.StandardForms.SelectDevice.Select(Symbol.Barcode.Device.Title, automaticSelectDevice)

                      End If

                       

                      Dim automaticSelectDevice(1) As Symbol.Imaging.Device

                      If Symbol.Imaging.Device.AvailableDevices.Length > 0 Then

                          automaticSelectDevice(0) = Symbol.Imaging.Device.AvailableDevices(1)

                      Dim MyDevice As Symbol.Generic.Device

                              'At this point automaticSelectDevice(0) has the following values:

                              ?automaticSelectDevice(0)

                              {Symbol.Imaging.Device}

                              AvailableDevices: {Length=2}

                              DeviceName: "IMG2:"

                              FriendlyName: "Image Capture Driver for Color Camera"

                              RegistryBasePath: "Drivers\BuiltIn\Imager2"

                              SIMULATE: "Simulate"

                              Text: "IMG2:"

                              Title: "Imager"

                       

                       

                       

                                'On this following line I get an error

                                '?ex.message

                                '"NullReferenceException"  and can't go any farther

                          MyDevice = Symbol.StandardForms.SelectDevice.Select("Imager", automaticSelectDevice)

                       

                          imager = New Symbol.Imaging.Imager(MyDevice)

                      End If

                      • Re: selecting the device without selecting it from the Select dialog?
                        Harry Simpson

                        I figured it out.  Don’t know why this decided to work today:

                         

                        If (imager Is Nothing) Then

                         

                                        'Dim MyDevice As Symbol.Generic.Device = Symbol.StandardForms.SelectDevice.Select(Symbol.Imaging.Device.Title, Symbol.Imaging.Device.AvailableDevices)

                                        Dim MyDevice As Symbol.Generic.Device = Symbol.Imaging.Device.AvailableDevices(1)

                                        If (MyDevice Is Nothing) Then

                         

                                            MessageBox.Show("No Device Selected", "SelectDevice")

                                            Me.Close()

                                            Return

                         

                                        End If

                         

                                        imager = New Symbol.Imaging.Imager(MyDevice)

                         

                        Thanks for your help Yordan.  I was thinking you were from Motorola responding to the ticket I submitted. They never called me back anyway.