Example #1
0
        //Carrega os consolos disponíveis, com seus respectivos nomes, larguras de apoio
        //e quantidade de arquivos com o mesmo nome (IDuplo)
        public void CONSOLOS_LER()
        {
            int           ISTAT    = 0;
            int           ISTCONS  = 0;
            StringBuilder NOMCONS  = new StringBuilder(256);
            int           IDUPLO   = 0;
            double        ALARGAPO = 0;

            //Lendo arquivo CONSOLOS.DAT no disco
            RINTCONS.LERDISCO(ref ISTAT);
            //Lendo dados dos consolos
            RINTCONS.PREPLER();
            //Instanciar memória para os dados dos consolos
            ListConsole = new ObservableCollection <ConsoleModel>();
            while (ISTCONS == 0)
            {
                RINTCONS.LERPROX(NOMCONS, 0, ref IDUPLO, ref ALARGAPO, ref ISTCONS);
                if (ISTCONS != 0)
                {
                    break;
                }
                ConsoleModel cons = new ConsoleModel();
                cons.Nomcons  = NOMCONS.ToString();
                cons.Alargapo = ALARGAPO;
                cons.IDuplo   = IDUPLO + 1;
                ListConsole.Add(cons);
            }
        }
Example #2
0
        public void INITIAL_LOAD()
        {
            StringBuilder ACESSOLSTRING = new StringBuilder(256);
            int           IPID          = 0;

            ACESSOL_METHODS.ACL_INIACESSO();
            ACESSOL_METHODS.ACLGETPID(ref IPID);
            if (IPID != 0)
            {
                RINTCONS.DEFPID(ref IPID);
            }
            READ_BUILDING();
        }
