Exemple #1
0
        public void generateRemainingTimetabling(string fixedPath, Thread loadingThread)
        {
            try
            {
                string path = "comp01";

                GenerateInstance instance = new GenerateInstance();
                instance.main(path);

                ResetILS();

                IO.Read(path, fixedPath);
                Solution solution = new Solution();
                ILS      ils      = new ILS();
                solution = ils.FindSolution();

                IO.Write(solution.assignments, solution.GetScore());
                insertSolutionOnSystem(IO.filename);
                loadingThread.Abort();
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }
        }
Exemple #2
0
        public List <ILS> FillILSs()
        {
            List <ILS> list = new List <ILS>();

            if (this.ConnectioString != null)
            {
                try
                {
                    using (var conn = new SQLiteConnection(this.ConnectioString))
                    {
                        conn.Open();

                        SQLiteCommand    cmd = new SQLiteCommand(@"SELECT * FROM ILS", conn);
                        SQLiteDataReader r   = cmd.ExecuteReader();

                        while (r.Read())
                        {
                            ILS ils = new ILS();

                            ils.ils_id            = r.GetValue(0) != DBNull.Value ? r.GetInt64(0) : 0;
                            ils.ident             = r.GetValue(1) != DBNull.Value ? r.GetString(1) : "";
                            ils.name              = r.GetValue(2) != DBNull.Value ? r.GetString(2) : "";
                            ils.region            = r.GetValue(3) != DBNull.Value ? r.GetString(3) : "";
                            ils.frequency         = r.GetValue(4) != DBNull.Value ? r.GetInt64(4) : 0;
                            ils.range             = r.GetValue(5) != DBNull.Value ? r.GetInt64(5) : 0;
                            ils.mag_var           = r.GetValue(6) != DBNull.Value ? r.GetDouble(6) : 0;
                            ils.has_backcourse    = r.GetValue(7) != DBNull.Value ? r.GetInt64(7) : 0;
                            ils.dme_range         = r.GetValue(8) != DBNull.Value ? r.GetInt64(8) : 0;
                            ils.dme_altitude      = r.GetValue(9) != DBNull.Value ? r.GetInt64(9) : 0;
                            ils.dme_lonx          = r.GetValue(10) != DBNull.Value ? r.GetDouble(10) : 0;
                            ils.dme_laty          = r.GetValue(11) != DBNull.Value ? r.GetDouble(11) : 0;
                            ils.gs_range          = r.GetValue(12) != DBNull.Value ? r.GetInt64(12) : 0;
                            ils.gs_pitch          = r.GetValue(13) != DBNull.Value ? r.GetDouble(13) : 0;
                            ils.gs_altitude       = r.GetValue(14) != DBNull.Value ? r.GetInt64(14) : 0;
                            ils.gs_lonx           = r.GetValue(15) != DBNull.Value ? r.GetDouble(15) : 0;
                            ils.gs_laty           = r.GetValue(16) != DBNull.Value ? r.GetDouble(16) : 0;
                            ils.loc_runway_end_id = r.GetValue(17) != DBNull.Value ? r.GetInt64(17) : 0;
                            ils.loc_airport_ident = r.GetValue(18) != DBNull.Value ? r.GetString(18) : "";
                            ils.loc_runway_name   = r.GetValue(19) != DBNull.Value ? r.GetString(19) : "";
                            ils.loc_heading       = r.GetValue(20) != DBNull.Value ? r.GetDouble(20) : 0;
                            ils.loc_width         = r.GetValue(21) != DBNull.Value ? r.GetDouble(21) : 0;
                            ils.end1_lonx         = r.GetValue(22) != DBNull.Value ? r.GetDouble(22) : 0;
                            ils.end1_laty         = r.GetValue(23) != DBNull.Value ? r.GetDouble(23) : 0;
                            ils.end_mid_lonx      = r.GetValue(24) != DBNull.Value ? r.GetDouble(24) : 0;
                            ils.end_mid_laty      = r.GetValue(25) != DBNull.Value ? r.GetDouble(25) : 0;
                            ils.end2_lonx         = r.GetValue(26) != DBNull.Value ? r.GetDouble(26) : 0;
                            ils.end2_laty         = r.GetValue(27) != DBNull.Value ? r.GetDouble(27) : 0;
                            ils.altitude          = r.GetValue(28) != DBNull.Value ? r.GetInt64(28) : 0;
                            ils.lonx              = r.GetValue(29) != DBNull.Value ? r.GetDouble(29) : 0;
                            ils.laty              = r.GetValue(30) != DBNull.Value ? r.GetDouble(30) : 0;

                            list.Add(ils);
                        }
                    }
                }
                catch (Exception ex)
                {
                }
            }
            return(list);
        }