Exemple #1
0
        /// <summary>
        /// Constructeur de la classe TaskForm
        /// </summary>
        /// <param name="astro">Les Astronautes de la missions</param>
        /// <param name="categ">Les catégories d'activités</param>
        /// <param name="form">Le type d'action (ajout ou édition)</param>
        /// <param name="day">Le jour ou est rajouté la tâche</param>
        /// <param name="MapString">Le chemin vers l'image de la carte</param>
        /// <param name="xOrigin">La position en X de la base</param>
        /// <param name="yOrigin">La position en Y de la base</param>
        public TaskForm(List <Astronaut> astro, List <Category> categ, string form, Day day, string MapString, int xOrigin, int yOrigin)
        {
            InitializeComponent();
            Astronauts     = astro;
            Categories     = categ;
            this.ActualDay = day;
            this.MapString = MapString;
            this.MapImage  = Image.FromFile(this.MapString);
            Image img = Image.FromFile(MapString);

            imageCross  = Astronauts_Activities.Properties.Resources.crossImage;
            this.graMap = MapPic.CreateGraphics();
            this.xMap   = xOrigin;
            this.yMap   = yOrigin;
            MapPic.Invalidate();

            //Initialisation astronautes
            foreach (Astronaut A in Astronauts)
            {
                AstronautView.Items.Add(A.Name);
            }

            foreach (Category c in Categories)
            {
                TreeNode n = ActivityView.Nodes.Add(c.Name);

                foreach (Activity Act in c.Activities)
                {
                    TreeNode NiveauSup = n.Nodes.Add(Act.Name);
                    if (Act.Activities != null)
                    {
                        foreach (Activity Act2 in Act.Activities)
                        {
                            NiveauSup.Nodes.Add(Act2.Name);
                        }
                    }
                }
            }

            //Initialisation bouton fin
            TypeForm = form;
            if (TypeForm == "adding")
            {
                buttonAddActivity.Text = "Add Task";
            }
            else if (TypeForm == "editing")
            {
                buttonAddActivity.Text = "Edit Task";
            }
        }
Exemple #2
0
        /// <summary>
        /// Cette méthode va trouver les différentes tâche qui s'éxécutent en dehors de la Map et va les indiquer sur la carte.
        /// </summary>
        private void MapPic_Paint()
        {
            Marqueurs.Clear();
            SelectedDay.Clear();
            for (int i = (int)StartDaySelector.Value; i <= EndDaySelector.Value; i++)
            {
                SelectedDay.Add(mission.PlanningMission.Calendar[i - 1]);
            }

            foreach (Day d in SelectedDay)
            {
                foreach (Task t in d.Tasks)
                {
                    if (t.Xposition != mission.xOrigin && t.Yposition != mission.yOrigin)
                    {
                        Marqueurs.Add(t);
                    }
                }
            }
            MapPic.Invalidate();
        }
Exemple #3
0
        /// <summary>
        /// Constructeur de la classe Map
        /// </summary>
        /// <param name="mission">Mission : Objet représentant la mission complète en cours</param>
        public MissionMap(Mission mission)
        {
            InitializeComponent();

            this.mission = mission;
            MapString    = mission.Map;
            SelectedDay  = new List <Day>();
            for (int i = (int)StartDaySelector.Value; i <= EndDaySelector.Value; i++)
            {
                SelectedDay.Add(mission.PlanningMission.Calendar[i - 1]);
            }
            MapGraph   = MapPic.CreateGraphics();
            imageCross = Astronauts_Activities.Properties.Resources.crossImage;

            Marqueurs = new List <Task>();
            try { MapImage = Image.FromFile(MapString); }
            catch {
                MessageBox.Show("Error: No map has been loaded");
            }
            rectangles = new List <Rectangle>();
        }