Przeglądaj źródła

0930 修改iop初始化

caizm 1 rok temu
rodzic
commit
ffd9241219

+ 19 - 17
CAE_Solution/src/acis/geometryimexporter.cpp

@@ -111,24 +111,26 @@ bool GeometryImExporter::LoadGeometryFile(const string &inFile,bool state/*=fals
     // initialization and shutdown.  InterOp may only be initialized
     // and shutdown once per process.  Please do not use the guard
     // classes multiple times per process.
-    SPAIopAcisSystemInitGuard initGuard(SPATIAL_LICENSE);
-    int result = initGuard.GetInitStatus();
 
-    if (SPA_UNLOCK_NO_MSG == result)
-    {
-        // Spatial products have been unlocked
-        printf("SUCCESS: SPAIopAcisSystem::Initialize. \n");
-    }
-    else if (SPA_UNLOCK_KEY_WARN_EXPIRE == result)
-        printf("SPAIopAcisSystem::Initialize returned SPA_UNLOCK_KEY_WARN_EXPIRE; your license key will expire soon!\n");
-    else if (SPA_UNLOCK_REGISTRATION_WARN_EXPIRE == result)
-        printf("SPAIopAcisSystem::Initialize returned SPA_UNLOCK_REGISTRATION_WARN_EXPIRE; your registration will expire soon.\n");
-    else
-    {
-        printf("SPAIopAcisSystem::Initialize returned an unexpected value; Contact Spatial Customer Support or your Account Manager.\n");
-        return false;
-    }
-    result = 1;
+//    SPAIopAcisSystem::Initialize(SPATIAL_LICENSE);
+//    SPAIopAcisSystemInitGuard initGuard(SPATIAL_LICENSE);
+//    int result = initGuard.GetInitStatus();
+
+//    if (SPA_UNLOCK_NO_MSG == result)
+//    {
+//        // Spatial products have been unlocked
+//        printf("SUCCESS: SPAIopAcisSystem::Initialize. \n");
+//    }
+//    else if (SPA_UNLOCK_KEY_WARN_EXPIRE == result)
+//        printf("SPAIopAcisSystem::Initialize returned SPA_UNLOCK_KEY_WARN_EXPIRE; your license key will expire soon!\n");
+//    else if (SPA_UNLOCK_REGISTRATION_WARN_EXPIRE == result)
+//        printf("SPAIopAcisSystem::Initialize returned SPA_UNLOCK_REGISTRATION_WARN_EXPIRE; your registration will expire soon.\n");
+//    else
+//    {
+//        printf("SPAIopAcisSystem::Initialize returned an unexpected value; Contact Spatial Customer Support or your Account Manager.\n");
+//        return false;
+//    }
+//    result = 1;
 
     if (!state)
     {

+ 26 - 24
CAE_Solution/src/manager_acis_modeller.h

@@ -26,31 +26,33 @@ void iniACIS(){
  * @birth: created by czm in 20230922
  */
 bool initIop(){
-    // IOP is called in its own scope.
-    // This sample uses a guard class that initializes InterOp upon
-    // construction and terminates InterOp upon destruction.  All
-    // translations are done within the boundaries of a single
-    // initialization and shutdown.  InterOp may only be initialized
-    // and shutdown once per process.  Please do not use the guard
-    // classes multiple times per process.
-    SPAIopAcisSystemInitGuard initGuard(SPATIAL_LICENSE);
-    int result = initGuard.GetInitStatus();
+//    // IOP is called in its own scope.
+//    // This sample uses a guard class that initializes InterOp upon
+//    // construction and terminates InterOp upon destruction.  All
+//    // translations are done within the boundaries of a single
+//    // initialization and shutdown.  InterOp may only be initialized
+//    // and shutdown once per process.  Please do not use the guard
+//    // classes multiple times per process.
+//    SPAIopAcisSystemInitGuard initGuard(SPATIAL_LICENSE);
+//    int result = initGuard.GetInitStatus();
 
-    if (SPA_UNLOCK_NO_MSG == result)
-    {
-        // Spatial products have been unlocked
-        printf("SUCCESS: SPAIopAcisSystem::Initialize. \n");
-    }
-    else if (SPA_UNLOCK_KEY_WARN_EXPIRE == result)
-        printf("SPAIopAcisSystem::Initialize returned SPA_UNLOCK_KEY_WARN_EXPIRE; your license key will expire soon!\n");
-    else if (SPA_UNLOCK_REGISTRATION_WARN_EXPIRE == result)
-        printf("SPAIopAcisSystem::Initialize returned SPA_UNLOCK_REGISTRATION_WARN_EXPIRE; your registration will expire soon.\n");
-    else
-    {
-        printf("SPAIopAcisSystem::Initialize returned an unexpected value; Contact Spatial Customer Support or your Account Manager.\n");
-        return false;
-    }
-    result = 1;
+//    if (SPA_UNLOCK_NO_MSG == result)
+//    {
+//        // Spatial products have been unlocked
+//        printf("SUCCESS: SPAIopAcisSystem::Initialize. \n");
+//    }
+//    else if (SPA_UNLOCK_KEY_WARN_EXPIRE == result)
+//        printf("SPAIopAcisSystem::Initialize returned SPA_UNLOCK_KEY_WARN_EXPIRE; your license key will expire soon!\n");
+//    else if (SPA_UNLOCK_REGISTRATION_WARN_EXPIRE == result)
+//        printf("SPAIopAcisSystem::Initialize returned SPA_UNLOCK_REGISTRATION_WARN_EXPIRE; your registration will expire soon.\n");
+//    else
+//    {
+//        printf("SPAIopAcisSystem::Initialize returned an unexpected value; Contact Spatial Customer Support or your Account Manager.\n");
+//        return false;
+//    }
+//    result = 1;
+    SPAIopAcisSystem::Shutdown();
+    SPAIopAcisSystem::Initialize(SPATIAL_LICENSE);
     return true;
 }
 

+ 3 - 0
CAE_Solution/src/threadPool_and_statemachine/dealWith/handlepool.cpp

@@ -36,6 +36,9 @@ handlePool::handlePool(QTabWidget *w)
     line_sendrange_flag = false;
 
     iniACIS();
+    initIop();
+//    SPAIopAcisSystem::Shutdown();
+//    SPAIopAcisSystem::Initialize(SPATIAL_LICENSE);
     cmdp = new cmdMainProcess();
 }