Example #1
0
        //public UnmanagedMethod_50Params_Delegate UnmanagedCall;

        #region Constructors
        /// <summary>
        /// Inicializa una nueva instancia que contiene las variables y métodos necesarios para la simulacion
        /// del modelo del rectificador.
        /// </summary>
        public SIMDLLAccess()
        {
            //LinkerToUnamangedLibrary lul = new LinkerToUnamangedLibrary(48, filePath);
            UnmanagedLibrary ul = new UnmanagedLibrary(filePath);

            UnmanagedCall =
                ul.GetUnmanagedFunction <UnmanagedMethod_48Params_Delegate>("SteppedSimulation");

            //UnmanagedCall =
            //    ul.GetUnmanagedFunction<UnmanagedMethod_50Params_Delegate>("SteppedSimulation");
        }
 /// <summary>
 /// Inicializa una instancia del objeto y el arreglo de valores a una cantidad fija de valores.
 /// </summary>
 /// <param name="lenght"></param>
 /// <param name="filepath"></param>
 /// <param name="methodName"></param>
 public LinkerToUnamangedLibrary(int lenght, string filepath, string methodName)
 {
     ul = new UnmanagedLibrary(filepath);
     if (lenght <= 25)
     {
         this.ParamsQuantity = 25;
         unmanaged25         = ul.GetUnmanagedFunction <UnmanagedMethod_25Params_Delegate>(methodName);
     }
     else if (lenght <= 50)
     {
         this.ParamsQuantity = 50;
         unmanaged50         = ul.GetUnmanagedFunction <UnmanagedMethod_50Params_Delegate>(methodName);
     }
     else
     {
         this.ParamsQuantity = 75;
         unmanaged75         = ul.GetUnmanagedFunction <UnmanagedMethod_75Params_Delegate>(methodName);
     }
     this.MethodName   = methodName;
     this.ParamsValues = this.ParamsOriginalValues = new float[ParamsQuantity];
     this.FilePath     = filepath;
     this.ParamsNames  = new List <string>();
 }