예제 #1
0
 public void DefineAsInterface(TrackSegment segment)
 {
     typeWidget = (int)TypeWidget.STATION_INTERFACE;
     if (stationConnector == null)
     {
         stationConnector = new StationConnector(segment);
     }
     stationConnector.Init(segment);
     setLineSnap();
     setEditable();
 }
예제 #2
0
        public void ReAlignData(AEWidget aeWidget)
        {
            List <StationAreaItem> withConnector = new List <StationAreaItem>();
            List <globalItem>      itemWidget    = orRouteConfig.GetOrWidget();

            foreach (var item in itemWidget)
            {
                if (typeof(StationItem) == item.GetType() || item.typeWidget == (int)TypeWidget.STATION_WIDGET)
                {
                    List <StationAreaItem> area = ((StationItem)item).getStationArea();
                    foreach (var areaPoint in area)
                    {
                        if (areaPoint.typeWidget == (int)TypeWidget.STATION_INTERFACE)
                        {
                            withConnector.Add(areaPoint);
                        }
                    }
                }
            }
            if (withConnector.Count == 0)
            {
                return;
            }
            List <TrackSegment> linesSegment = aeWidget.segments;

            foreach (var lineSegment in linesSegment)
            {
                //File.AppendAllText(@"F:\temp\AE.txt", "ReAlignData: idxA: " + lineSegment.SectionIdxA +
                //    " idxB: " + lineSegment.SectionIdxB + "\n");
                foreach (var areaPoint in withConnector)
                {
                    StationConnector stationConnector = areaPoint.getStationConnector();
                    if (stationConnector == null)
                    {
                        continue;
                    }
                    if (stationConnector.idxMaster == lineSegment.SectionIdxA &&
                        stationConnector.idxSecond == lineSegment.SectionIdxB)
                    {
                        areaPoint.DefineAsInterface(lineSegment);
                        withConnector.Remove(areaPoint);
                        break;
                    }
                }
                if (withConnector.Count <= 0)
                {
                    break;
                }
            }
        }