public MaxPoints CharacterPoint(CalculationParameter CaculateParamater) { double MiddlePosition = CaculateParamater.Center; double R = CaculateParamater.R; int factor = CaculateParamater.Factor; MaxPoints res = new MaxPoints(); double x_Left = Math.Round(MiddlePosition - R, 2); double x_Right = Math.Round(MiddlePosition + R, 2); int IndexLeft = Location(AxisX, x_Left); int IndexRight = Location(AxisX, x_Right); List <double> K1 = QCDSDataFitWithDirection(factor, Define.LEFT_TO_RIGHT); List <double> K2 = QCDSDataFitWithDirection(factor, Define.RIGHT_TO_LEFT); List <double> X_Area = new List <double>(); List <double> Y_Area = new List <double>(); List <double> K1_Area = new List <double>(); List <double> K2_Area = new List <double>(); for (int i = IndexLeft; i <= IndexRight; i++) { X_Area.Add(AxisX[i]); Y_Area.Add(ProfileData_float[i]); K1_Area.Add(K1[i]); K2_Area.Add(K2[i]); } res = findMax(X_Area, Y_Area, K1_Area, K2_Area); return(res); }
public BatchData(SeamInformation SeamInformation) { BatchInformation = SeamInformation; Gap = new List <ProfileData>(); Seam = new List <ProfileData>(); GapCalculationParameters = new CalculationParameter(0, 2, 10); SeamCalculationParameters = new CalculationParameter(0, 2, 10); }
public double GetPos(CalculationParameter CalculateParameter) { double MiddlePosition = CalculateParameter.Center; double R = CalculateParameter.R; int factor = CalculateParameter.Factor; MaxPoints CP = CharacterPoint(MiddlePosition, R, factor); return(Math.Round((CP.x[0] + CP.x[1]) - MiddlePosition, 2)); }
private void ParameterRefresh() { _sendCommand = SendCommand.None; _deviceData = new DeviceData[NativeMethods.DeviceCount]; _callback = new HighSpeedDataCallBack(ReceiveHighSpeedData); for (int i = 0; i < NativeMethods.DeviceCount; i++) { _deviceData[i] = new DeviceData(); } _profileInfo = new LJV7IF_PROFILE_INFO[NativeMethods.DeviceCount]; currentBatch = new BatchData(); CPGap = new CalculationParameter(0, 2, 10); CPSeam = new CalculationParameter(0, 2, 10); }
public double GetHeightDifference(CalculationParameter CalculateParameter) { double MiddlePosition = CalculateParameter.Center; double R = CalculateParameter.R; int factor = CalculateParameter.Factor; double gapHeightDiff = 0; MaxPoints CP = CharacterPoint(MiddlePosition, R, factor); double x_Left = Math.Round(MiddlePosition - R, 2); double x_Right = Math.Round(MiddlePosition + R, 2); int IndexLeft = Location(AxisX, x_Left); //left start int IndexRight = Location(AxisX, x_Right); //right end int IndexLeftPoint = Location(AxisX, CP.x[0]); //left end int IndexRightPoint = Location(AxisX, CP.x[1]); //right start gapHeightDiff = gapHeightDifference(AxisX, ProfileData_float, IndexLeft, IndexLeftPoint, IndexRightPoint, IndexRight); return(gapHeightDiff); }
public double GetSeamDown(CalculationParameter CalculateParameter) { double MiddlePosition = CalculateParameter.Center; double R = CalculateParameter.R; int factor = CalculateParameter.Factor; double SeamDown = 0; MaxPoints CP = CharacterPoint(MiddlePosition, R, factor); int IndexLeftPoint = Location(AxisX, CP.x[0]); //left end int IndexRightPoint = Location(AxisX, CP.x[1]); //right start List <double> Seam = new List <double>(); for (int i = IndexLeftPoint; i <= IndexRightPoint; i++) { Seam.Add(ProfileData_float[i]); } SeamDown = Seam.Min() - CP.y.Min(); return(SeamDown); }
public BatchData() { BatchInformation = new SeamInformation(); BatchInformation.Date = DateTime.Today.ToString("yyyy-MM-dd"); BatchInformation.Time = DateTime.Now.ToLongTimeString(); BatchInformation.InputSteelCode = "None"; BatchInformation.OutputSteelCode = "None"; BatchInformation.InputMaterial = "Default"; BatchInformation.OutputMaterial = "Default"; BatchInformation.InputThickness = 0; BatchInformation.OutputThickness = 0; BatchInformation.InputWidth = 0; BatchInformation.OutputWidth = 0; Gap = new List <ProfileData>(); Seam = new List <ProfileData>(); GapCalculationParameters = new CalculationParameter(0, 2, 10); SeamCalculationParameters = new CalculationParameter(0, 2, 10); }