Esempio n. 1
0
        private void MainVisualization_form_Load(object sender, EventArgs e)
        {
            ElementHost host = new ElementHost();

            host.Dock = DockStyle.Fill;

            OrbitsCalculator orbitsCalculator = new OrbitsCalculator();

            // Initialize array of orbits data. One for each satellite
            double[] _ECCENTRICITY = new double[_tle_sat_list.Count];
            double[] _INCLINATION  = new double[_tle_sat_list.Count];
            double[] _SEMIAXIS     = new double[_tle_sat_list.Count];
            double[] _RAAN         = new double[_tle_sat_list.Count];
            double[] _PERIOD       = new double[_tle_sat_list.Count];

            foreach (TLE_Sat tle_sat in _tle_sat_list)
            {
                int index = _tle_sat_list.IndexOf(tle_sat);
                _ECCENTRICITY[index] = tle_sat.Sat_Eccentricity;
                _INCLINATION[index]  = tle_sat.Sat_Inclination;
                _SEMIAXIS[index]     = tle_sat.Sat_SemiAxis / 10000;
                _RAAN[index]         = tle_sat.Sat_RightAscension;
                _PERIOD[index]       = 1 / tle_sat.Sat_MeanMotion;
            }

            uc = new HostingWPFUserControl.UserControl1(orbitsCalculator, _INCLINATION, _RAAN, _SEMIAXIS, _ECCENTRICITY, _PERIOD);

            uc._EARTH_RADIUS = Sat_Constants.EARTH_RADIOUS_constant * Sat_Constants.VISUALIZATION3D_SCALE;

            // This method initializes satellites into viewport
            uc.LoadSatellitesToViewPort(_tle_sat_list.Count);

            host.Child = uc;
            MainPanel.Controls.Add(host);
        }
Esempio n. 2
0
        public UserControl1(OrbitsCalculator orbitsCalculator, double[] INCLINATION, double[] RAAN, double[] SEMIAXIS, double[] ECCENTRICITY, double[] PERIOD)
        {
            InitializeComponent();
            _orbitsCalculator = orbitsCalculator;
            //this.DataContext = orbitsCalculator;

            _INCLINATION  = INCLINATION;
            _RAAN         = RAAN;
            _SEMIAXIS     = SEMIAXIS;
            _ECCENTRICITY = ECCENTRICITY;
            _PERIOD       = PERIOD;

            tle_sat_count             = INCLINATION.Count();
            SatelliteInclinationAngle = new double[tle_sat_count];
        }