コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: kkurys/TripPlanner
        private void AddAttractionPushpin(Attraction _attraction, int n, int content)
        {
            Pushpin pin = new Pushpin();

            pin.Location = new Microsoft.Maps.MapControl.WPF.Location(_attraction.Lat, _attraction.Long);
            pin.Tag      = _attraction;
            pin.Content  = content;
            PushPinLayer.Children.Add(pin);
            pin.MouseEnter += Route_MouseEnter;
            pin.MouseLeave += Route_MouseLeave;
            pin.Background  = DayColors.GetColor(n);
            if (!_dayAttractions.ContainsKey(n))
            {
                _dayAttractions.Add(n, new List <Pushpin>());
            }
            _dayAttractions[n].Add(pin);
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: kkurys/TripPlanner
 private void PlotRoute(Individual route, int x)
 {
     Point[] points = new Point[route.Count];
     if (x == -1)
     {
         LBRoutes.Content += "(CURRENT BEST)\nDay: " + Parameters.solutions.Count + "\nLength: " + route.length + " Profit " + route.profit + "\n";
     }
     else
     {
         LBRoutes.Content += "(CURRENT)\nDay: " + Parameters.solutions.Count + "\nLength: " + route.length + " Profit " + route.profit + "\n";
     }
     for (int i = 0; i < route.Count; i++)
     {
         points[i] = new Point(Parameters.Coordinates[route[i], 0] * Parameters.DrawModifier, Parameters.Coordinates[route[i], 1] * Parameters.DrawModifier);
     }
     DrawLine(points, DayColors.GetColor(x));
 }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: kkurys/TripPlanner
        private void AddRoutePart(RouteResult path, int n)
        {
            if (!_dayRealRoads.ContainsKey(n))
            {
                _dayRealRoads.Add(n, new MapPolyline()
                {
                    Locations       = new LocationCollection(),
                    Opacity         = 0.65,
                    Stroke          = DayColors.GetColor(n),
                    StrokeThickness = 5.0,
                    Visibility      = Visibility.Hidden
                });
            }

            foreach (BingServices.Location loc in path.RoutePath.Points)
            {
                _dayRealRoads[n].Locations.Add(new Microsoft.Maps.MapControl.WPF.Location(loc.Latitude, loc.Longitude));
            }
        }
コード例 #4
0
ファイル: MainWindow.xaml.cs プロジェクト: kkurys/TripPlanner
        private void PlotCurrentSolutions()
        {
            for (int x = 0; x < Parameters.solutions.Count; x++)
            {
                Point[] points = new Point[Parameters.solutions[x].Count];
                //   LBFullRoutes.Text += "Day: " + x + ": ";
                for (int i = 0; i < Parameters.solutions[x].Count; i++)
                {
                    points[i] = new Point(Parameters.Coordinates[Parameters.solutions[x][i], 0] * Parameters.DrawModifier, Parameters.Coordinates[Parameters.solutions[x][i], 1] * Parameters.DrawModifier);
                    //   LBFullRoutes.Text += Parameters.solutions[x][i].ToString() + " ";
                }
                DrawLine(points, DayColors.GetColor(x));

                LBRoutes.Content += "Day: " + x + "\nLength: " + Parameters.solutions[x].length + " Profit " + Parameters.solutions[x].profit + "\n";
                //    LBFullRoutes.Text += "\n";
            }
            if (Parameters.solutions.Count == Parameters.daysOfTrip)
            {
                watch.Stop();
                LBExecutionTime.Content = (watch.ElapsedMilliseconds / 1000.0 + " s");
            }
        }
コード例 #5
0
ファイル: MainWindow.xaml.cs プロジェクト: kkurys/TripPlanner
        private void GenerateRouteLines()
        {
            for (int n = 1; n <= Parameters.solutions.Count; n++)
            {
                if (!_dayStraightLines.ContainsKey(n))
                {
                    _dayStraightLines.Add(n, new MapPolyline()
                    {
                        Locations       = new LocationCollection(),
                        Opacity         = 0.65,
                        Stroke          = DayColors.GetColor(n),
                        StrokeThickness = 5.0
                    });
                }

                for (int i = 0; i < Parameters.solutions[n - 1].Count; i++)
                {
                    if (i == 0 || i == Parameters.solutions[n - 1].Count - 1)
                    {
                        _dayStraightLines[n].Locations.Add(new Microsoft.Maps.MapControl.WPF.Location()
                        {
                            Latitude  = Hotel.ActiveHotel.Lat,
                            Longitude = Hotel.ActiveHotel.Long
                        });
                    }
                    else
                    {
                        var _attraction = _attractions[Parameters.solutions[n - 1][i] - 1];
                        _dayStraightLines[n].Locations.Add(new Microsoft.Maps.MapControl.WPF.Location()
                        {
                            Latitude  = _attraction.Lat,
                            Longitude = _attraction.Long
                        });
                        AddAttractionPushpin(_attraction, n, i);
                    }
                }
            }
        }
コード例 #6
0
ファイル: Month.cs プロジェクト: w01f/VolgaTeam.Dashboard
			public MonthColors(Month month)
			{
				m_month = month;
                m_trailingColors = new TrailingColors(this);
                m_weekendColors = new WeekendColors(this);
                m_disabledColors = new DisabledColors(this);
                m_selectedColors = new SelectedColors(this);
                m_focusColors = new FocusColors(this);
                m_dayColors = new DayColors(this);


				// Default values
				                
                m_backColor1 = Color.White;
                m_backColor2 = Color.White;
                m_gradientMode = mcGradientMode.None;
        		                
			}