Example #1
0
 public void RemoveConnection(TrackConnection connection)
 {
     ownConnections.Remove(connection);
     if (!removing && AllConnections.Count == 0) {
       Remove();
     }
 }
        public TrackConnectionViewModel()
        {
            _trackConnection = new TrackConnection();
            _arduinoService  = Container.Resolve <IArduinoService>();

            ConnectToTrackCommand = new ConnectToTrackCommand(this);
            AddLaneCommand        = new AddLaneCommand(this);
            RemoveLaneCommand     = new RemoveLaneCommand(this);
        }
            public List <TrackConnection> GetPossiblePaths(Point origin, Point previous)
            {
                List <TrackConnection> results = new List <TrackConnection>();

                foreach (TrackConnection p in this.PathOffsets)
                {
                    TrackConnection connection = new TrackConnection(p.PreviousOffset, p.DestinationOffset, p.ValidDestinations);
                    Point           possible   = new Point();

                    if (GetPossiblePoint(origin, p.PreviousOffset, previous, p.DestinationOffset, ref possible))
                    {
                        connection.Destination = possible;
                        results.Add(connection);
                    }
                }

                return(results);
            }
Example #4
0
 public void SelectConnectionToo(TrackConnection c)
 {
     if (!selectedConnections.Contains(c)){
       selectedConnections.Add(c);
     }
 }
Example #5
0
 public void SelectConnection(TrackConnection c)
 {
     selectedConnections = new List<TrackConnection>();
     selectedPoints = new List<TrackPoint>();
     selectedConnections.Add(c);
 }
Example #6
0
 public void AddConnection(TrackConnection connection)
 {
     ownConnections.Add(connection);
 }
Example #7
0
 public ConnectionDirection(TrackConnection con, bool positive)
 {
     this.con = con;
       direction = (positive) ? 1 : -1;
 }
Example #8
0
 public PointOnTrack(TrackConnection c, Track track)
 {
     this.track = track;
     connectionId = c.Id;
 }