/// <summary> /// 序列化构造函数 /// </summary> /// <param name="info"></param> /// <param name="context"></param> private HalAcqContrast(SerializationInfo info, StreamingContext context) { _stateFlags = GetStateFlages(); contrast = (HTuple)info.GetValue("contrast", typeof(HTuple)); contrastMin = (HTuple)info.GetValue("contrastMin", typeof(HTuple)); contrastMax = (HTuple)info.GetValue("contrastMax", typeof(HTuple)); }
private void AssignToolResult(CogResultsAnalysisTool cogResults) { CogResultsAnalysisResult results = cogResults.Result; CogResultsAnalysisEvaluationInfoCollection evaluatedExpressions = results.EvaluatedExpressions; for (int i = 0; i < evaluatedExpressions.Count; i++) { CogResultsAnalysisEvaluationInfo info = evaluatedExpressions[i]; System.Collections.Specialized.StringCollection keys = evaluatedExpressions.Keys as System.Collections.Specialized.StringCollection; if (info != null && keys != null) { StateFlagsCollection sfc = info.Expression.StateFlags; AddResult(string.Format("{0}.{1}", cogResults.Name, keys[i]), Convert.ToDouble(info.Value)); } } //foreach (CogToolBlockTerminal output in cogResults.Result) //{ // if ((output.ValueType == typeof(double) || output.ValueType == typeof(int)) && output.Value != null) // { // AddResult(string.Format("{0}.{1}", cogToolBlock.Name, output.Name), Convert.ToDouble(output.Value)); // } // else if (output.ValueType == typeof(CogBlobResults)) // { // AssignToolResult(string.Format("{0}.{1}", cogToolBlock.Name, output.Name), output.Value as CogBlobResults); // } //} }
/// <summary> /// 获取状态位数据集 /// </summary> /// <returns></returns> private static StateFlagsCollection GetStateFlages() { if (_stateFlags == null) { HalAcqImageProperty._stateFlags = new StateFlagsCollection(typeof(HalAcqImageProperty)); } return(HalAcqImageProperty._stateFlags); }
public HalAcqContrast(HTuple hAcq) { __acqHandle = hAcq; if (__acqHandle.TupleNotEqual(null)) { _stateFlags = GetStateFlages(); } }
private static StateFlagsCollection GetStateFlags() { if (_stateFlags == null) { HalAcqExposure._stateFlags = new StateFlagsCollection(typeof(HalAcqExposure)); } return(HalAcqExposure._stateFlags); }
/// <summary> /// 构造函数 /// </summary> /// <param name="hAcq">相机句柄</param> public HalAcqImageProperty(ref HTuple hAcq) { __acqHandle = hAcq; if (__acqHandle.TupleNotEqual(null)) { _stateFlags = GetStateFlages(); //加载相机参数 InitializeParam(); } }
public HalAcqContrast(ref HTuple hAcq) { __acqHandle = hAcq; if (__acqHandle.TupleNotEqual(null)) { _stateFlags = GetStateFlages(); InitializePram(); GetParamIsExist(); } }
/// <summary> /// 反序列化构造函数 /// </summary> /// <param name="info"></param> /// <param name="context"></param> private HalAcqImageProperty(SerializationInfo info, StreamingContext context) { _stateFlags = GetStateFlages(); //加载参数 offSetX = (HTuple)info.GetValue("offSetX", typeof(HTuple)); offsetX_Min = (HTuple)info.GetValue("offsetX_Min", typeof(HTuple)); offsetX_Max = (HTuple)info.GetValue("offsetX_Max", typeof(HTuple)); offSetY = (HTuple)info.GetValue("offsetY", typeof(HTuple)); offsetY_Min = (HTuple)info.GetValue("offsetY_Min", typeof(HTuple)); offsetY_Max = (HTuple)info.GetValue("offsetY_Max", typeof(HTuple)); width = (HTuple)info.GetValue("width", typeof(HTuple)); width_Min = (HTuple)info.GetValue("width_Min", typeof(HTuple)); width_Max = (HTuple)info.GetValue("width_Max", typeof(HTuple)); height = (HTuple)info.GetValue("height", typeof(HTuple)); height_Min = (HTuple)info.GetValue("height_Min", typeof(HTuple)); height_Max = (HTuple)info.GetValue("height_Max", typeof(HTuple)); }