예제 #1
0
        private void inCodigo_KeyUp(object sender, KeyEventArgs e)
        {
            RichLog log = new RichLog(logGeneral);

            if (e.KeyCode == Keys.Enter)
            {
                log.reset();
                try
                {
                    DataTable dt = vtwin.PanelBarcodeInfo(inCodigo.Text.ToString());
                    gridOracle.DataSource = dt;
                    if (dt.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            int idFindMachine = int.Parse(dr["TEST_MACHINE_ID"].ToString());

                            // Lista de maquinas VTWIN
                            Machine machine = Machine.list.Where(obj => obj.tipo == "W" && obj.oracle_id == idFindMachine).FirstOrDefault();

                            VtwinPanel panel = new VtwinPanel(vtwin.oracle, dr, machine);

                            log.info(
                                string.Format("+ Programa: [{0}] | Barcode: {1} | Bloques: {2} | Pendiente: {3}", panel.programa, panel.barcode, panel.totalBloques, panel.pendiente)
                                );

                            log.notify(
                                string.Format("+ Aoi: {0} | Inspector: {1} | Falsos: {3} | Reales: {4} | Pendiente: {2}",
                                              panel.revisionAoi,
                                              panel.revisionIns,
                                              panel.pendiente,
                                              panel.totalErroresFalsos,
                                              panel.totalErroresReales
                                              ));

                            log.debug(
                                string.Format("========================================================")
                                );
                        }
                    }
                    else
                    {
                        log.warning(
                            string.Format("No hay datos para el barcode solicitado")
                            );
                    }
                }
                catch (Exception ex)
                {
                    log.stack(
                        string.Format("ERROR"),
                        this, ex
                        );
                }
            }
        }
예제 #2
0
파일: Machine.cs 프로젝트: deeze307/IA
        public ProductionService GetProductionInfoFromIAServer()
        {
            /*
             * LogBroadcast("verbose",
             * string.Format("+ Verificando informacion de produccion desde IAServer ({0})", line_barcode)
             * );
             */

            Stopwatch sw = Stopwatch.StartNew();

            prodService = new ProductionService();
            prodService.GetProdInfo(line_barcode);
            sw.Stop();

            LogBroadcast("success",
                         string.Format("API GetProductionInfoFromIAServer - Tiempo de respuesta: (ms) {0} ",
                                       (long)sw.ElapsedMilliseconds)
                         );

            if (prodService.error == null)
            {
                // Existe configuracion de rutas? ya sea sfcs o iaserver?
                if (prodService.routeMode != null)
                {
                    #region LOG Produccion Info
                    LogBroadcast("verbose",
                                 string.Format(
                                     "============== PRODINFO {0} ==============\n " +
                                     "Activa: {1} \n " +
                                     "Semielaborado: {2} \n " +
                                     "Producir: {3} \n " +
                                     "Ruta modo: {4} \n " +
                                     "Ruta puesto: {5} \n " +
                                     "Ruta Declara: {6} \n " +
                                     "IASERVER: \t {7}% Inspecciones: {8} / Restantes: {9} \n ",
                                     prodService.result.produccion.op,
                                     prodService.result.produccion.wip.active,
                                     prodService.result.produccion.wip.wip_ot.codigo_producto,
                                     prodService.result.produccion.wip.wip_ot.start_quantity,
                                     prodService.routeMode,
                                     prodService.routeName,
                                     prodService.routeDeclare,
                                     prodService.result.produccion.smt.porcentaje,
                                     prodService.result.produccion.smt.prod_aoi,
                                     prodService.result.produccion.smt.restantes
                                     )
                                 );

                    if (prodService.routeDeclare)
                    {
                        LogBroadcast("verbose",
                                     string.Format(
                                         "EBS: \t\t {0}% Declaradas: {1} / Restantes: {2} \n ",
                                         prodService.result.produccion.wip.wip_ot.porcentaje,
                                         prodService.result.produccion.wip.wip_ot.quantity_completed,
                                         prodService.result.produccion.wip.wip_ot.restante
                                         )
                                     );
                    }
                    #endregion
                }
                else
                {
                    LogBroadcast("warning", "No existe configuracion de ruta de produccion");
                }
            }
            else
            {
                log.stack(
                    string.Format("Stack Error en la verificacion de produccion desde IAServer ({0})", line_barcode
                                  ), this, prodService.error);
            }

            return(prodService);
        }