Exemplo n.º 1
0
Arquivo: Form1.cs Projeto: 287396159/A
        private void searchDeviceAllInfo()
        {
            if (device is CardDevice)
            {
                if (deviceCom is CardDeviceCom)
                {
                    CardDeviceCom cardDeviceCom = deviceCom as CardDeviceCom;

                    cardDeviceCom.sendShowCardDeviceCom();
                    Thread.Sleep(120);
                    cardDeviceCom.sendSearchRangeTime();
                    Thread.Sleep(120);
                    cardDeviceCom.sendSearchStillTime();
                    Thread.Sleep(120);
                    cardDeviceCom.sendSearchAccRange();
                }
            }
            else if (device is WarningDevice)
            {
                if (deviceCom is WarningDeviceCom)
                {
                    WarningDeviceCom warningDeviceCom = deviceCom as WarningDeviceCom;

                    warningDeviceCom.sendSerachWarningLinkTimeCom();
                    Thread.Sleep(120);
                    warningDeviceCom.sendSerachWarningSafeDistanceCom();
                    Thread.Sleep(120);
                    warningDeviceCom.sendSerachWarningVolumeCom();
                    Thread.Sleep(120);
                    warningDeviceCom.sendSerachWarningCardsCom();
                }
            }
        }
Exemplo n.º 2
0
Arquivo: Form1.cs Projeto: 287396159/A
 private void Button9_Click(object sender, EventArgs e)
 {
     //read safe Distance
     if (device is CardDevice)
     {
         if (deviceCom is CardDeviceCom)
         {
             CardDeviceCom cardDeviceCom = deviceCom as CardDeviceCom;
             clickEventNum = CLICKEVENTNUM.GETCARDSTILLTIME;
             cardDeviceCom.sendSearchStillTime();
         }
     }
     else if (device is WarningDevice)
     {
         if (deviceCom is WarningDeviceCom)
         {
             WarningDeviceCom warningDeviceCom = deviceCom as WarningDeviceCom;
             clickEventNum = CLICKEVENTNUM.GETSAFEDISTANCE;
             warningDeviceCom.sendSerachWarningSafeDistanceCom();
         }
     }
 }