/// <summary> /// 处理系统信息数据解包 /// </summary> /// <param name="obj"></param> private void HandleZJXX(SatellitePackage obj) { List <string> list = new List <string>(); ZJXX zjxx = new ZJXX(); zjxx.Content = obj.Content; zjxx.Unpackage(); list.Add(zjxx.ToString()); HandleEvent(list, zjxx); }
/// <summary> /// 处理通信申请数据解包 /// </summary> /// <param name="obj"></param> private void HandleTXSQ(SatellitePackage obj) { List <string> list = new List <string>(); TXSQ txsq = new TXSQ(); txsq.Content = obj.Content; txsq.Unpackage(); list.Add(txsq.ToString()); HandleEvent(list, txsq); }
/// <summary> /// 处理系统自检数据解包 /// </summary> /// <param name="obj"></param> private void HandleXTZJ(SatellitePackage obj) { List <string> list = new List <string>(); XTZJ xtzj = new XTZJ(); xtzj.Content = obj.Content; xtzj.Unpackage(); list.Add(xtzj.ToString()); HandleEvent(list, xtzj); }
/// <summary> /// 处理IC信息数据解包 /// </summary> /// <param name="obj"></param> private void HandleICXX(SatellitePackage obj) { List <string> list = new List <string>(); ICXX icxx = new ICXX(); icxx.Content = obj.Content; icxx.Unpackage(); list.Add(icxx.ToString()); HandleEvent(list, icxx); }
/// <summary> /// 处理IC检查数据包 /// </summary> /// <param name="obj"></param> private void HandleICJC(SatellitePackage obj) { List <string> list = new List <string>(); ICJC icjc = new ICJC(); icjc.Content = obj.Content; icjc.Unpackage(); list.Add(icjc.ToString()); HandleEvent(list, icjc); }
/// <summary> /// 发起数据处理完毕事件 /// </summary> /// <param name="list"></param> private void HandleEvent(List <string> list, SatellitePackage data) { if (null != OnDataHandled) { OnDataHandled(this, new HandledData() { Message = list, Data = data }); } }
/// <summary> /// 更新自检信息回来的设备参数 /// </summary> /// <param name="obj"></param> private void UpdateZJXX(SatellitePackage obj) { this.BeginInvoke((MyInvoker) delegate { tstbOrigin.Text = obj.OriginAddress; tsslNumber.Text = "Original No.: " + obj.OriginAddress; ZJXX z = obj as ZJXX; tsslCapacity.Text = "Capacity: " + string.Format("[{0}:{1}][{2}:{3}][{4}:{5}][{6}:{7}][{8}:{9}][{10}:{11}]", 1, z.PW1, 2, z.PW2, 3, z.PW3, 4, z.PW4, 5, z.PW5, 6, z.PW6); }); }
/// <summary> /// 处理反馈信息数据解包 /// </summary> /// <param name="obj"></param> private void HandleFKXX(SatellitePackage obj) { FKXX fkxx = new FKXX(); fkxx.Content = obj.Content; fkxx.Unpackage(); var list = new List <string>(); list.Add(fkxx.ToString()); HandleEvent(list, fkxx); }
/// <summary> /// 处理通信信息数据解包 /// </summary> /// <param name="obj"></param> private void HandleTXXX(SatellitePackage obj) { TXXX txxx = new TXXX(); txxx.Content = obj.Content; txxx.Unpackage(); var list = new List <string>(); list.Add(txxx.ToString()); HandleEvent(list, txxx); }
/// <summary> /// 处理接收到的数据 /// </summary> /// <param name="data"></param> private void HandleReceivedData(DataPackage data) { var obj = new SatellitePackage(data.Data); //obj.Unpackage(); switch (obj.Command) { case "$TXSQ": HandleTXSQ(obj); break; case "$TXXX": HandleTXXX(obj); break; case "$FKXX": HandleFKXX(obj); break; case "$ICJC": HandleICJC(obj); break; case "$XTZJ": HandleXTZJ(obj); break; case "$ICXX": HandleICXX(obj); break; case "$ZJXX": HandleZJXX(obj); break; } // 回收数据结构 RecycleDataPackage(data); }