Example #1
0
        public int Read(IntPtr pItem)
        {
            int           eumT = 0, eumU = 0;
            DfsSimpleType dataT = DfsSimpleType.Int;

            DfsDLLWrapper.dfsGetItemInfo(pItem, out eumT, out EUMTypeString, out Name, out eumU, out EUMUnitString, out dataT);

            EUMType  = (eumItem)eumT;
            EUMUnit  = (eumUnit)eumU;
            dataType = (DfsSimpleType)dataT;

            //if (dataType != UfsSimpleType.UFS_FLOAT)return err("Only float dataType supported.");

            dim = DfsDLLWrapper.dfsGetItemDim(pItem);

            dataValType = DfsDLLWrapper.dfsGetItemValueType(pItem);

            sAxisType = (SpaceAxisType)DfsDLLWrapper.dfsGetItemAxisType(pItem);
            switch (sAxisType)
            {
            case SpaceAxisType.EqD0:
                DfsDLLWrapper.dfsGetItemAxisEqD0(pItem, out eumU, out axisEUMUnitString);
                nPointsX = 1;
                break;

            case SpaceAxisType.EqD1:
                DfsDLLWrapper.dfsGetItemAxisEqD1(pItem, out eumU, out axisEUMUnitString, out m_nPointsX, out XMinLimit, out DX);
                break;

            case SpaceAxisType.EqD2:
                DfsDLLWrapper.dfsGetItemAxisEqD2(pItem, out eumU, out axisEUMUnitString, out m_nPointsX, out m_nPointsY, out XMinLimit, out YMinLimit, out DX, out DY);
                break;

            case SpaceAxisType.EqD3:
                DfsDLLWrapper.dfsGetItemAxisEqD3(pItem, out eumU, out axisEUMUnitString, out m_nPointsX, out m_nPointsY, out m_nPointsZ, out XMinLimit, out YMinLimit, out ZMinLimit, out DX, out DY, out DZ);
                break;

            default:
                return(_err("Unsupported space axis " + sAxisType.ToString()));
            }

            axisEUMUnit = (eumUnit)eumU;
            return(0);
        }