Exemplo n.º 1
0
        private static void CreateFieldMetaDataList(DataPointEntry entry, MetaFrame m_MetaFrame, EncodingOptions options)
        {
            if (m_MetaFrame.FieldMetaDataList == null)
            {
                m_MetaFrame.FieldMetaDataList = new List <FieldMetaData>();
            }
            FieldMetaData fieldMetaData = new FieldMetaData(options)
            {
                Index    = entry.DataPoint.Index,
                Name     = new String(entry.DataPoint.Name),
                Flags    = new DataSetFieldFlags(options),
                DataType = entry.DataPoint.NodeID,
                FieldID  = entry.DataPoint.FieldID
            };

            // all data points have a "Unit" and a "Prefix" key/value pair in the Properties
            // list of the FieldMetaData; if it is null here, then create an empty entry

            if (entry.DataPoint.Properties == null || entry.DataPoint.Properties.Count == 0)
            {
                fieldMetaData.Properties = new List <binary.Messages.Meta.KeyValuePair>
                {
                    new binary.Messages.Meta.KeyValuePair("Prefix", new String("")),
                    new binary.Messages.Meta.KeyValuePair("Unit", new String(""))
                };
            }
            else
            {
                fieldMetaData.Properties = entry.DataPoint.Properties;
            }

            // add the FieldMetaData for the given data object to the list of all FieldMetaData
            m_MetaFrame.FieldMetaDataList.Add(fieldMetaData);
        }
Exemplo n.º 2
0
 public void AddDataPoint(ProcessDataPointValue dataPoint)
 {
     if (!m_ProcessValues.ContainsKey(dataPoint.Name))
     {
         DataPointEntry entry = new DataPointEntry
         {
             DataPoint  = dataPoint,
             IsModified = true
         };
         m_ProcessValues.Add(dataPoint.Name, entry);
         m_MetaFrame = null;
     }
 }