Esempio n. 1
0
        public static bool dbDownload()
        {
            #region DESCARGA INFORMACION DE MYSQL
            Log.system.verbose("Iniciando descarga de datos MySql");

            try
            {
                Faultcode.Download();
                Machine.Download();
                PcbInfo.Download();

                Log.system.notify("Faultcodes: " + Faultcode.Total());
                Log.system.notify("Maquinas: " + Machine.Total());
                Log.system.notify("PcbInfo: " + PcbInfo.Total());

                dbDownloadComplete = true;
            }
            catch (Exception ex)
            {
                dbDownloadComplete = false;
                Log.system.error(ex.Message);
            }
            #endregion

            return(dbDownloadComplete);
        }
Esempio n. 2
0
        /// <summary>
        /// Detalle de inspeccion del panel general
        /// </summary>
        /// <returns></returns>
        private List <Detail> GetInspectionDetail()
        {
            string query = OracleQuery.ListFaultInfo(this);

            DataTable dt = _oracle.Query(query);

            List <Detail> ldet = new List <Detail>();

            if (dt.Rows.Count > 0)
            {
                #region FILL_ERROR_DETAIL
                foreach (DataRow r in dt.Rows)
                {
                    int    bid = int.Parse(r["bloque"].ToString());
                    Detail det = new Detail();
                    det.faultcode  = r["fault_code"].ToString();
                    det.estado     = r["resultado"].ToString();
                    det.referencia = r["COMPONENT_NAME"].ToString();
                    det.bloqueId   = bid;
                    //det.total_faultcode = int.Parse(r["total"].ToString());
                    det.descripcionFaultcode = Faultcode.Description(det.faultcode);

                    ldet.Add(det);
                }
                #endregion
            }
            return(ldet);
        }
Esempio n. 3
0
        /// <summary>
        /// Obtiene detalle de errores del panel completo (extraidos del resumen del csv)
        /// </summary>
        /// <param name="contenidoCsv"></param>
        /// <returns></returns>
        private List <Detail> GetInspectionDetail(DataTable contenidoCsv)
        {
            //List<FileInfo> imageFiles = rnsCurrentInspectionResultDirectory.GetFiles("*.jpg").ToList();

            List <Detail> detalles = new List <Detail>();

            // Recorro todos los detalles de la inspeccion
            foreach (DataRow r in contenidoCsv.Rows)
            {
                #region Inspection DETAIL

                Detail det = new Detail();
                det.referencia = r[42].ToString().Replace("\"", "").Trim();
                if (!det.referencia.Trim().Equals(""))
                {
                    det.componentNo          = int.Parse(r[41].ToString().Replace("\"", "").Trim());
                    det.bloqueId             = int.Parse(r[39].ToString().Replace("\"", "").Trim());
                    det.faultcode            = r[49].ToString().Replace("\"", "").Trim();
                    det.realFaultcode        = r[50].ToString().Replace("\"", "").Trim();
                    det.descripcionFaultcode = Faultcode.Description(det.faultcode);

                    //det.faultImages = imageFiles.Where(x => x.Name.Contains(det.componentNo+"-")).ToList();

                    // Si el real_faultcode no se detecto el error es FALSO
                    if (det.realFaultcode.Equals("0") || det.realFaultcode.Equals(""))
                    {
                        det.estado = "FALSO";
                    }
                    else
                    {
                        det.estado = "REAL";
                    }

                    if (!DuplicatedInspectionDetail(det, detalles))
                    {
                        detalles.Add(det);
                    }
                }
                #endregion
            }
            return(detalles);
        }