Esempio n. 1
0
        public delegate void UpdateString(string NewData);//委托

        public void UpdateReceiveCount(object NewCount)
        {
            if (this.InvokeRequired)//等待异步
            {
                UpdateString _myInvoke = new UpdateString(UpdateReceiveCount);
                this.Invoke(_myInvoke, new object[] { NewCount });
            }
        }
Esempio n. 2
0
 public ElementProperty(string display, GumpResponse callback, string text, InputType elementInputType, bool isChecked = false, UpdateString bookTextCallback = null)
 {
     Display          = display;
     Callback         = callback;
     Text             = text;
     ElementInputType = elementInputType;
     Checked          = isChecked;
     BookCallback     = bookTextCallback;
 }
 public void UpdateRecevie(object NewData)
 {
     if (this.InvokeRequired)//等待异步
     {
         UpdateString myInvoke = new UpdateString(UpdateRecevie);
         Invoke(myInvoke, new object[] { NewData });
     }
     else
     {
         tbReceiveData.AppendText(NewData.ToString());
         //tbReceiveData.SelectionStart = tbReceiveData.Text.Length - 1;
         tbReceiveData.ScrollToCaret();
     }
 }
        protected void GeoReferenceForPoly(List <LatLong> rgll, string szCountry, string szAdmin)
        {
            if (rgll == null)
            {
                throw new ArgumentNullException(nameof(rgll));
            }
            if (szCountry == null)
            {
                throw new ArgumentNullException(nameof(szCountry));
            }

            if (!rgll.Any())
            {
                throw new InvalidOperationException("No latitude/longitudes in rgll!");
            }


            // Get the bounding box.
            LatLongBox llb = new LatLongBox(rgll.First());

            foreach (LatLong ll in rgll)
            {
                llb.ExpandToInclude(ll);
            }

            IEnumerable <airport> rgap = AdminAirport.UntaggedAirportsInBox(llb);
            GeoRegion             geo  = new GeoRegion(string.Empty, rgll);

            int cAirports = 0;

            foreach (AdminAirport ap in rgap)
            {
                if (geo.ContainsLocation(ap.LatLong))
                {
                    UpdateString.AppendLine(String.Format(CultureInfo.InvariantCulture, "UPDATE airports SET Country='{0}' {1} WHERE type='{2}' AND airportID='{3}';", szCountry, String.IsNullOrWhiteSpace(szAdmin) ? string.Empty : String.Format(CultureInfo.InvariantCulture, ", admin1 = '{0}' ", szAdmin), ap.FacilityTypeCode, ap.Code));
                    ap.SetLocale(szCountry, szAdmin);
                    cAirports++;
                }
            }

            if (cAirports > 0)
            {
                AuditString.AppendLine(String.Format(CultureInfo.CurrentCulture, "Updated {0} airports for country {1}, region {2}", cAirports, szCountry, szAdmin));
            }
        }
Esempio n. 5
0
        /// <summary>
        ///  霍尼韦尼扫码返回  例如炉门41 67 69 6E 67 30 30 34 0D (30 30 34为有效数字)
        /// </summary>
        /// <param name="NewData"></param>
        public void UpdateRecevie(string NewData)
        {
            string Value        = "";
            string ValueAddress = "";
            int    Address      = 0;

            if (this.InvokeRequired)//等待异步
            {
                UpdateString _myInvoke = new UpdateString(UpdateRecevie);
                this.Invoke(_myInvoke, new object[] { NewData });
            }
            else
            {
                NewData = NewData.Replace(" ", ""); //剔除空格
                if (NewData.Length == 18)           //当前扫码到的值为炉门号41 67 69 6E 67 30 30 34 0D
                {
                    Value = InterceptStringHelp.ExtractString(NewData, 10, 6);
                    for (int i = 0; i < Value.Length / 2; i++)
                    {
                        Address       = DecimalConversion.HexToTen(NewData.Substring(10 + (i * 2), 2)); // 十六进制转10进制
                        ValueAddress += ((char)Address).ToString();                                     // 十进制转acsii码
                    }
                    if (SySetHeip.Prefix.Trim() + ValueAddress == "L10001")                             //扫到哪一个炉门,自动选择该门
                    {
                        OperateShow.Text = "当前1号门操作";
                        DictionaryHelp.Dictionary["Operater1"]();
                    }
                    else if (SySetHeip.Prefix.Trim() + ValueAddress == "L10002")
                    {
                        OperateShow.Text = "当前2号门操作";
                        DictionaryHelp.Dictionary["Operater2"]();
                    }
                    else if (SySetHeip.Prefix.Trim() + ValueAddress == "L10003")
                    {
                        OperateShow.Text = "当前3号门操作";
                        DictionaryHelp.Dictionary["Operater3"]();
                    }
                    else if (SySetHeip.Prefix.Trim() + ValueAddress == "L10004")
                    {
                        OperateShow.Text = "当前4号门操作";
                        DictionaryHelp.Dictionary["Operater4"]();
                    }
                    else if (SySetHeip.Prefix.Trim() + ValueAddress == "L10005")
                    {
                        OperateShow.Text = "当前5号门操作";
                        DictionaryHelp.Dictionary["Operater5"]();
                    }
                    else if (SySetHeip.Prefix.Trim() + ValueAddress == "L10006")
                    {
                        OperateShow.Text = "当前6号门操作";
                        DictionaryHelp.Dictionary["Operater6"]();
                    }
                    else if (SySetHeip.Prefix.Trim() + ValueAddress == "L10007")
                    {
                        OperateShow.Text = "当前7号门操作";
                        DictionaryHelp.Dictionary["Operater7"]();
                    }
                    else if (SySetHeip.Prefix.Trim() + ValueAddress == "L10008")
                    {
                        OperateShow.Text = "当前8号门操作";
                        DictionaryHelp.Dictionary["Operater8"]();
                    }
                }
                if (NewData.Length == 14)//当前扫码到的值为小车号  小车条码号4C31303031320D
                {
                    Value = InterceptStringHelp.ExtractString(NewData, 6, 6);;
                    for (int i = 0; i < Value.Length / 2; i++)
                    {
                        Address       = DecimalConversion.HexToTen(NewData.Substring(6 + (i * 2), 2)); // 十六进制转10进制
                        ValueAddress += ((char)Address).ToString();                                    // 十进制转acsii码
                    }
                    if (!string.IsNullOrEmpty(BarCode1.Text) && !string.IsNullOrEmpty(BarCode2.Text))
                    {
                        BarCode1.Text = "";
                        BarCode2.Text = "";
                    }
                    if (string.IsNullOrEmpty(BarCode1.Text))
                    {
                        BarCode1.Text = SySetHeip.Prefix.Trim() + ValueAddress;
                        ValueAddress  = "";
                    }
                    else
                    {
                        BarCode2.Text = SySetHeip.Prefix.Trim() + ValueAddress;
                        ValueAddress  = "";
                    }
                    if (BarCode1.Text == BarCode2.Text)
                    {
                        Common.Msg.Warning("不能绑定两个相同的条码");
                        BarCode2.Text = "";
                    }
                }
            }
        }
Esempio n. 6
0
		public ElementProperty(
			string display,
			Action<GumpEntry, object> callback,
			string text,
			InputType elementInputType,
			bool isChecked = false,
			UpdateString bookTextCallback = null)
		{
			Display = display;
			Callback = callback;
			Text = text;
			ElementInputType = elementInputType;
			Checked = isChecked;
			BookCallback = bookTextCallback;
		}