Пример #1
0
 public static RawlerBase DataWrite(this RawlerBase rawler, string attribute, DataAttributeType attributeType)
 {
     return(rawler.Add(new DataWrite()
     {
         Attribute = attribute, AttributeType = attributeType
     }));
 }
Пример #2
0
 /// <summary>
 /// データを書き込む
 /// </summary>
 /// <param name="attribute"></param>
 /// <param name="value"></param>
 /// <param name="type"></param>
 /// <param name="attributeType"></param>
 public void DataWrite(string attribute, string value, DataWriteType type, DataAttributeType attributeType)
 {
     if (type == DataWriteType.add)
     {
         currentDataRow.AddData(attribute, value, attributeType);
     }
     else if (type == DataWriteType.replace)
     {
         currentDataRow.ReplaceData(attribute, value, attributeType);
     }
 }
Пример #3
0
        /// <summary>
        /// データを加える。上書きせずリストに蓄積される。
        /// </summary>
        /// <param name="attribute">属性(Key)</param>
        /// <param name="value">値</param>
        public void ReplaceData(string attribute, string value, DataAttributeType type)
        {
            List <string> list;

            dataTypeDic.GetValueOrAdd(attribute, type);
            if (dataDic.TryGetValue(attribute, out list) == false)
            {
                list = new List <string>();
                dataDic.Add(attribute, list);
            }
            list.Clear();
            list.Add(value);
        }
Пример #4
0
        /// <summary>
        /// 現在のDataRowに書く。DataWriteがよびだすもの。
        /// </summary>
        /// <param name="attribute"></param>
        /// <param name="value"></param>
        public void DataWrite(string attribute, string value, DataWriteType type, DataAttributeType attributeType)
        {
            if (type == DataWriteType.add)
            {
                currentDataRow.AddData(attribute, value, attributeType);
            }
            else if (type == DataWriteType.replace)
            {
                currentDataRow.ReplaceData(attribute, value, attributeType);
            }

            if (attribute.ToLower() == "key")
            {
                dataDic.Add(value, currentDataRow);
            }
        }
Пример #5
0
 public DataAttribute(string name, ModelNode parent, DataAttributeType type, FunctionalConstraint fc, TriggerOptions trgOps,
                      int arrayElements, UInt32 sAddr)
 {
     self = DataAttribute_create(name, parent.self, (int)type, (int)fc, (byte)trgOps, arrayElements, sAddr);
 }
Пример #6
0
        /// <summary>
        /// DataWriteの共通呼び出し
        /// </summary>
        /// <param name="rawler"></param>
        /// <param name="attribute"></param>
        /// <param name="value"></param>
        /// <param name="type"></param>
        /// <param name="attributeType"></param>
        public static void DataWrite(RawlerBase rawler, string attribute, string value, DataWriteType type, DataAttributeType attributeType)
        {
            var d = (IData)rawler.GetUpperInterface <IData>();

            if (d != null)
            {
                d.DataWrite(attribute, value, type, attributeType);
            }
            else
            {
                ReportManage.ErrUpperNotFound <IData>(rawler);
            }
        }
Пример #7
0
 /// <summary>
 /// データを書き込む
 /// </summary>
 /// <param name="attribute"></param>
 /// <param name="value"></param>
 /// <param name="type"></param>
 /// <param name="attributeType"></param>
 public void DataWrite(string attribute, string value, DataWriteType type, DataAttributeType attributeType)
 {
     if (type == DataWriteType.add)
     {
         currentDataRow.AddData(attribute, value, attributeType);
     }
     else if (type == DataWriteType.replace)
     {
         currentDataRow.ReplaceData(attribute, value, attributeType);
     }
 }
Пример #8
0
 /// <summary>
 /// データを加える。上書きせずリストに蓄積される。
 /// </summary>
 /// <param name="attribute">属性(Key)</param>
 /// <param name="value">値</param>
 public void ReplaceData(string attribute, string value,DataAttributeType type)
 {
     List<string> list;
     dataTypeDic.GetValueOrAdd(attribute, type);
     if (dataDic.TryGetValue(attribute, out list) == false)
     {
         list = new List<string>();
         dataDic.Add(attribute, list);
     }
     list.Clear();
     list.Add(value);
 }
Пример #9
0
 /**
  * \brief create a new data attribute and add it to a parent model node
  *
  * The parent model node has to be of type LogicalNode or DataObject
  *
  * \param name the name of the data attribute (e.g. "stVal")
  * \param parent the parent model node
  * \param type the type of the data attribute (CONSTRUCTED if the type contains sub data attributes)
  * \param fc the functional constraint (FC) of the data attribte
  * \param triggerOptions the trigger options (dupd, dchg, qchg) that cause an event notification
  * \param arrayElements the number of array elements if the data attribute is an array or 0
  * \param sAddr an optional short address
  *
  * \return the newly create DataAttribute instance
  */
 public DataAttribute(string name, ModelNode parentNode, DataAttributeType type, FunctionalConstraint fc, byte triggerOptions, int arrayElements, uint sAddr)
 {
     self   = DataAttribute_create(name, parentNode.GetLibraryObject(), (int)type, (int)fc, triggerOptions, arrayElements, sAddr);
     daType = type;
     daFc   = fc;
 }
Пример #10
0
 public static RawlerBase DataWrite(this RawlerBase rawler, string attribute,DataAttributeType attributeType)
 {
     return rawler.Add(new DataWrite() { Attribute = attribute,AttributeType = attributeType });
 }