public static void SetTagReady(this UCView.TAGLIST list, IntPtr pos, bool bVal) { UInt16 DataReady = bVal ? (UInt16)1 : (UInt16)0; UCView.TAGLISTNODE node = pos.GetStructure <UCView.TAGLISTNODE>(); const int offset_dataready = 0; //(int)Marshal.OffsetOf(typeof(UCView.TAGREG), "wDataReady"); node.data.SetValueOnOfssetOfStructure(DataReady, offset_dataready, true); //node.data is TAGREG, 0(offset of wDataReady) }
public static void SetTagValue(this UCView.TAGLIST list, IntPtr pos, float fVal) { UInt16 regdatatype = UCView.FLOAT_DATATYPE; UCView.TAGLISTNODE node = pos.GetStructure <UCView.TAGLISTNODE>(); const int offset_regdatatype = 20; //(int)Marshal.OffsetOf(typeof(UCView.TAGREG), "devReg") + (int)Marshal.OffsetOf(typeof(UCView.DEVREG), "RegDataType"); const int offset_regvalue = 24; //(int)Marshal.OffsetOf(typeof(UCView.TAGREG), "RegValue"); node.data.SetValueOnOfssetOfStructure(regdatatype, offset_regdatatype, true); //node.data is TAGREG, 20(offset of RegDataType) node.data.SetValueOnOfssetOfStructure(fVal, offset_regvalue, true); //node.data is TAGREG, 24(offset of value) }
public static IntPtr GetNextPosition(this UCView.TAGLIST list, IntPtr pos) { return(pos.GetStructure <UCView.TAGLISTNODE>().pNext); }
public static UCView.TAGREG GetTagAt(this UCView.TAGLIST list, IntPtr pos) { return(pos.GetStructure <UCView.TAGLISTNODE>().data.GetStructure <UCView.TAGREG>()); }
public static IntPtr GetHeadPosition(this UCView.TAGLIST list) { return(list.m_pNodeHead); }