Ejemplo n.º 1
0
        internal static void Write(string aMsg, bool aNewLine = true)
        {
            DllImports.Max_Log_Write(IntPtr.Zero, aMsg, 0);

            // Das crashte sporadisch:
            //var aThreadId = aNewLine ? System.Threading.Thread.CurrentThread.ManagedThreadId.ToString()  + ": " : string.Empty;
            //var aFileInfo = new FileInfo(new FileInfo(typeof(DllExports).Assembly.Location).FullName + ".log");
            //System.IO.File.AppendAllText(aFileInfo.FullName, aThreadId + aMsg + (aNewLine ? Environment.NewLine : string.Empty));
            //System.Threading.Thread.Sleep(10);
        }
Ejemplo n.º 2
0
        internal void Init()
        {
            var aArgs                              = this.MaxObject.NewArgs;
            var aObjectDeleteFunc                  = new DllImports.CObjectDeleteFunc(this.Object_Delete);
            var aObjectOnInBangFunc                = new DllImports.CObject_In_Bang_Func(this.Object_In_Bang);
            var aObjectOnInFloatFunc               = new DllImports.CObject_In_Float_Func(this.Object_In_Float);
            var aObjectOnInIntFunc                 = new DllImports.CObject_In_Int_Func(this.Object_In_Int);
            var aObjectOnInSymbol                  = new DllImports.CObject_In_Symbol_Func(this.Object_In_Symbol);
            var aMemoryDeleteFunc                  = new DllImports.CMemory_Delete_Func(this.Memory_Delete);
            var aObjectAssistStringGetFunc         = new DllImports.CObject_Assist_GetString_Func(this.Object_Assist_String_Get);
            var aObjectInReceiveFunc               = new DllImports.CObject_In_Receive_Func(this.Object_In_Receive);
            var aObjectInListClearFunc             = new DllImports.CObject_In_List_ClearFunc(this.Object_In_List_Clear);
            var aObjectInListAddFloatFunc          = new DllImports.CObject_In_List_Add_Float_Func(this.Object_In_List_AddFloat);
            var aObjectInListAddIntFunc            = new DllImports.CObject_In_List_Add_Int_Func(this.Object_In_List_AddInt);
            var aObjectInListAddSymbolFunc         = new DllImports.CObject_In_List_Add_Symbol_Func(this.Object_In_List_AddSymbol);
            var aObjectOutListSymbolGetFunc        = new DllImports.CObject_Out_List_Symbol_Get_Func(this.Object_Out_List_Symbol_Get);
            var aObjectOutListElementCountFunc     = new DllImports.CObject_Out_List_Element_Count_Get_Func(this.Object_Out_List_Element_Count_Get);
            var aObjectOutListElementTypeGetFunc   = new DllImports.CObject_Out_List_Element_Type_Get_Func(this.Object_Out_List_Element_Type_Get);
            var aObjectOutListElementFloatGetFunc  = new DllImports.CObject_Out_List_Element_Float_Get_Func(this.Object_Out_List_Element_Float_Get);
            var aObjectOutListElementIntGetFunc    = new DllImports.CObject_Out_List_Element_Int_Get_Func(this.Object_Out_List_Element_Int_Get);
            var aObjectOutListElementSymbolGetFunc = new DllImports.CObject_Out_List_Element_Symbol_Get_Func(this.Object_Out_List_Element_Symbol_Get);
            var aObjectInMatrixReceiveFunc         = new DllImports.CObject_In_Matrix_Receive_Func(this.Object_In_Matrix_Receive);
            var aObjectMainTask                    = new DllImports.CObject_MainTask_Func(this.Object_MainTask);
            var aObjectShutdownFunc                = new DllImports.CObject_Shutdown_Func(this.Object_Shutdown);

            this.Funcs.Add(aObjectDeleteFunc);
            this.Funcs.Add(aObjectOnInBangFunc);
            this.Funcs.Add(aObjectOnInFloatFunc);
            this.Funcs.Add(aObjectOnInIntFunc);
            this.Funcs.Add(aObjectOnInSymbol);
            this.Funcs.Add(aMemoryDeleteFunc);
            this.Funcs.Add(aObjectAssistStringGetFunc);
            this.Funcs.Add(aObjectInReceiveFunc);
            this.Funcs.Add(aObjectInListClearFunc);
            this.Funcs.Add(aObjectInListAddFloatFunc);
            this.Funcs.Add(aObjectInListAddIntFunc);
            this.Funcs.Add(aObjectInListAddSymbolFunc);
            this.Funcs.Add(aObjectOutListSymbolGetFunc);
            this.Funcs.Add(aObjectOutListElementCountFunc);
            this.Funcs.Add(aObjectOutListElementTypeGetFunc);
            this.Funcs.Add(aObjectOutListElementFloatGetFunc);
            this.Funcs.Add(aObjectOutListElementIntGetFunc);
            this.Funcs.Add(aObjectOutListElementSymbolGetFunc);
            this.Funcs.Add(aObjectInMatrixReceiveFunc);
            this.Funcs.Add(aObjectMainTask);
            this.Funcs.Add(aObjectShutdownFunc);

            DllImports.Object_Delete_Func_Set(aArgs.mObjectPtr, aObjectDeleteFunc);
            DllImports.Object_In_Bang_Func_Set(aArgs.mObjectPtr, aObjectOnInBangFunc);
            DllImports.Object_In_Float_Func_Set(aArgs.mObjectPtr, aObjectOnInFloatFunc);
            DllImports.Object_In_Int_Func_Set(aArgs.mObjectPtr, aObjectOnInIntFunc);
            DllImports.Object_In_Symbol_Func_Set(aArgs.mObjectPtr, aObjectOnInSymbol);
            DllImports.Memory_Delete_Func_Set(aArgs.mObjectPtr, aMemoryDeleteFunc);
            DllImports.Object_Assist_GetString_Func_Set(aArgs.mObjectPtr, aObjectAssistStringGetFunc);
            DllImports.Object_In_Receive_Func_Set(aArgs.mObjectPtr, aObjectInReceiveFunc);
            DllImports.Object_In_List_Clear_Func_Set(aArgs.mObjectPtr, aObjectInListClearFunc);
            DllImports.Object_In_List_Add_Float_Func_Set(aArgs.mObjectPtr, aObjectInListAddFloatFunc);
            DllImports.Object_In_List_Add_Int_Func_Set(aArgs.mObjectPtr, aObjectInListAddIntFunc);
            DllImports.Object_In_List_Add_Symbol_Func_Set(aArgs.mObjectPtr, aObjectInListAddSymbolFunc);
            DllImports.Object_Out_List_Symbol_Get_Func_Set(aArgs.mObjectPtr, aObjectOutListSymbolGetFunc);
            DllImports.Object_Out_List_Element_Count_Get_Func_Set(aArgs.mObjectPtr, aObjectOutListElementCountFunc);
            DllImports.Object_Out_List_Element_Type_Get_Func_Set(aArgs.mObjectPtr, aObjectOutListElementTypeGetFunc);
            DllImports.Object_Out_List_Element_Float_Get_Func_Set(aArgs.mObjectPtr, aObjectOutListElementFloatGetFunc);
            DllImports.Object_Out_List_Element_Int_Get_Func_Set(aArgs.mObjectPtr, aObjectOutListElementIntGetFunc);
            DllImports.Object_Out_List_Element_Symbol_Get_Func_Set(aArgs.mObjectPtr, aObjectOutListElementSymbolGetFunc);
            DllImports.Object_In_Matrix_Receive_Func_Set(aArgs.mObjectPtr, aObjectInMatrixReceiveFunc);
            DllImports.Object_MainTask_Func_Set(aArgs.mObjectPtr, aObjectMainTask);
            DllImports.Object_Shutdown_Func_Set(aArgs.mObjectPtr, aObjectShutdownFunc);
        }