Exemplo n.º 1
0
        public string OEE()
        {
            DXM_Procotolo dxm = new DXM_Procotolo(Program.dxm.IPAddress);
            string        dir = string.Format(@"{0}wwwroot\script\", AppContext.BaseDirectory);

            return(Convert.ToString(dxm.EnviaArquivo("OEE.sb", dir)));
        }
Exemplo n.º 2
0
 public IActionResult turno()
 {
     dxm = new DXM_Procotolo(Program.dxm.IPAddress);
     if (!Program.registrado)
     {
         return(RedirectToAction("index", "licenca"));
     }
     return(View(Program.mapa.turnos));
 }
Exemplo n.º 3
0
        public string check()
        {
            string        ret = "";
            DXM_Procotolo dxm = new DXM_Procotolo(Program.dxm.IPAddress);

            if (dxm.verificaTrava())
            {
                ret = "Travado";
            }
            else
            {
                ret = "destravado";
            }
            return(Convert.ToString(ret));
        }
Exemplo n.º 4
0
        public string delete()
        {
            DXM_Procotolo dxm = new DXM_Procotolo(Program.dxm.IPAddress);

            return(Convert.ToString(dxm.deleteFile("OEE.sb")));
        }
Exemplo n.º 5
0
        public string destrava()
        {
            DXM_Procotolo dxm = new DXM_Procotolo(Program.dxm.IPAddress);

            return(Convert.ToString(dxm.destravar()));
        }
Exemplo n.º 6
0
        public static void DXMLog()
        {
            int contador = 0;

            while (true)
            {
                long hora       = DateTime.Now.ToFileTime();
                int  linhas     = vt.quantidade;
                int  comparador = vt.tickLog + 60;
                contador++;

                if (contador > comparador && dxm.Connected)
                {
                    ///*
                    loging = true;
                    try
                    {
                        DXM_Procotolo dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                        if (dxm_api.FileExist("Sbfile1.dat"))
                        {
                            dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                            string        tempStr  = "";
                            string        tempStr2 = "";
                            List <string> temp     = new List <string>();
                            List <string> temp2    = new List <string>();
                            dxm_api.destravar();
                            dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                            temp2   = dxm_api.getFile("LogFile1.txt");
                            Thread.Sleep(200);
                            dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                            temp    = dxm_api.getFile("Sbfile1.dat");
                            try {
                                if (temp[0] == "")
                                {
                                }
                                else
                                {
                                    for (int x = 0; x < temp2.Count; x++)
                                    {
                                        tempStr2 = tempStr2 + temp2[x];
                                    }
                                    for (int x = 0; x < temp.Count; x++)
                                    {
                                        tempStr = tempStr + temp[x];
                                    }
                                    vt.flush();
                                    banco.exec_log(tempStr, vt.quantidade, tempStr2);
                                    dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                                    dxm_api.deleteFile("Sbfile1.dat");
                                    Thread.Sleep(200);
                                    dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                                    dxm_api.deleteFile("LogFile1.txt");
                                    Thread.Sleep(1000);
                                }
                            }
                            catch (Exception ex)
                            {
                                Console.WriteLine(ex);
                            }

                            dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                            dxm_api.travar();
                        }
                    }
                    catch (Exception ex) {
                        Console.WriteLine(ex);
                    }

                    /*
                     * contador = 0;
                     * for (int z = 0; z < linhas; z++)
                     * {
                     *  try
                     *  {
                     *      if (!vt.motores[z].Estado.Contains("DXM")) {
                     *          vt.flush();
                     *          banco.exec_log(vt.motores[z]);
                     *      }
                     *  }
                     *  catch { }
                     * }
                     */
                    banco.set_fabrica(JsonConvert.SerializeObject(vt));
                    contador = 0;
                }
                else
                {
                    loging = false;
                }
                Thread.Sleep(1000);
            }
        }
Exemplo n.º 7
0
        public string forceLoging()
        {
            string ret = "falha";

            if (Program.dxm.Connected)
            {
                try
                {
                    Program.loging = true;
                    DXM_Procotolo dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                    if (dxm_api.FileExist("Sbfile1.dat"))
                    {
                        Program.loging = true;
                        dxm_api        = new DXM_Procotolo(Program.dxm.IPAddress);
                        string        tempStr  = "";
                        string        tempStr2 = "";
                        List <string> temp     = new List <string>();
                        List <string> temp2    = new List <string>();
                        dxm_api.destravar();
                        dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                        temp2   = dxm_api.getFile("LogFile1.txt");
                        Thread.Sleep(200);
                        dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                        temp    = dxm_api.getFile("Sbfile1.dat");
                        try
                        {
                            if (temp[0] == "")
                            {
                            }
                            else
                            {
                                for (int x = 0; x < temp2.Count; x++)
                                {
                                    tempStr2 = tempStr2 + temp2[x];
                                }
                                for (int x = 0; x < temp.Count; x++)
                                {
                                    tempStr = tempStr + temp[x];
                                }
                                Program.vt.flush();
                                Program.banco.exec_log(tempStr, Program.vt.quantidade, tempStr2);
                                dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                                dxm_api.deleteFile("Sbfile1.dat");
                                Thread.Sleep(200);
                                dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                                dxm_api.deleteFile("LogFile1.txt");
                                Thread.Sleep(200);
                                ret = "ok";
                            }
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex);
                        }

                        dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                        dxm_api.travar();
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
                Program.loging = false;
            }
            return(ret);
        }
Exemplo n.º 8
0
        public string baixaLog()
        {
            string ret = "falha";

            if (Program.dxm.Connected)
            {
                try
                {
                    Program.loging = true;
                    DXM_Procotolo dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                    if (dxm_api.FileExist("Sbfile1.dat"))
                    {
                        dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                        string        tempStr  = "";
                        string        tempStr2 = "";
                        List <string> temp     = new List <string>();
                        List <string> temp2    = new List <string>();
                        temp2 = dxm_api.getFile("LogFile1.txt");
                        Thread.Sleep(200);
                        dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                        temp    = dxm_api.getFile("Sbfile1.dat");
                        try
                        {
                            if (temp[0] == "")
                            {
                            }
                            else
                            {
                                for (int x = 0; x < temp2.Count; x++)
                                {
                                    tempStr2 = tempStr2 + temp2[x];
                                }
                                for (int x = 0; x < temp.Count; x++)
                                {
                                    tempStr = tempStr + temp[x];
                                }
                                Program.vt.flush();
                                Program.banco.exec_log(tempStr, Program.vt.quantidade, tempStr2);
                                dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                                dxm_api.deleteFile("Sbfile1.dat");
                                Thread.Sleep(200);
                                dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                                dxm_api.deleteFile("LogFile1.txt");
                                ret = "ok";
                            }
                        }
                        catch
                        {
                            ret     = "falha - não foi possivel baixar o log, execute um diagnóstico e tente novamente";
                            dxm_api = new DXM_Procotolo(Program.dxm.IPAddress);
                            dxm_api.travar();
                        }
                    }
                }
                catch
                {
                    ret = "falha - não foi possivel baixar o log, execute um diagnóstico e tente novamente";
                }
            }
            Program.loging = false;
            return(ret);
        }
Exemplo n.º 9
0
 public IActionResult DxmConfig()
 {
     dxm = new DXM_Procotolo(Program.dxm.IPAddress);
     //if (!Program.registrado) { return RedirectToAction("index", "licenca"); }
     return(View());
 }