Example #1
0
        void initialApi()
        {
            KApiLib.Construct();
            GoSdkLib.Construct();
            KIpAddress addr = KIpAddress.Parse(IPAddr);

            _system = new GoSystem();

            _sensor = _system.FindSensorByIpAddress(addr);
            _system.Connect();

            if (_sensor.State == GoState.Ready)
            {
                _context.Post(delegate
                {
                    richTextBox1.AppendText("Connected" + Environment.NewLine);
                }, null);
            }
            else
            {
                _context.Post(delegate
                {
                    richTextBox1.AppendText(@"Connect failed" + Environment.NewLine);
                }, null);
            }



            _system.EnableData(true);
            _system.SetDataHandler(OnDataReceived);
        }
Example #2
0
 public bool InitialAcq()
 {
     mSystem = new GoSystem();
     mSensor = mSystem.FindSensorByIpAddress(KIpAddress.Parse(IPAddr));
     DeviceStatusEvent?.Invoke(this, $"Find device @ IP address {IPAddr}");
     mSystem.Connect();
     DeviceStatusEvent?.Invoke(this, $"Connect to {IPAddr}");
     mSystem.EnableData(true);
     mSystem.SetDataHandler(OnData);
     return(true);
 }
        public void GoSystemConstruct(string IPAddress, long profileCount)
        {
            initialApi();
            _system       = new GoSystem();
            _profileCount = profileCount;
            KIpAddress addr = KIpAddress.Parse(IPAddress);

            _sensor = _system.FindSensorByIpAddress(addr);
            _syncContext.Post(delegate { yRes.Content = profileCount.ToString(); }, null);
            _system.Connect();
            if (_sensor.IsConnected())
            {
                _system.EnableData(true);
                _system.SetDataHandler(OnDataReceived);
                _syncContext.Post(delegate { UpdateMsg("Systeme Construct successfully"); }, null);
            }
            else
            {
                _syncContext.Post(delegate { UpdateMsg("System Construct Failed"); }, null);
            }
        }