protected override void OnStarting(string[] args)
        {
            Program.banco = new Store.Store();
            JavaScriptSerializer ser = new JavaScriptSerializer();

            OEE.OEE foo = ser.Deserialize <OEE.OEE>(Program.banco.Fabrica);

            Program.oee         = new OEE.OEE(foo.quantidade, foo.Linhas, foo.DXM_Endress, foo.emulador, foo.tickLog, foo.zerou_turno);
            Program.oee.timeOut = foo.timeOut;
            if (Program.oee.DXM_Tcp)
            {
                Program.dxm = new ModbusClient(Program.oee.DXM_Endress, 502);
            }
            else
            {
                Program.dxm = new ModbusClient(Program.oee.DXM_Endress);
            }

            ThreadStart start = new ThreadStart(Program.leituraDXM);
            Thread      acao  = new Thread(start);
            ThreadStart log   = new ThreadStart(Program.DXMLog);
            Thread      acao2 = new Thread(log);
            ThreadStart log2  = new ThreadStart(Program.poolRegistro);
            Thread      acao3 = new Thread(log2);

            acao3.Start();
            acao.Start();
            acao2.Start();
        }
Пример #2
0
 public void alteraNomeLinhas(OEE.OEE oee)
 {
     for (int x = 0; x < oee.Linhas.Count; x++)
     {
         linhas[x].nomeLinha = oee.Linhas[x].nome;
     }
     salvaArquivo(this);
 }
        public static void Main(string[] args)
        {
            ///*
            banco = new Store.Store();
            JavaScriptSerializer ser = new JavaScriptSerializer();

            OEE.OEE foo = ser.Deserialize <OEE.OEE>(banco.Fabrica);

            oee         = new OEE.OEE(foo.quantidade, foo.Linhas, foo.DXM_Endress, foo.emulador, foo.tickLog, foo.zerou_turno);
            oee.timeOut = foo.timeOut;
            if (oee.DXM_Tcp)
            {
                dxm = new ModbusClient(oee.DXM_Endress, 502);
            }
            else
            {
                dxm = new ModbusClient(oee.DXM_Endress);
            }

            ThreadStart start = new ThreadStart(leituraDXM);
            Thread      acao  = new Thread(start);
            ThreadStart log   = new ThreadStart(DXMLog);
            Thread      acao2 = new Thread(log);
            ThreadStart log2  = new ThreadStart(poolRegistro);
            Thread      acao3 = new Thread(log2);

            acao3.Start();
            acao.Start();
            acao2.Start();

            //*/

            var pathToExec = Process.GetCurrentProcess().MainModule.FileName;

            _pathContentRoot = Path.GetDirectoryName(pathToExec);

            //CreateWebHostBuilder(args).Build().RunAsCustomService();
            CreateWebHostBuilder(args).Build().Run();
        }