Example #1
0
 private static void _StopHandler()
 {
     sIsHandlerDisposed = true;
     sActiveProduct = null;
     sTimer.Dispose();
     sExcelHelper.Dispose();
     HeadersWritten = false;
 }
Example #2
0
        private ActiveProduct _GetActiveProduct(XmlNode xmlNode)
        {
            var activeProduct = new ActiveProduct();

            foreach (XmlNode childNode in xmlNode.ChildNodes)
            {
                switch (childNode.Name)
                {
                    case "Product":
                        activeProduct.Product = _GetProduct(childNode);
                        break;

                    default:
                        Logger.WriteDebugMessage(string.Format("Unknown XML Node found! Node Name: '{0}'", childNode.Name));
                        break;
                }
            }

            return activeProduct;
        }
Example #3
0
        private ActiveProduct _GetActiveProduct(XmlNode xmlNode)
        {
            var activeProduct = new ActiveProduct();

            foreach (XmlNode childNode in xmlNode.ChildNodes)
            {
                switch (childNode.Name)
                {
                case "Product":
                    activeProduct.Product = _GetProduct(childNode);
                    break;

                default:
                    Logger.WriteDebugMessage(string.Format("Unknown XML Node found! Node Name: '{0}'", childNode.Name));
                    break;
                }
            }

            return(activeProduct);
        }
Example #4
0
        private void _CheckForFile()
        {
            var files = _SortFileListByExtension(Directory.GetFiles(sLimsVisualizerSettings.FilePath));

            foreach (var file in files)
            {
                if (sIsHandlerDisposed)
                    return;

                try
                {
                    mDocument = mParser.ParseFile(file);
                }
                catch (Exception exception)
                {
                    ShowErrorMessage(exception);
                }

                if ((sActiveProduct == null) || (sActiveProduct.Product.Id != mDocument.Summary.ActiveProduct.Product.Id))
                {
                    sExcelHelper.StartExcel();
                    sExcelHelper.CreateWorkbook();
                    sActiveProduct = mDocument.Summary.ActiveProduct;
                }

                if (!HeadersWritten)
                {
                    sExcelHelper.AddHeaders(mDocument);
                    HeadersWritten = true;
                }

                sExcelHelper.AddMeasurementValues(mDocument);
                sExcelHelper.AddMiscellaneousValues(mDocument);

                LogWriter.WriteDebugMessage(string.Format("Deleting file: '{0}'", file));
                File.Delete(file);
                LogWriter.WriteDebugMessage("Deleted file successfully.");
            }
        }