示例#1
0
        bool CreateDeviceMana(IConnection connectModule)
        {
            try
            {
                DalsaMemObj.ServerLocation = new SapLocation(connectModule.ServerName, connectModule.ResourceIndex);
                DalsaMemObj.Acquisition    = new SapAcquisition(DalsaMemObj.ServerLocation, connectModule.ConfigFile);

                if (SapBuffer.IsBufferTypeSupported(DalsaMemObj.ServerLocation, SapBuffer.MemoryType.ScatterGather))
                {
                    DalsaMemObj.Buffers = new SapBufferWithTrash(2, DalsaMemObj.Acquisition, SapBuffer.MemoryType.ScatterGather);
                }
                else
                {
                    DalsaMemObj.Buffers = new SapBufferWithTrash(2, DalsaMemObj.Acquisition, SapBuffer.MemoryType.ScatterGatherPhysical);
                }

                var objSetting = new ObjectSetting();
                objSetting.AcqusitionSetting(DalsaMemObj.Acquisition);

                DalsaMemObj.Xfer = new SapAcqToBuf(DalsaMemObj.Acquisition, DalsaMemObj.Buffers);
                DalsaMemObj.Xfer.Pairs[0].EventType = SapXferPair.XferEventType.EndOfFrame;

                DalsaMemObj.View = new SapView(DalsaMemObj.Buffers);

                DalsaMemObj.Xfer.XferNotify       += new SapXferNotifyHandler(GrabDoneEventMethod);
                DalsaMemObj.Xfer.XferNotifyContext = DalsaMemObj.View;

                var creatobject = new CreatesObjects();
                creatobject.CreatEndSqObject(DalsaMemObj.Buffers, DalsaMemObj.Xfer, DalsaMemObj.View);
                return(true);
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                return(false);
            }
        }
示例#2
0
        public void DisposeMem()
        {
            var creatobject = new CreatesObjects();

            creatobject.DestroysObjects(DalsaMemObj);
        }