| | |
| | | string _precision = "f3"; |
| | | double _allowedShift = 0; |
| | | |
| | | double _allowedShift2 = 0; |
| | | |
| | | public override void Open() |
| | | { |
| | | InitialSetting(); |
| | |
| | | DataUploadMethod = InitialMESWebServiceMethod(DataUploadMethodName, out DataUploadObj); |
| | | } |
| | | |
| | | PrepareDataShift(); |
| | | } |
| | | |
| | | private void PrepareDataShift() |
| | | { |
| | | var allowedShiftStr = ConfigurationManager.AppSettings["DataShift"]; |
| | | if (!double.TryParse(allowedShiftStr, out _allowedShift)) |
| | | { |
| | | _allowedShift = 0; |
| | | } |
| | | |
| | | string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "dataShift"); |
| | | if (!File.Exists(path)) |
| | | { |
| | | _allowedShift2 = 0; |
| | | } |
| | | else |
| | | { |
| | | using (StreamReader reader = new StreamReader(path, System.Text.Encoding.UTF8)) |
| | | { |
| | | string data = reader.ReadToEnd(); |
| | | |
| | | if (!string.IsNullOrWhiteSpace(data)) |
| | | { |
| | | if (double.TryParse(data, out double dataValue)) |
| | | { |
| | | _allowedShift2 = dataValue; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | _allowedShift += _allowedShift2; |
| | | } |
| | | |
| | | private void InitialMotionCardBaseAxisAlarm() |
| | |
| | | } |
| | | } |
| | | |
| | | return new ProcessResponse(true); |
| | | } |
| | | |
| | | [ProcessMethod("", "SortKeyUnits", "单键配置排序", InvokeType.TestInvoke)] |
| | | public ProcessResponse SortKeyUnits(IOperationConfig opConfig, IDevice invokeDevice, IDevice sourceDevice) |
| | | { |
| | | if (Config.KeyUnitCollection.Count > 0) |
| | | { |
| | | Config.KeyUnitCollection = Config.KeyUnitCollection.OrderBy(u => u.SnapshotPointId).ThenBy(u => u.ImageSeq).ToList(); |
| | | } |
| | | return new ProcessResponse(true); |
| | | } |
| | | #endregion |
| | |
| | | } |
| | | else |
| | | { |
| | | var results = _halconToolDict[keyToolKey].GetResultTuple("OUTPUT_Results").DArr.ToList(); |
| | | var results = _halconToolDict[keyToolKey].GetResultTuple("OUTPUT_Results").HTupleToDouble(); |
| | | if (results.Count == 0 || results.Any(u => u < 0)) |
| | | { |
| | | LogAsync(DateTime.Now, $"{k.AliasName}原始数据{string.Join(",", results)}异常", ""); |