Click here to Skip to main content
15,892,768 members
Articles / Programming Languages / C#

Universal Framework for Science and Engineering - Part 6: Determination of Orbits of Artificial Satellites

Rate me:
Please Sign up or sign in to vote.
4.88/5 (28 votes)
8 Jul 2011CPOL19 min read 82.5K   6.6K   82  
An article on framework applications to determine the orbits of artificial satellites
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using System.IO;

using System.Drawing;


using DiagramUI.Utils;

using DataPerformer.Interfaces;

using DataPerformerUI.Interfaces;

namespace DataPerformerUI
{
    /// <summary>
    /// Performer of oprerations of this assembly
    /// </summary>
    static class StaticPerformer
    {
        /// <summary>
        /// Shows error
        /// </summary>
        /// <param name="control">Control</param>
        /// <param name="exception">Error exception</param>
        static internal void ShowError(this Control control, Exception exception)
        {
            control.ShowError(exception, DataPerformerUI.Utils.ControlUtilites.Resources);
        }

 
        /// <summary>
        /// Loads resources for control
        /// </summary>
        /// <param name="control"></param>
        static internal void LoadResources(this Control control)
        {
            control.LoadControlResources(DataPerformerUI.Utils.ControlUtilites.Resources);
        }

        /// <summary>
        /// Copies internal data
        /// </summary>
        /// <param name="source">Source</param>
        /// <param name="target">Target</param>
        static internal void Copy(this IGraphLabel source, IGraphLabel target)
        {
            target.Argument = source.Argument;
            target.Colors = source.Colors;
            target.StepChart = source.StepChart;
            target.Condition = source.Condition;
            target.SplitDistance = source.SplitDistance;
            target.Start = source.Start;
            target.StepCount = source.StepCount;
            target.Texts = source.Texts;
            target.Points = source.Points;
        }

        static internal object[] DefaultSeriesPaintingArray
        {
            get
            {
                return new object[] { (int)(-1), Color.Black, new ICollection[0], false };
            }
        }


        static internal int GetDrawMode(this object[] array)
        {
            return (int)array[0];
        }

        static internal Color GetColor(this object[] array)
        {
            return (Color)array[1];
        }
        static internal ICollection[] GetComments(this object[] array)
        {
            return (ICollection[])array[2];
        }
        static internal bool GetShowTable(this object[] array)
        {
            return (bool)array[3];
        }

        static internal void SetDrawMode(this object[] array, int mode)
        {
            array[0] = mode;
        }

        static internal void SetColor(this object[] array, Color color)
        {
            array[1] = color;
        }
        static internal void SetComments(this object[] array, ICollection[] comments)
        {
            array[2] = comments; ;
        }
        static internal void SetShowTable(this object[] array, bool showTable)
        {
            array[3] = showTable;
        }

        static internal void Fill(this INamedCoordinates coord, ToolStripComboBox cx, ToolStripComboBox cy)
        {
            string x = coord.X;
            string y = coord.Y;
            cx.Text = "<X>";
            cx.Items.Clear();
            IList<string> l = coord.GetNames("x");
            if (l != null)
            {
                cx.FillCombo(l);
                if (x != null)
                {
                    cx.SelectCombo(x);
                }
            }
            cy.Text = "<Y>";
            cy.Items.Clear();
            l = coord.GetNames("y");
            if (l != null)
            {
                cy.FillCombo(l);
                if (y != null)
                {
                    cy.SelectCombo(y);
                }
            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Russian Federation Russian Federation
Ph. D. Petr Ivankov worked as scientific researcher at Russian Mission Control Centre since 1978 up to 2000. Now he is engaged by Aviation training simulators http://dinamika-avia.com/ . His additional interests are:

1) Noncommutative geometry

http://front.math.ucdavis.edu/author/P.Ivankov

2) Literary work (Russian only)

http://zhurnal.lib.ru/editors/3/3d_m/

3) Scientific articles
http://arxiv.org/find/all/1/au:+Ivankov_Petr/0/1/0/all/0/1

Comments and Discussions