Exemplo n.º 1
0
        private UCAC4Index(string catalogLocation)
        {
            m_CatalogLocation = catalogLocation;

            int idx = -1;

            using (Stream data = AssemblyHelper.GetEmbededResourceStreamThatClientMustDispose("Tangra.StarCatalogues.UCAC4", "ucac4.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 UCAC4 file '{0}'\r\nPlease ensure that you have all necessary catalogue files!", zoneFile), "Tangra", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    int numStarsInZone = (int)fi.Length / UCAC4Entry.Size;

                    ZoneIndex[idx] = new UCAC4BinIndexEntry(idx, numStarsInZone, rdr);
                }
            }
        }
Exemplo n.º 2
0
        private UCAC4Index(string catalogLocation)
        {
            m_CatalogLocation = catalogLocation;

            int idx = -1;

            using (Stream data = AssemblyHelper.GetEmbededResourceStreamThatClientMustDispose("Tangra.StarCatalogues.UCAC4", "ucac4.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 / UCAC4Entry.Size;

                    ZoneIndex[idx] = new UCAC4BinIndexEntry(idx, numStarsInZone, rdr);
                }
            }
        }
Exemplo n.º 3
0
        private UCAC4Index(string catalogLocation)
        {
            m_CatalogLocation = catalogLocation;

            int idx = -1;
            using (Stream data = AssemblyHelper.GetEmbededResourceStreamThatClientMustDispose("Tangra.StarCatalogues.UCAC4", "ucac4.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 / UCAC4Entry.Size;

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