Esempio n. 1
0
 public void SwitchTo(int port, bool Bmode)
 {
     if (!bInUse)
     {
         return;
     }
     if (stype == ScannerType.RT2010_MI)
     {
         if (Bmode == true)
         {
             dev.Send(String.Format("{0}B\r\n", port.ToString()), true);
         }
         else
         {
             dev.Send(String.Format("{0}A\r\n", port.ToString()), true);
         }
         return;
     }
     if (stype == ScannerType.GUIDLINE)
     {
         if (Bmode == true)
         {
             dev.Send(String.Format("B{0}\r\n", port.ToString("D2")), true);
         }
         else
         {
             dev.Send(String.Format("A{0}\r\n", port.ToString("D2")), true);
         }
         return;
     }
 }
Esempio n. 2
0
        public void SwitchTo(int port, bool Bmode)
        {
            if (!bInUse)
            {
                return;
            }

            if (port < ch_start)
            {
                return;
            }
            if (port > ch_end)
            {
                port = ch_end;
            }
            else
            {
                port = port - ch_start + 1;//always starting from 1
            }
            if (stype == ScannerType.RT2010_MI)
            {
                if (Bmode == true)
                {
                    dev.Send(String.Format("{0}B\r\n", port.ToString()), true);
                }
                else
                {
                    dev.Send(String.Format("{0}A\r\n", port.ToString()), true);
                }
                return;
            }
            if (stype == ScannerType.GUIDLINE)
            {
                if (Bmode == true)
                {
                    dev.Send(String.Format("B{0}\r\n", port.ToString("D2")), true);
                }
                else
                {
                    dev.Send(String.Format("A{0}\r\n", port.ToString("D2")), true);
                }
                return;
            }
        }
Esempio n. 3
0
 public void Stop()
 {
     dev.Send("S\r\n", true);
     dev.ClearInBuffer();
 }