using Shared.SimpleControl.Phone; using System; namespace Shared.SimpleControl.Pad { public class ACMethod { public ACMethod () { } public void SystemACHostEditRemark (HVAC acHost) { //MainPage.Loading.Start (); //editor.IsSelected = textButton.IsSelected = textButton.Enable = false; byte [] remakeBytes = CommonPage.MyEncodingGB2312.GetBytes (acHost.Name); System.Threading.Tasks.Task.Run (() => { byte [] updateBytes = Control.ControlBytesSendHasReturn (Command.ReadDeviceLoopInfo, acHost.SubnetID, acHost.DeviceID, new byte [] { acHost.BigClass,acHost.MinClass,acHost.LoopID}); if (updateBytes == null) { Application.RunOnMainThread (() => { new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.TipEquipmentNotOnline), Language.StringByID (R.MyInternationalizationString.Close)).Show (); MainPage.Loading.Hide (); }); return; } byte [] uBytes = new byte [20]; Array.Copy (remakeBytes, 0, uBytes, 0, remakeBytes.Length < 20 ? remakeBytes.Length : 20); Array.Copy (uBytes, 0, updateBytes, 3, 20 < uBytes.Length ? 20 : uBytes.Length); var reBytes = Control.ControlBytesSendHasReturn (Command.SetDeviceLoopInfo, acHost.SubnetID, acHost.DeviceID, updateBytes); if (reBytes != null) { Application.RunOnMainThread (() => { //acHost.Name = textButton.Text.Trim (); IO.FileUtils.SaveEquipmentMessage (acHost, acHost.LoopID.ToString ()); MainPage.Loading.Hide (); }); } else { Application.RunOnMainThread (() => { new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.TipEquipmentNotOnline), Language.StringByID (R.MyInternationalizationString.Close)).Show (); MainPage.Loading.Hide (); }); } }); } } }