Пример #1
0
        private UCAC3Index(string catalogLocation)
        {
            m_CatalogLocation = catalogLocation;
            int idx = -1;

            using (Stream data = AssemblyHelper.GetEmbededResourceStreamThatClientMustDispose("Tangra.StarCatalogues.UCAC3", "ucac3.idx"))
            {
                BinaryReader rdr = new BinaryReader(data);

                while (rdr.BaseStream.Position < rdr.BaseStream.Length)
                {
                    idx++;
                    string   zoneFile       = Path.GetFullPath(string.Format("{0}\\z{1}", catalogLocation, (idx + 1).ToString("000")));
                    FileInfo fi             = new FileInfo(zoneFile);
                    int      numStarsInZone = (int)fi.Length / UCAC3Entry.Size;

                    ZoneIndex[idx] = new UCAC3BinIndexEntry(idx, numStarsInZone, rdr);
                }
            }
        }
Пример #2
0
        private UCAC3Index(string catalogLocation)
        {
            m_CatalogLocation = catalogLocation;
            int idx = -1;

            using (Stream data = AssemblyHelper.GetEmbededResourceStreamThatClientMustDispose("Tangra.StarCatalogues.UCAC3", "ucac3.idx"))
            {
                BinaryReader rdr = new BinaryReader(data);

                while (rdr.BaseStream.Position < rdr.BaseStream.Length)
                {
                    idx++;
                    string   zoneFile = Path.GetFullPath(string.Format("{0}\\z{1}", catalogLocation, (idx + 1).ToString("000")));
                    FileInfo fi       = new FileInfo(zoneFile);
                    if (!fi.Exists)
                    {
                        MessageBox.Show(null, string.Format("Cannnot find UCAC3 file '{0}'\r\nPlease ensure that you have all necessary catalogue files!", zoneFile), "Tangra", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    int numStarsInZone = (int)fi.Length / UCAC3Entry.Size;

                    ZoneIndex[idx] = new UCAC3BinIndexEntry(idx, numStarsInZone, rdr);
                }
            }
        }
Пример #3
0
        private UCAC3Index(string catalogLocation)
        {
            m_CatalogLocation = catalogLocation;
            int idx = -1;
            using (Stream data = AssemblyHelper.GetEmbededResourceStreamThatClientMustDispose("Tangra.StarCatalogues.UCAC3", "ucac3.idx"))
            {
                BinaryReader rdr = new BinaryReader(data);

                while (rdr.BaseStream.Position < rdr.BaseStream.Length)
                {
                    idx++;
                    string zoneFile = Path.GetFullPath(string.Format("{0}\\z{1}", catalogLocation, (idx + 1).ToString("000")));
                    FileInfo fi = new FileInfo(zoneFile);
                    int numStarsInZone = (int)fi.Length / UCAC3Entry.Size;

                    ZoneIndex[idx] = new UCAC3BinIndexEntry(idx, numStarsInZone, rdr);
                }
            }
        }