Beispiel #1
0
        // Obtiene lista de defectos de inspeccion detallados por referencia
        public static string ListFaultInfo(VtwinPanel panel)
        {
            string query = @"
                SELECT 

                    (CASE WHEN FCI.REVISED_FAULT_ID IS NULL 
                        THEN (CASE WHEN ( FCI.COMPONENT_PERSON_REVISOR IS NULL OR FCI.COMPONENT_REVISE_END_DATE IS NULL )
                                    THEN 'PENDIENTE' 
                                    ELSE 'FALSO' 
                                END) 
                        ELSE 'REAL' 
                    END) AS RESULTADO,

                CI.COMPONENT_NAME,
                CI.COMPONENT_BLOCK_NO AS BLOQUE,
                FCI.FAULT_CODE

                FROM 

	                FAULT_COMPONENT_INFO FCI,
	                COMPONENT_INFO CI

                WHERE 

	                CI.SAVED_MACHINE_ID = FCI.SAVED_MACHINE_ID AND
	                CI.PROGRAM_NAME_ID = FCI.PROGRAM_NAME_ID AND
	                CI.REVISION_NO = FCI.REVISION_NO  AND
	                CI.SERIAL_NO = FCI.SERIAL_NO  AND
	                CI.COMPONENT_NO = FCI.COMPONENT_NO AND

	                FCI.TEST_MACHINE_ID = "     + panel.machine.oracle_id + @" AND
                    FCI.PROGRAM_NAME_ID =  " + panel.vtwinProgramNameId + @" AND
                    FCI.SAVED_MACHINE_ID =  " + panel.vtwinSaveMachineId + @" AND
                    FCI.REVISION_NO =  " + panel.vtwinRevisionNo + @" AND
                    FCI.SERIAL_NO =  " + panel.vtwinSerialNo + @" AND
                    FCI.LOAD_COUNT =  " + panel.vtwinLoadCount + @" AND 
                    FCI.PCB_NO =  " + panel.panelNro + @"

                GROUP BY

                    (CASE WHEN FCI.REVISED_FAULT_ID IS NULL 
                        THEN (CASE WHEN ( FCI.COMPONENT_PERSON_REVISOR IS NULL OR FCI.COMPONENT_REVISE_END_DATE IS NULL )
                                    THEN 'PENDIENTE' 
                                    ELSE 'FALSO' 
                                END) 
                        ELSE 'REAL' 
                    END),

                CI.COMPONENT_NAME,
                CI.COMPONENT_BLOCK_NO,
                FCI.FAULT_CODE

                ORDER BY

                RESULTADO DESC
            ";

            return(query);
        }
Beispiel #2
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
                        );
                }
            }
        }