示例#1
0
 /// <summary>Gets the name of a specific output control parameter</summary>
 public string GetOutputCtrlParamName(int index)
 {
     if (index < 1 || index > this.parNamesCtrlOutput.Length)
     {
         HDevEngineException.ThrowGeneric("Bad index for GetOutputCtrlParamName");
     }
     return(this.parNamesCtrlOutput.SArr[index - 1]);
 }
示例#2
0
 /// <summary>Gets the dimension of a specific
 /// output control parameter</summary>
 public int GetOutputCtrlParamDimension(int index)
 {
     if (index < 1 || index > this.parDimensionsCtrlOutput.Length)
     {
         HDevEngineException.ThrowGeneric("Bad index for GetOutputCtrlParamDimension");
     }
     return((int)this.parDimensionsCtrlOutput[index - 1]);
 }
示例#3
0
 internal static void HCkE(int err)
 {
     if (err != -1 && (err == 2 || err == 2))
     {
         return;
     }
     HDevEngineException.ThrowLastException(err);
 }
示例#4
0
 /// <summary>Gets the dimension of a specific control variable</summary>
 public int GetCtrlVarDimension(int index)
 {
     if (index < 1 || index > this.varDimsCtrl.Length)
     {
         HDevEngineException.ThrowGeneric("Bad index for GetCtrlVarDimension");
     }
     return((int)this.varDimsCtrl[index - 1]);
 }
示例#5
0
 /// <summary>Gets the name of a specific control variable</summary>
 public string GetCtrlVarName(int index)
 {
     if (index < 1 || index > this.varNamesCtrl.Length)
     {
         HDevEngineException.ThrowGeneric("Bad index for GetCtrlVarName");
     }
     return(this.varNamesCtrl.SArr[index - 1]);
 }
 /// <summary>
 /// Creates an instance of the fixed window implementation
 /// </summary>
 /// <param name="windowID">The window ID of an existing HALCON window</param>
 public HDevOpFixedWindowImpl(HTuple windowID)
 {
     if (windowID.Length != 1)
     {
         HDevEngineException.ThrowGeneric("Please specify exactly one window ID");
     }
     this.activeID = windowID.Clone();
 }
示例#7
0
 /// <summary>Loads a local procedure</summary>
 public void LoadProcedure(HDevProgram program, string procedureName)
 {
     if (program.Handle == IntPtr.Zero)
     {
         HDevEngineException.ThrowGeneric("Uninitialized program while creating a local procedure call");
     }
     HDevProcedure.HCkE(EngineAPI.LoadProcedure(this.procedure, program.Handle, procedureName));
     GC.KeepAlive((object)this);
     this.UpdateProcedureInfo();
 }
示例#8
0
        internal static void AssertObjectClass(IntPtr key, string assertClass, string procedureName)
        {
            if (!(key != HObjectBase.UNDEF))
            {
                return;
            }
            HObject hobject  = new HObject(key);
            HTuple  objClass = hobject.GetObjClass();

            hobject.Dispose();
            if (objClass.Length <= 0)
            {
                return;
            }
            string s = objClass.S;

            if (s.StartsWith(assertClass))
            {
                return;
            }
            HDevEngineException.ThrowGeneric("Output object type mismatch (excepted " + assertClass + ", got " + s + ")", procedureName);
        }