Пример #1
0
        private MeasurementData _GetMeasurementData(XmlNode xmlNode)
        {
            var measurementData = new MeasurementData();

            foreach (XmlNode childNode in xmlNode.ChildNodes)
            {
                switch (childNode.Name)
                {
                case "Timestamp":
                    measurementData.Timestamp = _GetTimeStamp(childNode);
                    break;

                case "Product":
                    measurementData.Product = _GetProduct(childNode);
                    break;

                case "SystemStatus":
                    measurementData.SystemStatus = Convert.ToInt16(childNode.InnerText);
                    break;

                case "DeviceStatus":
                    measurementData.DeviceStatus = Convert.ToInt16(childNode.InnerText);
                    break;

                case "LineStatus":
                    measurementData.LineStatus = Convert.ToInt16(childNode.InnerText);
                    break;

                case "StatusMessages":
                    //TODO Check Messagestyle
                    measurementData.StatusMessages = new List <StatusMessage>();
                    break;

                case "IsFlowStopActive":
                    measurementData.IsFlowStopActive = Convert.ToBoolean(childNode.InnerText);
                    break;

                case "IsHoldActive":
                    measurementData.IsHoldActive = Convert.ToBoolean(childNode.InnerText);
                    break;

                case "Channels":
                    measurementData.Channels = _GetChannelList(childNode);
                    break;

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

            return(measurementData);
        }
Пример #2
0
        private MeasurementData _GetMeasurementData(XmlNode xmlNode)
        {
            var measurementData = new MeasurementData();

            foreach (XmlNode childNode in xmlNode.ChildNodes)
            {
                switch (childNode.Name)
                {
                    case "Timestamp":
                        measurementData.Timestamp = _GetTimeStamp(childNode);
                        break;

                    case "Product":
                        measurementData.Product = _GetProduct(childNode);
                        break;

                    case "SystemStatus":
                        measurementData.SystemStatus = Convert.ToInt16(childNode.InnerText);
                        break;

                    case "DeviceStatus":
                        measurementData.DeviceStatus = Convert.ToInt16(childNode.InnerText);
                        break;

                    case "LineStatus":
                        measurementData.LineStatus = Convert.ToInt16(childNode.InnerText);
                        break;

                    case "StatusMessages":
                        //TODO Check Messagestyle
                        measurementData.StatusMessages = new List<StatusMessage>();
                        break;

                    case "IsFlowStopActive":
                        measurementData.IsFlowStopActive = Convert.ToBoolean(childNode.InnerText);
                        break;

                    case "IsHoldActive":
                        measurementData.IsHoldActive = Convert.ToBoolean(childNode.InnerText);
                        break;

                    case "Channels":
                        measurementData.Channels = _GetChannelList(childNode);
                        break;

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

            return measurementData;
        }