Example #3
0
        public void Console_Options(byte opcao)
        {
            //Variáveis para RINTCONS_PEGRESULT
            int           ITIPOCONS = 0; int ITIPOCALC = 0; int ISTCONS = 0; double ISTAT = 0;
            double        ASTIR = 0; double ASMINTIR = 0; int NRAMOSTIR = 0; double BITOLATIR = 0;
            double        ASCOST = 0; int NBITCOST = 0; double BITOLCOST = 0; double ESPCOST = 0;
            int           NBITTRANSV = 0; int NRAMOSTRANS = 0; double BITOLTRANS = 0; double ASTRANSV = 0;
            double        ESPTRANSV = 0; double TALWU = 0; double TALWD = 0;
            StringBuilder MSGERRO = new StringBuilder(256);

            //Variáveis para RINTCONS_PEGCRIT
            double FCK = 0; double COBR = 0; double GAMAC = 0; double GAMAS = 0; double GAMAF = 0;
            double GAMANCONSOLO = 0; int INORMADETLHA = 0; double FHORIMINCONS = 0; int ICONCRCONSOL = 0;
            double TXMECMINCONS = 0; int ITPANCORCONS = 0; int IFORCONSMCUR = 0; double BITMNTIRCONS = 0; double BITMNCOSCONS = 0;
            double ESPMNCOSCONS = 0; double BITMNTRACONS = 0; double BITMXTRACONS = 0; double BITCONSTCONS = 0; double CMNDBRTRCONS = 0;
            double ESCCONLONG = 0; double ESCCONTRAN = 0;

            //Variável para RINTCONS_NOMEPADRAODWG
            StringBuilder NOMEDWG = new StringBuilder(260);


            //Opção:
            //0 - Ler
            //1 - Atualizar Desenho
            //2 - Gravar no disco

            if (opcao == 0)
            {
                Ler(ConsoleSelectedItem);
                Populate_controls();
            }
            else if (opcao == 1)
            {
                Atualizar();
            }
            else
            {
                Gravar();
            }

            void Populate_controls()
            {
                ConsoleSelectedItem.Nramostir    = NRAMOSTIR;
                ConsoleSelectedItem.Bitolatir    = BITOLATIR;
                ConsoleSelectedItem.Nbitcost     = NBITCOST;
                ConsoleSelectedItem.Bitolcost    = BITOLCOST;
                ConsoleSelectedItem.Nbittransv   = NBITTRANSV;
                ConsoleSelectedItem.Nramostrans  = NRAMOSTRANS;
                ConsoleSelectedItem.Bitoltrans   = BITOLTRANS;
                ConsoleSelectedItem.Bitconstcons = BITCONSTCONS; //Verificar se é esta variável mesmo.
                //Cópia independente do consolo selecionado
                ConsoleBackup = ConsoleSelectedItem.DeepCopy();
            }

            //Opcao 0
            void Ler(ConsoleModel consolo, string nomcons = "")
            {
                StringBuilder Nomcons = new StringBuilder(260);

                nomcons = nomcons == "" ? ConsoleSelectedItem.Nomcons : nomcons;
                Nomcons.Append(nomcons);
                int    iduplo   = consolo.IDuplo - 1;
                double alargapo = consolo.Alargapo;

                RINTCONS.LERCONSOLO(Nomcons, 0, ref iduplo, ref alargapo, ref ISTCONS);
                if (ISTCONS != 0)
                {
                    MessageBox.Show("Erro ao ler consolo" + consolo.Nomcons + consolo.IDuplo.ToString(), "TQS", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }
                RINTCONS.PEGRESULT(ref ITIPOCONS, ref ITIPOCALC, ref ASTIR, ref ASMINTIR, ref NRAMOSTIR, ref BITOLATIR, ref ASCOST,
                                   ref NBITCOST, ref BITOLCOST, ref ESPCOST, ref NBITTRANSV, ref NRAMOSTRANS, ref BITOLTRANS,
                                   ref ASTRANSV, ref ESPTRANSV, ref TALWU, ref TALWD, ref ISTAT, MSGERRO, 0);

                RINTCONS.PEGCRIT(ref FCK, ref COBR, ref GAMAC, ref GAMAS, ref GAMAF, ref GAMANCONSOLO, ref INORMADETLHA, ref FHORIMINCONS,
                                 ref ICONCRCONSOL, ref TXMECMINCONS, ref ITPANCORCONS, ref IFORCONSMCUR, ref BITMNCOSCONS, ref BITMNCOSCONS,
                                 ref ESPMNCOSCONS, ref BITMNTRACONS, ref BITMXTRACONS, ref BITCONSTCONS, ref CMNDBRTRCONS, ref ESCCONLONG, ref ESCCONTRAN);
            }

            //Opcao 1
            void Atualizar()
            {
                StringBuilder Nomcons = new StringBuilder(260);

                Nomcons.Append(ConsoleSelectedItem.Nomcons);
                int    iduplo   = ConsoleSelectedItem.IDuplo - 1;
                double alargapo = ConsoleSelectedItem.Alargapo;

                RINTCONS.LERCONSOLO(Nomcons, 0, ref iduplo, ref alargapo, ref ISTCONS);
                if (ISTCONS != 0)
                {
                    MessageBox.Show("Erro ao ler consolo" + ConsoleSelectedItem.Nomcons + ConsoleSelectedItem.IDuplo.ToString(), "TQS", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }
                RINTCONS.PEGRESULT(ref ITIPOCONS, ref ITIPOCALC, ref ASTIR, ref ASMINTIR, ref NRAMOSTIR, ref BITOLATIR, ref ASCOST,
                                   ref NBITCOST, ref BITOLCOST, ref ESPCOST, ref NBITTRANSV, ref NRAMOSTRANS, ref BITOLTRANS,
                                   ref ASTRANSV, ref ESPTRANSV, ref TALWU, ref TALWD, ref ISTAT, MSGERRO, 0);

                RINTCONS.PEGCRIT(ref FCK, ref COBR, ref GAMAC, ref GAMAS, ref GAMAF, ref GAMANCONSOLO, ref INORMADETLHA, ref FHORIMINCONS,
                                 ref ICONCRCONSOL, ref TXMECMINCONS, ref ITPANCORCONS, ref IFORCONSMCUR, ref BITMNCOSCONS, ref BITMNCOSCONS,
                                 ref ESPMNCOSCONS, ref BITMNTRACONS, ref BITMXTRACONS, ref BITCONSTCONS, ref CMNDBRTRCONS, ref ESCCONLONG, ref ESCCONTRAN);

                //IMPLEMENTAR AQUI SALVAR E ATUALIZAR O DESENHO

                NRAMOSTIR    = ConsoleSelectedItem.Nramostir;
                BITOLATIR    = ConsoleSelectedItem.Bitolatir;
                NBITCOST     = ConsoleSelectedItem.Nbitcost;
                BITOLCOST    = ConsoleSelectedItem.Bitolcost;
                NBITTRANSV   = ConsoleSelectedItem.Nbittransv;
                NRAMOSTRANS  = ConsoleSelectedItem.Nramostrans;
                BITOLTRANS   = ConsoleSelectedItem.Bitoltrans;
                BITCONSTCONS = ConsoleSelectedItem.Bitconstcons;

                RINTCONS.DEFRESULT(ref NRAMOSTIR, ref BITOLATIR, ref NBITCOST, ref BITOLCOST, ref ESPCOST, ref NBITTRANSV, ref NRAMOSTRANS,
                                   ref BITOLTRANS, ref ASTRANSV, ref ESPTRANSV);

                RINTCONS.DEFCRIT(ref FCK, ref COBR, ref GAMAC, ref GAMAS, ref GAMAF, ref GAMANCONSOLO, ref INORMADETLHA, ref FHORIMINCONS,
                                 ref ICONCRCONSOL, ref TXMECMINCONS, ref ITPANCORCONS, ref IFORCONSMCUR, ref BITMNTIRCONS, ref BITMNCOSCONS, ref ESPMNCOSCONS,
                                 ref BITMNTRACONS, ref BITMXTRACONS, ref BITCONSTCONS, ref CMNDBRTRCONS, ref ESCCONLONG, ref ESCCONTRAN);

                NOMEDWG.Append("PREVIEW_" + (iduplo + 1).ToString("00"));

                RINTCONS.GERARDWG(NOMEDWG, 0, ref ISTCONS);
                INITIAL_LOAD();
                CONSOLOS_LER();
                Ler(ConsoleBackup);
            }

            //Opcao 2
            void Gravar()
            {
                Ler(ConsoleSelectedItem);
                StringBuilder Nomcons = new StringBuilder(260);

                Nomcons.Append(ConsoleSelectedItem.Nomcons);
                int    iduplo   = ConsoleSelectedItem.IDuplo - 1;
                double alargapo = ConsoleSelectedItem.Alargapo;

                RINTCONS.LERCONSOLO(Nomcons, 0, ref iduplo, ref alargapo, ref ISTCONS);
                if (ISTCONS != 0)
                {
                    MessageBox.Show("Erro ao ler consolo" + ConsoleSelectedItem.Nomcons + ConsoleSelectedItem.IDuplo.ToString(), "TQS", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }
                RINTCONS.PEGRESULT(ref ITIPOCONS, ref ITIPOCALC, ref ASTIR, ref ASMINTIR, ref NRAMOSTIR, ref BITOLATIR, ref ASCOST,
                                   ref NBITCOST, ref BITOLCOST, ref ESPCOST, ref NBITTRANSV, ref NRAMOSTRANS, ref BITOLTRANS,
                                   ref ASTRANSV, ref ESPTRANSV, ref TALWU, ref TALWD, ref ISTAT, MSGERRO, 0);

                RINTCONS.PEGCRIT(ref FCK, ref COBR, ref GAMAC, ref GAMAS, ref GAMAF, ref GAMANCONSOLO, ref INORMADETLHA, ref FHORIMINCONS,
                                 ref ICONCRCONSOL, ref TXMECMINCONS, ref ITPANCORCONS, ref IFORCONSMCUR, ref BITMNCOSCONS, ref BITMNCOSCONS,
                                 ref ESPMNCOSCONS, ref BITMNTRACONS, ref BITMXTRACONS, ref BITCONSTCONS, ref CMNDBRTRCONS, ref ESCCONLONG, ref ESCCONTRAN);

                //IMPLEMENTAR AQUI SALVAR E ATUALIZAR O DESENHO

                NRAMOSTIR    = ConsoleSelectedItem.Nramostir;
                BITOLATIR    = ConsoleSelectedItem.Bitolatir;
                NBITCOST     = ConsoleSelectedItem.Nbitcost;
                BITOLCOST    = ConsoleSelectedItem.Bitolcost;
                NBITTRANSV   = ConsoleSelectedItem.Nbittransv;
                NRAMOSTRANS  = ConsoleSelectedItem.Nramostrans;
                BITOLTRANS   = ConsoleSelectedItem.Bitoltrans;
                BITCONSTCONS = ConsoleSelectedItem.Bitconstcons;

                RINTCONS.DEFRESULT(ref NRAMOSTIR, ref BITOLATIR, ref NBITCOST, ref BITOLCOST, ref ESPCOST, ref NBITTRANSV, ref NRAMOSTRANS,
                                   ref BITOLTRANS, ref ASTRANSV, ref ESPTRANSV);

                RINTCONS.DEFCRIT(ref FCK, ref COBR, ref GAMAC, ref GAMAS, ref GAMAF, ref GAMANCONSOLO, ref INORMADETLHA, ref FHORIMINCONS,
                                 ref ICONCRCONSOL, ref TXMECMINCONS, ref ITPANCORCONS, ref IFORCONSMCUR, ref BITMNTIRCONS, ref BITMNCOSCONS, ref ESPMNCOSCONS,
                                 ref BITMNTRACONS, ref BITMXTRACONS, ref BITCONSTCONS, ref CMNDBRTRCONS, ref ESCCONLONG, ref ESCCONTRAN);

                NOMEDWG = new StringBuilder(260);
                RINTCONS.NOMEPADRAODWG(NOMEDWG, 0);
                RINTCONS.GERARDWG(NOMEDWG, 0, ref ISTCONS);
                RINTCONS.GRVDISCO(ref ISTCONS);
            }
        }