예제 #1
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     try
     {
         HSystem.GetSystem("version");
     }
     catch (HOperatorException hEx)
     {
         var messageBoxResult = MessageBox.Show($"HALCON unable to initialize. Please check if license and dongle are installed correctly.\r\n{hEx.Message}", "HALCON Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Environment.Exit(hEx.GetErrorCode());
     }
     Application.Run(new Form1());
 }
예제 #2
0
        private void ExecExtProcForm_Load(object sender, System.EventArgs e)
        {
            // path of external procedures
            string halconExamples = HSystem.GetSystem("example_dir");
            string ProcedurePath  = halconExamples + @"\hdevengine\procedures";

            if (!HalconAPI.isWindows)
            {
                // Unix-based systems (Mono)
                ProcedurePath = ProcedurePath.Replace('\\', '/');
            }
            MyEngine.SetProcedurePath(ProcedurePath);

            // disable Execute button
            ExecuteBtn.Enabled = false;
        }
예제 #3
0
        private void ExecProceduresForm_Load(object sender, System.EventArgs e)
        {
            // path of external procedures
            string halconExamples = HSystem.GetSystem("example_dir");
            string ProcedurePath  = halconExamples + @"\hdevengine\procedures";

            ProgramPathString = halconExamples +
                                @"\hdevengine\hdevelop\fin_detection.hdev";
            if (!HalconAPI.isWindows)
            {
                // Unix-based systems (Mono)
                ProcedurePath     = ProcedurePath.Replace('\\', '/');
                ProgramPathString = ProgramPathString.Replace('\\', '/');
            }
            MyEngine.SetProcedurePath(ProcedurePath);
            // disable buttons
            InitAcqBtn.Enabled          = false;
            ProcessImageBtn.Enabled     = false;
            VisualizeDetailsBtn.Enabled = false;
        }