示例#1
0
 public AspRequestBroker(DelegateRead read, DelegateWrite write, DelegateWriteHeader writeHeader, DelegateWriteHttpStatus writeStatus, DelegateRequestEnd reqEnd, DelegateDomainUnload domainUnload)
 {
     this._read          = read;
     this._write         = write;
     this._writeHeader   = writeHeader;
     this._writeStatus   = writeStatus;
     this._requestEnd    = reqEnd;
     this._domainUnlocad = domainUnload;
 }
示例#2
0
        public static void LoadDll(string deviceType)
        {
            switch (deviceType)
            {
            case "USBCAN2":
                dllmodule         = DllHelper.LoadDll("ECanVci.dll");
                VCI_OpenDevice    = (DelegateOpenDevice)DllHelper.GetFunctionAddress(dllmodule, "VCI_OpenDevice", typeof(DelegateOpenDevice));
                VCI_CloseDevice   = (DelegateCloseDevice)DllHelper.GetFunctionAddress(dllmodule, "VCI_CloseDevice", typeof(DelegateCloseDevice));
                VCI_InitCAN       = (DelegateInitCan)DllHelper.GetFunctionAddress(dllmodule, "VCI_InitCAN", typeof(DelegateInitCan));
                VCI_ReadBoardInfo = (DelegateReadBoardInfo)DllHelper.GetFunctionAddress(dllmodule, "VCI_ReadBoardInfo", typeof(DelegateReadBoardInfo));;
                VCI_GetReceiveNum = (DelegateGetReceiveNum)DllHelper.GetFunctionAddress(dllmodule, "VCI_GetReceiveNum", typeof(DelegateGetReceiveNum));
                VCI_ClearBuffer   = (DelegateClearBuffer)DllHelper.GetFunctionAddress(dllmodule, "VCI_ClearBuffer", typeof(DelegateClearBuffer));
                VCI_StartCAN      = (DelegateStartCan)DllHelper.GetFunctionAddress(dllmodule, "VCI_StartCAN", typeof(DelegateStartCan));
                VCI_ResetCAN      = (DelegateResetCan)DllHelper.GetFunctionAddress(dllmodule, "VCI_ResetCAN", typeof(DelegateResetCan));
                VCI_Transmit      = (DelegateTransmit)DllHelper.GetFunctionAddress(dllmodule, "VCI_Transmit", typeof(DelegateTransmit));
                VCI_Receive       = (DelegateReceive)DllHelper.GetFunctionAddress(dllmodule, "VCI_Receive", typeof(DelegateReceive));
                break;

            case "MRH-U":
                dllmodule         = DllHelper.LoadDll("ControlCAN.dll");
                VCI_OpenDevice    = (DelegateOpenDevice)DllHelper.GetFunctionAddress(dllmodule, "VCI_OpenDevice", typeof(DelegateOpenDevice));
                VCI_CloseDevice   = (DelegateCloseDevice)DllHelper.GetFunctionAddress(dllmodule, "VCI_CloseDevice", typeof(DelegateCloseDevice));
                VCI_InitCAN       = (DelegateInitCan)DllHelper.GetFunctionAddress(dllmodule, "VCI_InitCAN", typeof(DelegateInitCan));
                VCI_ReadBoardInfo = (DelegateReadBoardInfo)DllHelper.GetFunctionAddress(dllmodule, "VCI_ReadBoardInfo", typeof(DelegateReadBoardInfo));;
                VCI_GetReceiveNum = (DelegateGetReceiveNum)DllHelper.GetFunctionAddress(dllmodule, "VCI_GetReceiveNum", typeof(DelegateGetReceiveNum));
                VCI_ClearBuffer   = (DelegateClearBuffer)DllHelper.GetFunctionAddress(dllmodule, "VCI_ClearBuffer", typeof(DelegateClearBuffer));
                VCI_StartCAN      = (DelegateStartCan)DllHelper.GetFunctionAddress(dllmodule, "VCI_StartCAN", typeof(DelegateStartCan));
                VCI_ResetCAN      = (DelegateResetCan)DllHelper.GetFunctionAddress(dllmodule, "VCI_ResetCAN", typeof(DelegateResetCan));
                VCI_Transmit      = (DelegateTransmit)DllHelper.GetFunctionAddress(dllmodule, "VCI_Transmit", typeof(DelegateTransmit));
                VCI_Receive       = (DelegateReceive)DllHelper.GetFunctionAddress(dllmodule, "VCI_Receive", typeof(DelegateReceive));
                break;

            case "MRH-T":
            case "MRH-E":
                dllmodule = DllHelper.LoadDll("MegaCanDevice.dll");
                //dllmodule = DllHelper.LoadDll(@"D:\work\MegaRobo_Update\MegaRobo_Update\MegaRobo_Update\bin\Debug\MegaCanDevice.dll");
                VCI_OpenDevice    = (DelegateOpenDevice)DllHelper.GetFunctionAddress(dllmodule, "_VCI_OpenDevice@12", typeof(DelegateOpenDevice));
                VCI_CloseDevice   = (DelegateCloseDevice)DllHelper.GetFunctionAddress(dllmodule, "_VCI_CloseDevice@8", typeof(DelegateCloseDevice));
                VCI_InitCAN       = (DelegateInitCan)DllHelper.GetFunctionAddress(dllmodule, "_VCI_InitCAN@16", typeof(DelegateInitCan));
                VCI_ReadBoardInfo = (DelegateReadBoardInfo)DllHelper.GetFunctionAddress(dllmodule, "_VCI_ReadBoardInfo@12", typeof(DelegateReadBoardInfo));;
                VCI_GetReceiveNum = (DelegateGetReceiveNum)DllHelper.GetFunctionAddress(dllmodule, "_VCI_GetReceiveNum@12", typeof(DelegateGetReceiveNum));
                VCI_ClearBuffer   = (DelegateClearBuffer)DllHelper.GetFunctionAddress(dllmodule, "_VCI_ClearBuffer@12", typeof(DelegateClearBuffer));
                VCI_StartCAN      = (DelegateStartCan)DllHelper.GetFunctionAddress(dllmodule, "_VCI_StartCAN@12", typeof(DelegateStartCan));
                VCI_ResetCAN      = (DelegateResetCan)DllHelper.GetFunctionAddress(dllmodule, "_VCI_ResetCAN@12", typeof(DelegateResetCan));
                VCI_Transmit      = (DelegateTransmit)DllHelper.GetFunctionAddress(dllmodule, "_VCI_Transmit@20", typeof(DelegateTransmit));
                VCI_Receive       = (DelegateReceive)DllHelper.GetFunctionAddress(dllmodule, "_VCI_Receive@24", typeof(DelegateReceive));
                VCI_Write         = (DelegateWrite)DllHelper.GetFunctionAddress(dllmodule, "_VCI_Write@16", typeof(DelegateWrite));
                VCI_Read          = (DelegateRead)DllHelper.GetFunctionAddress(dllmodule, "_VCI_Read@20", typeof(DelegateRead));
                VCI_FindDevice    = (DelegateFindDevice)DllHelper.GetFunctionAddress(dllmodule, "_VCI_FindDevice@12", typeof(DelegateFindDevice));
                break;
            }
        }