private void TestConnection_Worker(object o)
        {
            if (o != null)
            {
                var info = (TestConnectionInfo)o;

                var returnInfo = new TestConnectionReturnInfo();

                string url = HTTP.GetUrl(info.Address, info.Port, info.DeviceName) + "probe";

                ReturnData returnData = Requests.Get(url, 5000, 1);

                if (returnData != null)
                {
                    probeDevice = returnData.Devices[0];

                    returnInfo.Success = true;
                    returnInfo.Message = "MTConnect Probe Successful @ " + url;
                }
                else
                {
                    returnInfo.Message = "MTConnect Probe Failed @ " + url;
                }

                Dispatcher.BeginInvoke(new Action <TestConnectionReturnInfo>(TestConnection_GUI), System.Windows.Threading.DispatcherPriority.Background, new object[] { returnInfo });
            }
        }
Exemplo n.º 2
0
        private void TestConnection_GUI(TestConnectionReturnInfo info)
        {
            if (info.Success)
            {
                ConnectionTestResult = 1;
            }
            else
            {
                ConnectionTestResult = -1;
            }

            ConnectionTestResultText = info.Message;
            ConnectionTestLoading    = false;
        }
Exemplo n.º 3
0
        private void TestConnection_Worker(object o)
        {
            if (o != null)
            {
                var info = (TestConnectionInfo)o;

                var returnInfo = new TestConnectionReturnInfo();

                string url = HTTP.GetUrl(info.Address, info.Port, info.DeviceName) + "probe";

                ReturnData returnData = Requests.Get(url, 5000, 1);

                if (returnData != null)
                {
                    returnInfo.Success = true;
                    returnInfo.Message = "MTConnect Probe Successful @ " + url;
                }
                else returnInfo.Message = "MTConnect Probe Failed @ " + url;

                Dispatcher.BeginInvoke(new Action<TestConnectionReturnInfo>(TestConnection_GUI), System.Windows.Threading.DispatcherPriority.Background, new object[] { returnInfo });
            }
        }
Exemplo n.º 4
0
        private void TestConnection_GUI(TestConnectionReturnInfo info)
        {
            if (info.Success) ConnectionTestResult = 1;
            else ConnectionTestResult = -1;

            ConnectionTestResultText = info.Message;
            ConnectionTestLoading = false;
        }