Пример #1
0
 private static extern int ParaConfiguration(ref PARA_SYNC_RSP g_stRealPara);
Пример #2
0
        //LSxxx laser = new LSxxx();
        private void LS210()
        {
            PARA_SYNC_RSP g_stRealPara = new PARA_SYNC_RSP();
            int           err;
            //byte i = 0;
            string hostPC = "192.168.1.100";

            Int32 portPC          = 5500;
            byte  IntensityStatus = 0;

            // Create a different thread
            while (true)
            {
                LS_connect(hostPC, portPC);

                if (!isConnected())
                {
                    continue;
                }

                this.Dispatcher.Invoke(new Action(delegate()
                {
                    LidarConnectionStatus.Text = "Network connection OK";
                    DoEvents();
                }));


                do
                {
                    err = ParaSync(ref g_stRealPara);
                } while (err != 0);
                this.Dispatcher.Invoke(new Action(delegate()
                {
                    LidarConnectionStatus.Text = "Parameter synchronization OK";
                    DoEvents();
                }));

                //g_stRealPara.ucIntensityStatus = 0;
                //g_stRealPara.ucIntensityStatus = 1;
                //g_stRealPara.ucIntensityStatus = 2;

                g_stRealPara.ucIntensityStatus = IntensityStatus;

                do
                {
                    err = ParaConfiguration(ref g_stRealPara);
                } while (0 != err);
                this.Dispatcher.Invoke(new Action(delegate()
                {
                    LidarConnectionStatus.Text = "Parameter configuration OK";
                    DoEvents();
                }));

                StartMeasureTransmission();
                this.Dispatcher.Invoke(new Action(delegate()
                {
                    LidarConnectionStatus.Text = "Start getting the Measurements ...";
                    DoEvents();
                }));

                ////Alarm Area Para
                //if ((0x00 != pAlarmPara[0]) || (0x00 != pAlarmPara[1]) || (0x00 != pAlarmPara[2]) || (0x00 != pAlarmPara[3]) || (0x00 != pAlarmPara[4]))
                //{
                //    g_stRealPara.stAlarmArea[pAlarmPara[0]].ucAreaType = pAlarmPara[1];
                //    //printf("pAlarmPara[0]=%d\r\n",pAlarmPara[0]);
                //    //printf("g_stRealPara.stAlarmArea[pAlarmPara[0]].ucAreaType=%d\r\n",g_stRealPara.stAlarmArea[pAlarmPara[0]].ucAreaType);
                //    for (i = 0; i < 19; i++)
                //    {
                //        g_stRealPara.stAlarmArea[pAlarmPara[0]].aucPara[i] = pAlarmPara[i + 2];
                //        //printf("g_stRealPara.stAlarmArea[%d].aucPara[%d]=%d\r\n",pAlarmPara[0],i,g_stRealPara.stAlarmArea[pAlarmPara[0]].aucPara[i]);
                //    }
                //}

                //do
                //{
                //    err = Convert.ToByte(LSxxx.ParaConfiguration(g_stRealPara));
                //} while (0 != err);
                //MessageBox.Show("Parameter configuration OK\r\n");

                while (true)
                {
                    this.Dispatcher.Invoke(new Action(delegate()
                    {
                        LidarConnectionStatus.Text = "Start getting the Measurements ...";
                        DoEvents();
                    }));

                    LidarConnectionStatus.Text = "Start getting the Measurements ...";
                    //err = LSxxx.GetLidarMeasData();
                    //if (0 == err)
                    //{
                    //    /*test: Print receiving ridar data */
                    //    for (int i = 0; i < 1080; i++)
                    //    {
                    //        //printf("DataIntensity0[ %d].ulDistance=%d\r\n", i, DataIntensity0[i].ulDistance);
                    //        //printf("DataIntensity1[ %d].ulDistance=%d\r\n", i, DataIntensity1[i].ulDistance);
                    //        //printf("DataIntensity1[ %d].ucIntensity=%d\r\n", i, DataIntensity1[i].ucIntensity);
                    //        //printf("DataIntensity2[ %d].ulDistance=%d\r\n", i, DataIntensity2[i].ulDistance);
                    //        //printf("DataIntensity2[ %d].usIntensity=%d\r\n\r\n", i, DataIntensity2[i].usIntensity);
                    //        //printf("DataIntensity2[ %d].usIntensity=%d\r\n\r\n", i, DataIntensity2[i].usIntensity);
                    //        //printf("DataIntensity1[ %d].ulOutputStatus=%d\r\n\r\n", i, DataIntensity1[i].ulOutputStatus);
                    //        //printf("DataIntensity1[ %d].ulOutputStatus=%04x\r\n\r\n", i, DataIntensity1[i].ulOutputStatus);
                    //    }

                    //}
                    //else
                    //{
                    //    //break;
                    //}
                }
            }
        }
Пример #3
0
 private static extern int ParaSync(ref PARA_SYNC_RSP g_stRealPara);
Пример #4
0
 public static extern Int32 UnpackParaSyncRsp(byte[] vpucMsg, PARA_SYNC_RSP vpstParaSyncRsp);
Пример #5
0
 public static extern Int32 GetLidarMeasData(PARA_SYNC_RSP g_stRealPara, MEAS_DATA_NO_INTENSITY g_stMeasDataNoIntensity, MEAS_DATA_HAVE_INTENSITY1 g_stMeasDataHaveIntensity1, MEAS_DATA_HAVE_INTENSITY2 g_stMeasDataHaveIntensity2);
Пример #6
0
 public static extern Int32 ParaConfiguration(PARA_SYNC_RSP g_stRealPara);
Пример #7
0
 public static extern Int32 ParaSync(PARA_SYNC_RSP g_stRealPara);