Ejemplo n.º 1
0
 public SkyObject(CatalogEntry entry, Blob blob)
 {
     CatEntry = entry;
     ObjectBlob = blob;
     Name = CatEntry.Name;
     Position = CatEntry.Position;
 }
Ejemplo n.º 2
0
 public bool Lookup(string gcNum, out CatalogEntry entry)
 {
     entry = null;
     if (entries.ContainsKey(gcNum))
         entry = entries[gcNum];
     return entry != null;
 }
Ejemplo n.º 3
0
 private void btnSearch_Click(object sender, EventArgs e)
 {
     CatalogEntry entry;
     if ((txtName.Text != "") & (Program.GC.GetStarByName(txtName.Text, out entry)))
         Entry = entry;
     else if (txtGC.Text != "")
         Entry = Program.GC[txtGC.Text];
 }
Ejemplo n.º 4
0
        public bool GetStarAtPosition(double ra, double de, double raError, double deError, out CatalogEntry entry)
        {
            CatalogEntry[] entries = this.entries.Values.ToArray();

            for (int i = 0; i < entries.Length; i++)
            {
                if (entries[i].IsNearPosition(new SkyVector(ra, de), new SkyVector(raError, deError)))
                {
                    entry = entries[i];
                    return true;
                }
            }
            entry = null;
            return false;
        }
Ejemplo n.º 5
0
        public bool GetStarByName(string name, out CatalogEntry entry)
        {
            CatalogEntry[] entries = this.entries.Values.ToArray();

            for (int i = 0; i < entries.Length; i++)
            {
                if ((entries[i].Name == name) | (entries[i].AltName == name))
                {
                    entry = entries[i];
                    return true;
                }
            }
            entry = null;
            return false;
        }
Ejemplo n.º 6
0
        private void btnAssign_Click(object sender, EventArgs e)
        {
            int temp;
            SAOEntry temp2;

            if (txtName.Text == "")
            {
                MessageBox.Show("The Name field is required.");
                return;
            }

            Obj.Name = txtName.Text;

            if (chkAddToCatalog.Checked)
            {
                if (txtGC.Text == "")
                {
                    MessageBox.Show("The GC Number field is required.");
                    return;
                }
                if (txtGC.Text.Length != 3)
                {
                    MessageBox.Show("The GC Number must be 3 digits long.");
                    return;
                }
                if (!int.TryParse(txtGC.Text, out temp))
                {
                    MessageBox.Show("The GC Number field must contain only digits.");
                    return;
                }

                if ((txtSAO.Text != "") && (!Program.SAO.Lookup(txtSAO.Text, out temp2)))
                {
                    MessageBox.Show("The SAO field does not contain a valid SAO number.");
                    return;
                }

                CatalogEntry entry = new CatalogEntry(txtName.Text, txtAltName.Text, txtSAO.Text, txtGC.Text, Obj.Position);
                Obj.CatEntry = entry;
            }

            DialogResult = System.Windows.Forms.DialogResult.OK;
            Close();
        }
Ejemplo n.º 7
0
        public void AddEntry(CatalogEntry entry)
        {
            if (entries.ContainsKey(entry.GC))
                throw new ArgumentException("Grider Catalog entry with that number already exists.");

            entries.Add(entry.GC, entry);
        }
Ejemplo n.º 8
0
 public bool GetStarAtPosition(SkyVector position, double raError, double deError, out CatalogEntry entry)
 {
     return GetStarAtPosition(position.RA, position.DE, raError, deError, out entry);
 }
Ejemplo n.º 9
0
 public bool GetStarAtPosition(HourAngle ra, Angle de, double raError, double deError, out CatalogEntry entry)
 {
     return GetStarAtPosition(ra.Degrees.Fractional, de.Fractional, raError, deError, out entry);
 }