Пример #1
0
 /// <summary>
 /// 从信号机取得所有阶段配时信息。
 /// </summary>
 /// <returns></returns>
 public static List<StagePattern> GetStagePattern16()
 {
     TscData td = (TscData)Application.Current.Properties[Define.TSC_DATA];
     byte[] byt = Udp.recvUdp(td.Node.sIpAddress, Define.GBT_PORT, Define.GET_STAGEPATTERN);
     if (!CheckGBT(byt, "阶段配时"))
     {
         return null;
     }
     List<StagePattern> listStagePattern = new List<StagePattern>();
     //取得)
     byte[] arrayStagePattern = new byte[Convert.ToInt32(byt[3]) * Convert.ToInt32(byt[4]) * Define.STAGE_PATTERN_BYTE_SIZE_16];
     Array.Copy(byt, 5, arrayStagePattern, 0, Convert.ToInt32(byt[3]) * Convert.ToInt32(byt[4]) * Define.STAGE_PATTERN_BYTE_SIZE_16);
     byte[,] twoArray = ByteUtils.oneArray2TwoArray(arrayStagePattern, Convert.ToInt32(byt[3]) * Convert.ToInt32(byt[4]), Define.STAGE_PATTERN_BYTE_SIZE_16);
     StagePattern obj;
     for (int i = 0; i < (Convert.ToInt32(byt[3]) * Convert.ToInt32(byt[4])); i++)
     {
         obj = new StagePattern();
         obj.ucStagePatternId = twoArray[i, 0];
         obj.ucStageNo = twoArray[i, 1];
         obj.usAllowPhase = (uint)((twoArray[i, 2] << 8) + twoArray[i, 3]);
         obj.ucGreenTime = twoArray[i, 4];
         obj.ucYellowTime = twoArray[i, 5];
         obj.ucRedTime = twoArray[i, 6];
         obj.ucOption = twoArray[i, 7];
         listStagePattern.Add(obj);
     }
     return listStagePattern;
 }
Пример #2
0
 /// <summary>
 /// 隐藏所有的stage 图
 /// </summary>
 private void hiddenStage(StagePattern sp)
 {
   
     foreach (StageItem si in lsi)
     {
         if (sp.usAllowPhase == 0)
         {
             si.Visibility = Visibility.Hidden;
             //break;
         }
     }
 }
