Beispiel #1
0
        public void EngineStatusInitializedAfterLaunch()
        {
            VBAIEngine       engine     = new VBAIEngine("APITest", "", true);
            EngineStatusInfo engineInfo = engine.GetEngineStatus();

            Assert.True(engineInfo.status == EngineStatus.Initialized, "Engine is not in 'Initialized' state after launch.");
        }
Beispiel #2
0
 public bool OpenEngine()
 {
     try
     {
         vBAIEngine = new VBAIEngine("LeaderVision", "", true);
         vBAIEngine.OpenInspection(vbaipath);
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Beispiel #3
0
 private void Launch_engine_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         // passing an emtpy string for the version will launch the latest Vision Builder AI engine available on the system.
         engine = new VBAIEngine("APITest", "", true);
         btnLaunchEngine.IsEnabled   = false;
         btnOpenInspection.IsEnabled = true;
     }
     catch (VBAIException ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #4
0
 private void launch_Click(object sender, EventArgs e)
 {
     try
     {
         // Passing an emtpy string for the version will launch the latest Vision Builder AI engine available on the system.
         engine         = new VBAIEngine("APITest", "", true);
         launch.Enabled = false;
         open.Enabled   = true;
     }
     catch (VBAIException ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #5
0
        public static Exception VBAIError(Error error)
        {
            Debug.Assert(error < 0);
            string message = "";

            try
            {
                byte[] str = new byte[256];
                Error  err = VBAIEngine.vbaiGetErrorString(error, str, 256);
                message = VBAIEngine.ConvertBytesToString(str);

                message = message.Replace("\n", Environment.NewLine);
            }
            catch (Exception)
            {
                message = String.Format(CultureInfo.InvariantCulture, "Could not get error message.");
            }
            finally
            {
                throw new VBAIException(message, (int)error);
            }
        }
Beispiel #6
0
 public VBAIEngine Startengine()
 {
     engine = new VBAIEngine("APITest", "", false);
     return(engine);
 }