Example #1
0
 public static void CloseLibrary()
 {
     if (ExtIO._isHWStarted)
     {
         ExtIO.StopHW();
     }
     if (ExtIO._isHWInit)
     {
         ExtIO.CloseHW();
     }
     if (!(ExtIO._dllHandle == IntPtr.Zero))
     {
         ExtIO.logInfo("CloseLibrary()");
         try
         {
             ExtIO.FreeLibrary(ExtIO._dllHandle);
         }
         catch (Exception ex)
         {
             ExtIO.logInfo("FreeLibrary: " + ex.Message);
         }
         ExtIO.logResult("FreeLibrary: ");
         ExtIO._dllHandle = IntPtr.Zero;
     }
 }
Example #2
0
 public static void HWInit(bool setCallback)
 {
     if (!(ExtIO._dllHandle == IntPtr.Zero) && !ExtIO._isHWInit && !ExtIO._isHWStarted)
     {
         ExtIO.logInfo("HWInit()");
         StringBuilder stringBuilder  = new StringBuilder(256);
         StringBuilder stringBuilder2 = new StringBuilder(256);
         int           hwType         = 0;
         try
         {
             ExtIO._isHWInit = ExtIO._initHW(stringBuilder, stringBuilder2, ref hwType);
         }
         catch (Exception ex)
         {
             ExtIO.logInfo("InitHW: " + ex.Message);
         }
         ExtIO.logResult("InitHW: ");
         ExtIO._name   = stringBuilder.ToString();
         ExtIO._model  = stringBuilder2.ToString();
         ExtIO._hwType = (HWTypes)hwType;
         if (!ExtIO._isHWInit)
         {
             ExtIO.logInfo("InitHW() returned " + ExtIO._isHWInit + ", ");
             ExtIO._isHWInit = true;
             ExtIO.CloseHW();
             throw new ApplicationException("InitHW() returned " + ExtIO._isHWInit);
         }
         ExtIO.logInfo("InitHW: " + ExtIO._name + ", " + ExtIO._model + ", type=" + hwType.ToString());
         if (setCallback)
         {
             ExtIO.logInfo("SetCallback: ");
             try
             {
                 ExtIO._setCallback(ExtIO._callbackInst);
             }
             catch (Exception ex2)
             {
                 ExtIO.logInfo("SetCallback: " + ex2.Message);
             }
         }
     }
 }
Example #3
0
 public void Close()
 {
     ExtIO.HideGUI();
     ExtIO.CloseHW();
 }