예제 #1
0
        private void CriarRegiao()
        {
            Arquivo_RGN argn = new Arquivo_RGN();

            argn.CriarRegiaoPadrao();

            argn.Salvar(DiretorioPrincipal + DIRETORIO_REGIOES + @"\brasil.RGN");

            Arquivo_LST alst = new Arquivo_LST();

            alst.listaPaths.Add(@"brasil");

            alst.Salvar(DiretorioPrincipal + DIRETORIO_REGIOES + @"\regioes.lst");
        }
예제 #2
0
        private void CriaMsgLst()
        {
            List <string> msgs = Directory.EnumerateFiles(DiretorioPrincipal + DIRETORIO_MSGS, "*.msg").ToList();

            Arquivo_LST alst = new Arquivo_LST();

            alst.Default();
            alst.listaPaths.Clear();
            alst.qtdArquivos = System.Convert.ToUInt32(msgs.Count);

            foreach (string s in msgs)
            {
                //alst.listaPaths.Add(s);
                alst.listaPaths.Add(s.Substring(DiretorioPrincipal.Length + DIRETORIO_MSGS.Length, s.Length - (DiretorioPrincipal.Length + DIRETORIO_MSGS.Length)).Replace("\\", String.Empty).Replace(Util.Util.ARQUIVO_EXT_MSG, String.Empty));
            }

            alst.AtualizarCRC();
            alst.Salvar(DiretorioPrincipal + DIRETORIO_MSGS + ARQUIVO_LST_MSGS);
        }
예제 #3
0
        private void CriaRotLst()
        {
            //******
            List <string> rots = Directory.EnumerateFiles(DiretorioPrincipal + DIRETORIO_ROTEIROS, "*.rot").ToList();

            Arquivo_LST alst_roteiros = new Arquivo_LST();

            alst_roteiros.Default();
            alst_roteiros.listaPaths.Clear();
            alst_roteiros.qtdArquivos = System.Convert.ToUInt32(rots.Count);

            foreach (string s in rots)
            {
                alst_roteiros.listaPaths.Add(s.Substring(DiretorioPrincipal.Length + DIRETORIO_ROTEIROS.Length,
                                                         s.Length -
                                                         (DiretorioPrincipal.Length + DIRETORIO_ROTEIROS.Length)).Replace("\\", String.Empty).Replace(Util.Util.ARQUIVO_EXT_ROT, String.Empty));
            }

            alst_roteiros.AtualizarCRC();
            alst_roteiros.Salvar(DiretorioPrincipal + DIRETORIO_ROTEIROS + ARQUIVO_LST_ROTEIROS);
        }
예제 #4
0
        private void ReplacePathToPointer(string nomeArquivo, FileStream fs, int indiceArquivo)
        {
            uint enderecoBase = tabelinha.lista[indiceArquivo].offset;

            nomeArquivo = nomeArquivo.ToLower();

            if (nomeArquivo.EndsWith(".fix"))
            {
                // Bom Dia, Boa Tarde e Boa Noite
                for (uint i = 1; i <= 3; i++)
                {
                    EscreveOffSetArquivo(fs, (64 * i), PATH_SIZE_DEFAULT, enderecoBase);
                }
            }
            else if (nomeArquivo.EndsWith(".v01"))
            {
                EscreveOffSetArquivo(fs, 20, PATH_SIZE_V01, enderecoBase);
            }
            else if (nomeArquivo.EndsWith(".mpt"))
            {
                EscreveOffSetArquivo(fs, 64, PATH_SIZE_DEFAULT, enderecoBase);
            }
            else if (nomeArquivo.EndsWith(".rgn"))
            {
                EscreveOffSetArquivo(fs, 64, PATH_SIZE_DEFAULT, enderecoBase);
            }
            else if (nomeArquivo.EndsWith(".cfg"))
            {
                EscreveOffSetArquivo(fs, 12, PATH_SIZE_CFG, enderecoBase);
            }
            else if (nomeArquivo.EndsWith(".rpt"))
            {
                // Ida, Volta e Número
                for (uint i = 1; i <= 3; i++)
                {
                    EscreveOffSetArquivo(fs, (64 * i), PATH_SIZE_DEFAULT, enderecoBase);
                }
            }
            else if (nomeArquivo.EndsWith(".lst"))
            {
                Arquivo_LST arquivo = new Arquivo_LST();
                arquivo.Abrir(this.diretorioRaiz + nomeArquivo);
                uint quantidadeArquivos = arquivo.qtdArquivos;
                // Pegar a quantidade de arquivos
                for (uint i = 1; i <= quantidadeArquivos; i++)
                {
                    EscreveOffSetArquivo(fs, (64 * i), PATH_SIZE_DEFAULT, enderecoBase);
                }
            }
            else if (nomeArquivo.EndsWith(".pls"))
            {
                Arquivo_PLS arquivo = new Arquivo_PLS(diretorioRaiz);
                arquivo.Abrir(this.diretorioRaiz + nomeArquivo);
                uint quantidadeArquivos = arquivo.qtdArquivos;

                // Pegar a quantidade de arquivos
                for (uint i = 1; i <= quantidadeArquivos; i++)
                {
                    EscreveOffSetArquivo(fs, (64 * i), PATH_SIZE_DEFAULT, enderecoBase);
                }
            }
        }