public GuiCurve(HmiSimulator scr) { m_runScreen = scr; m_guiApp = scr.GuiApp; m_TPDev = scr.TPDevInf; for (int idx = 0; idx < CurveIndex.Length; ++idx) CurveIndex[idx] = new InfoCurveIndex(); }
public GuiCurve(HmiSimulator scr) { m_runScreen = scr; m_guiApp = scr.GuiApp; m_TPDev = scr.TPDevInf; for (int idx = 0; idx < CurveIndex.Length; ++idx) { CurveIndex[idx] = new InfoCurveIndex(); } }
public unsafe void GuiCurveAdd(InfoCurveIndex index, byte data) { InfoCurveParam *curve_paramPtr; fixed(byte *px = &m_guiApp.CustomData[index.Offset]) curve_paramPtr = (InfoCurveParam *)px; if (index.Channel < curve_paramPtr->ChannelCount) { InfoCurveChannelParam *curve_channel_paramPtr; fixed(byte *px = &m_guiApp.CustomData[ index.Offset + sizeof(InfoCurveParam) + sizeof(InfoCurveChannelParam) * index.Channel ]) curve_channel_paramPtr = (InfoCurveChannelParam *)px; if (curve_channel_paramPtr->BufFree > 0) { if (data > curve_paramPtr->Height) { m_guiApp.CustomData[curve_channel_paramPtr->BufNext] = (byte)(curve_paramPtr->Height - 1); } else { m_guiApp.CustomData[curve_channel_paramPtr->BufNext] = data; } if (curve_channel_paramPtr->BufNext != curve_channel_paramPtr->End) { curve_channel_paramPtr->BufNext = (ushort)(curve_channel_paramPtr->BufNext + 1); } else { curve_channel_paramPtr->BufNext = (ushort)curve_channel_paramPtr->Begin; } if (curve_channel_paramPtr->DotLen < curve_paramPtr->Width) { curve_channel_paramPtr->DotLen = (ushort)(curve_channel_paramPtr->DotLen + 1); } curve_channel_paramPtr->BufFree = (ushort)(curve_channel_paramPtr->BufFree - 1); m_runScreen.GuiApp.PageObjects[index.ObjID].RefreshFlag = 1; } } }
public unsafe void GuiCurveAdd(InfoCurveIndex index, byte data) { InfoCurveParam* curve_paramPtr; fixed(byte* px = &m_guiApp.CustomData[index.Offset]) curve_paramPtr = (InfoCurveParam*)px; if (index.Channel < curve_paramPtr->ChannelCount) { InfoCurveChannelParam* curve_channel_paramPtr; fixed(byte* px = &m_guiApp.CustomData[ index.Offset + sizeof(InfoCurveParam) + sizeof(InfoCurveChannelParam) * index.Channel ]) curve_channel_paramPtr = (InfoCurveChannelParam*)px; if (curve_channel_paramPtr->BufFree > 0) { if (data > curve_paramPtr->Height) m_guiApp.CustomData[curve_channel_paramPtr->BufNext] = (byte)(curve_paramPtr->Height - 1); else m_guiApp.CustomData[curve_channel_paramPtr->BufNext] = data; if (curve_channel_paramPtr->BufNext != curve_channel_paramPtr->End) curve_channel_paramPtr->BufNext = (ushort)(curve_channel_paramPtr->BufNext + 1); else curve_channel_paramPtr->BufNext = (ushort)curve_channel_paramPtr->Begin; if (curve_channel_paramPtr->DotLen < curve_paramPtr->Width) curve_channel_paramPtr->DotLen = (ushort)(curve_channel_paramPtr->DotLen + 1); curve_channel_paramPtr->BufFree = (ushort)(curve_channel_paramPtr->BufFree - 1); m_runScreen.GuiApp.PageObjects[index.ObjID].RefreshFlag = 1; } } }