Пример #3
0
        /// <summary>
        /// 根据方向表,可以得到哪个方向有配置相位。哪个方向没有配置相位,
        /// 根据方向表的相位字段,可以将方向隐藏起来
        /// </summary>
        /// <param name="ptd"></param>
        /// <param name="sp"></param>
        private void initDirecArrow(PhaseToDirec ptd, StagePattern sp)
        {
            if (ptd.ucId == Define.NORTH_PEDESTRAIN_ONE && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.northPedestrain1.Visibility = Visibility.Hidden;
                northPedestrain1.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.NORTH_PEDESTRAIN_TWO && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.northPedestrain2.Visibility = Visibility.Hidden;
                northPedestrain2.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.NORTH_TURN_AROUND && ptd.ucPhase == 0)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.northPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));

            }
            if (ptd.ucId == Define.NORTH_LEFT_STRAIGHT && ptd.ucPhase == 0)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.northPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));

            }
            if (ptd.ucId == Define.NORTH_RIGHT_STRAIGHT && ptd.ucPhase == 0)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.northPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));

            }
            if (ptd.ucId == Define.NORTH_LEFT_STRAIGHT_RIGHT && ptd.ucPhase == 0)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.northPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));

            }
            if (ptd.ucId == Define.NORTH_LEFT && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.northLeft.Visibility = Visibility.Hidden;
                northLeft.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.NORTH_STRAIGHT && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.northStraight.Visibility = Visibility.Hidden;
                northStraight.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.NORTH_RIGHT && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.northRight.Visibility = Visibility.Hidden;
                northRight.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.NORTH_OTHER && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.northOther.Visibility = Visibility.Hidden;
                northOther.Visibility = Visibility.Hidden;
            }
            // 南
            if (ptd.ucId == Define.SOUTH_PEDESTRAIN_ONE && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.southPedestrain1.Visibility = Visibility.Hidden;
                southPedestrain1.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.SOUTH_PEDESTRAIN_TWO && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.southPedestrain2.Visibility = Visibility.Hidden;
                southPedestrain2.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.SOUTH_LEFT_STRAIGHT && ptd.ucPhase == 0)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.southPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.SOUTH_LEFT_STRAIGHT_RIGHT && ptd.ucPhase == 0)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.southPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.SOUTH_RIGHT_STRAIGHT && ptd.ucPhase == 0)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.southPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.SOUTH_LEFT && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.southLeft.Visibility = Visibility.Hidden;
                southLeft.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.SOUTH_OTHER && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.southOther.Visibility = Visibility.Hidden;
                southOther.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.SOUTH_RIGHT && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.southRight.Visibility = Visibility.Hidden;
                southRight.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.SOUTH_STRAIGHT && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.southStraight.Visibility = Visibility.Hidden;
                southStraight.Visibility = Visibility.Hidden;
            }
            // 西
            if (ptd.ucId == Define.WEST_PEDESTRAIN_ONE && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.westPedestrain1.Visibility = Visibility.Hidden;
                westPedestrain1.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.WEST_PEDESTRAIN_TWO && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.westPedestrain2.Visibility = Visibility.Hidden;
                westPedestrain2.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.WEST_LEFT_STRAIGHT && ptd.ucPhase == 0)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.westPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.WEST_LEFT_STRAIGHT_RIGHT && ptd.ucPhase == 0)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.westPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.WEST_RIGHT_STRAIGHT && ptd.ucPhase == 0)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.westPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.WEST_LEFT && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.westLeft.Visibility = Visibility.Hidden;
                westLeft.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.WEST_STRAIGHT && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.westStraight.Visibility = Visibility.Hidden;
                westStraight.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.WEST_RIGHT && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.westRight.Visibility = Visibility.Hidden;
                westRight.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.WEST_OTHER && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.westOther.Visibility = Visibility.Hidden;
                westOther.Visibility = Visibility.Hidden;
            }

            if (ptd.ucId == Define.EAST_PEDESTRAIN_ONE && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.eastPedestrain1.Visibility = Visibility.Hidden;
                eastPedestrain1.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.EAST_PEDESTRAIN_TWO && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.eastPedestrain2.Visibility = Visibility.Hidden;
                eastPedestrain2.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.EAST_LEFT_STRAIGHT && ptd.ucPhase == 0)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.eastPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.EAST_LEFT_STRAIGHT_RIGHT && ptd.ucPhase == 0)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.eastPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.EAST_RIGHT_STRAIGHT && ptd.ucPhase == 0)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.eastPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.EAST_LEFT && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.eastLeft.Visibility = Visibility.Hidden;
                eastLeft.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.EAST_STRAIGHT && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.eastStraight.Visibility = Visibility.Hidden;
                eastStraight.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.EAST_RIGHT && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.eastRight.Visibility = Visibility.Hidden;
                eastRight.Visibility = Visibility.Hidden;
            }
            if (ptd.ucId == Define.EAST_OTHER && ptd.ucPhase == 0)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.eastOther.Visibility = Visibility.Hidden;
                eastOther.Visibility = Visibility.Hidden;
            }



        }
