Beispiel #1
0
 /// <summary>
 /// 从信号机取得所有的跟随相位信息。
 /// </summary>
 /// <returns></returns>
 public static List<OverlapPhase> GetOverlapPhase()
 {
     TscData td = (TscData)Application.Current.Properties[Define.TSC_DATA];
     byte[] byt = Udp.recvUdp(td.Node.sIpAddress, Define.GBT_PORT, Define.GET_OVERLAPPHASE);
     if (!CheckGBT(byt, "跟随相位"))
     {
         return null;
     }
     List<OverlapPhase> listOverlapPhase = new List<OverlapPhase>();
     //取得)
     byte[] arrayOverlapPhase = new byte[Convert.ToInt32(byt[3]) * Define.OVERLAPPHASE_BYTE_SIZE];
     Array.Copy(byt, 4, arrayOverlapPhase, 0, Convert.ToInt32(byt[3]) * Define.OVERLAPPHASE_BYTE_SIZE);
     byte[,] twoArray = ByteUtils.oneArray2TwoArray(arrayOverlapPhase, Convert.ToInt32(byt[3]), Define.OVERLAPPHASE_BYTE_SIZE);
     OverlapPhase obj;
     for (int i = 0; i < Convert.ToInt32(byt[3]); i++)
     {
         obj = new OverlapPhase();
         obj.ucId = twoArray[i, 0];
         obj.ucOperateType = twoArray[i, 1];
         obj.ucIncludePhaseLen = twoArray[i, 2];
         obj.ucIncludePhase = new byte[] { twoArray[i, 3], twoArray[i, 4], twoArray[i, 5], twoArray[i, 6], twoArray[i, 7], twoArray[i, 8], twoArray[i, 9], twoArray[i, 10], twoArray[i, 11], twoArray[i, 12], twoArray[i, 13], twoArray[i, 14], twoArray[i, 15], twoArray[i, 16], twoArray[i, 17], twoArray[i, 18] };
         obj.ucCorrectPhaseLen = twoArray[i, 19];
         obj.ucCorrectPhase = new byte[] { twoArray[i, 20], twoArray[i, 21], twoArray[i, 22], twoArray[i, 23], twoArray[i, 24], twoArray[i, 25], twoArray[i, 26], twoArray[i, 27], twoArray[i, 28], twoArray[i, 29], twoArray[i, 30], twoArray[i, 31], twoArray[i, 32], twoArray[i, 33], twoArray[i, 34], twoArray[i, 35] };
         obj.ucTailGreen = twoArray[i, 36];
         obj.ucTailYellow = twoArray[i, 37];
         obj.ucTailRed = twoArray[i, 38];
         listOverlapPhase.Add(obj);
     }
     return listOverlapPhase;
 }
Beispiel #2
0
 public static void SetOverLapPhaseByCurrent(OverlapPhase op)
 {
     Application.Current.Properties[Define.SELECTED_PHASE_OVERLAP] = op;
 }