Пример #4
0
        /// <summary>
        /// 通过方向 表和阶段表可以确定,相应的相位已经配置上去。
        /// </summary>
        /// <param name="ptd"></param>
        /// <param name="sp"></param>
        private void InitStageDirec(PhaseToDirec ptd,StagePattern sp)
        {
            if (ptd.ucId == Define.NORTH_PEDESTRAIN_ONE)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.northPedestrain1.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));

            }
            if (ptd.ucId == Define.NORTH_PEDESTRAIN_TWO)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.northPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));

            }
            if (ptd.ucId == Define.NORTH_TURN_AROUND)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.northPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));

            }
            if (ptd.ucId == Define.NORTH_LEFT_STRAIGHT)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.northPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));

            }
            if (ptd.ucId == Define.NORTH_RIGHT_STRAIGHT)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.northPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));

            }
            if (ptd.ucId == Define.NORTH_LEFT_STRAIGHT_RIGHT)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.northPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));

            }
            if (ptd.ucId == Define.NORTH_LEFT)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.northLeft.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative)); 

            }
            if (ptd.ucId == Define.NORTH_STRAIGHT)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.northStraight.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.NORTH_RIGHT)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.northRight.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.NORTH_OTHER)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.northOther.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));
            }
            // 南
            if (ptd.ucId == Define.SOUTH_PEDESTRAIN_ONE)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.southPedestrain1.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.SOUTH_PEDESTRAIN_TWO)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.southPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.SOUTH_LEFT_STRAIGHT)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.southPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.SOUTH_LEFT_STRAIGHT_RIGHT)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.southPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.SOUTH_RIGHT_STRAIGHT)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.southPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.SOUTH_LEFT)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.southLeft.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.SOUTH_OTHER)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.southOther.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.SOUTH_RIGHT)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.southRight.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.SOUTH_STRAIGHT)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.southStraight.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));
            }
            // 西
            if (ptd.ucId == Define.WEST_PEDESTRAIN_ONE)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.westPedestrain1.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.WEST_PEDESTRAIN_TWO)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.westPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.WEST_LEFT_STRAIGHT)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.westPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.WEST_LEFT_STRAIGHT_RIGHT)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.westPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.WEST_RIGHT_STRAIGHT)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.westPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.WEST_LEFT)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.westLeft.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.WEST_STRAIGHT)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.westStraight.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.WEST_RIGHT)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.westRight.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.WEST_OTHER)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.westOther.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }

            if (ptd.ucId == Define.EAST_PEDESTRAIN_ONE)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.eastPedestrain1.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.EAST_PEDESTRAIN_TWO)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.eastPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.EAST_LEFT_STRAIGHT)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.eastPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.EAST_LEFT_STRAIGHT_RIGHT)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.eastPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.EAST_RIGHT_STRAIGHT)
            {
                //StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                //si.eastPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.EAST_LEFT)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.eastLeft.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.EAST_STRAIGHT)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.eastStraight.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.EAST_RIGHT)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.eastRight.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }
            if (ptd.ucId == Define.EAST_OTHER)
            {
                StageItem si = returnStageItemObjectByStageNo(sp.ucStageNo);
                si.eastOther.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative));
            }

            //byte direcId = ptd.ucId;
            //byte direc = Convert.ToByte(direcId >> 5);
            //byte turn = Convert.ToByte(direcId >> 3);
            //byte pedestrain = Convert.ToByte((direcId >> 3) & 0x07);

            //if (direc == 0x01)
            //{
            //    if (turn == 0x00)
            //    {

            //    }
            //}
        }
Пример #5
0
 private void visiableStage(StagePattern sp)
 {
     
     if (sp.ucStageNo == 1)
     {
         stage1.Visibility = Visibility.Visible;
     }
     else if (sp.ucStageNo == 2)
     {
         stage2.Visibility = Visibility.Visible;
     }
     else if (sp.ucStageNo == 3)
     {
         stage3.Visibility = Visibility.Visible;
     }
     else if (sp.ucStageNo == 4)
     {
         stage4.Visibility = Visibility.Visible;
     }
     else if (sp.ucStageNo == 5)
     {
         stage5.Visibility = Visibility.Visible;
     }
     else if (sp.ucStageNo == 6)
     {
         stage6.Visibility = Visibility.Visible;
     }
     else if (sp.ucStageNo == 7)
     {
         stage7.Visibility = Visibility.Visible;
     }
     else if (sp.ucStageNo == 8)
     {
         stage8.Visibility = Visibility.Visible;
     }
     else if (sp.ucStageNo == 9)
     {
         stage9.Visibility = Visibility.Visible;
     }
     else if (sp.ucStageNo == 10)
     {
         stage10.Visibility = Visibility.Visible;
     }
     else if (sp.ucStageNo == 11)
     {
         stage11.Visibility = Visibility.Visible;
     }
     else if (sp.ucStageNo == 12)
     {
         stage12.Visibility = Visibility.Visible;
     }
     else if (sp.ucStageNo == 13)
     {
         stage13.Visibility = Visibility.Visible;
     }
     else if (sp.ucStageNo == 14)
     {
         stage14.Visibility = Visibility.Visible;
     }
     else if (sp.ucStageNo == 15)
     {
         stage15.Visibility = Visibility.Visible;
     }
     else if (sp.ucStageNo == 16)
     {
         stage16.Visibility = Visibility.Visible;
     }
             
 }