public void CalT(int nCam, XScalar xStartPos, XScalar xEndPos) { if (0 <= nCam && nCam < MAX_CAM && xStartPos != null && xEndPos != null) { m_xTable.CalT(nCam, m_xMoveCalibration.T, xStartPos, xEndPos, m_xCam[nCam].Cal); } }
public void CalX(int nCam, XScalar xStartPos, XScalar xEndPos) { if (m_xMoveCalibration.X != 0 && 0 <= nCam && nCam < MAX_CAM && xStartPos != null && xEndPos != null) { m_xCam[nCam].Cal.X = m_xMoveCalibration.X / (xEndPos.X - xStartPos.X); } }
public void CalY(int nCam, XScalar xStartPos, XScalar xEndPos) { if (m_xMoveCalibration.Y != 0 && 0 <= nCam && nCam < MAX_CAM && xStartPos != null && xEndPos != null) { m_xCam[nCam].Cal.Y = m_xMoveCalibration.Y / (xEndPos.Y - xStartPos.Y); } }
public bool GetMotionUVW(ref XVector xMove, ref XScalar xU, ref XScalar xV, ref XScalar xW) { GetLocal(ref xMove); double dTx = 0, dTy = 0; { //U RotateMethod(63640, 63640, xMove.T, ref dTx, ref dTy); xU.Set(dTx, dTy); } { //V RotateMethod(-63640, -63640, xMove.T, ref dTx, ref dTy); xV.Set(dTx, dTy); } { //W RotateMethod(63640, -63640, xMove.T, ref dTx, ref dTy); xW.Set(dTx, dTy); } xMove.X *= m_xMotorDirection.X; xMove.Y *= m_xMotorDirection.Y; xMove.T *= m_xMotorDirection.T * 180000 / Math.PI; double dLimitT = m_xMoveLimit.T * 180000 / Math.PI; if (m_xMoveLimit.X > Math.Abs(xMove.X) && m_xMoveLimit.Y > Math.Abs(xMove.Y) && dLimitT > Math.Abs(xMove.T)) { return(true); } return(false); }
public void CalScale(XVector xDeviation) { XScalar xCoor = new XScalar(Coordinate); xCoor.Rotate(xDeviation.T); Scale.Set(xCoor - xDeviation - Mark); }
public XVector GetCalT(int nCam, XScalar xStartPos, XScalar xEndPos) { if (0 <= nCam && nCam < MAX_CAM && xStartPos != null && xEndPos != null) { return(m_xTable.GetCalT(nCam, m_xMoveCalibration.T, xStartPos, xEndPos, m_xCam[nCam].Cal)); } return(null); }
public XVector GetCalT(int nCam, double dMoveT, XScalar xStartPos, XScalar xEndPos, XScalar xCal) { XVector xMarkPos = new XVector(); XScalar xDelta = (xEndPos - xStartPos) * xCal; double dDn = 1.0 + Math.Sin(dMoveT) * Math.Sin(dMoveT) / (1.0 - Math.Cos(dMoveT)) - Math.Cos(dMoveT); double dUp = xDelta.X * Math.Sin(dMoveT) / (1.0 - Math.Cos(dMoveT)) - xDelta.Y; xMarkPos.Y = dUp / dDn; xMarkPos.X = (xMarkPos.Y * Math.Sin(dMoveT) - xDelta.X) / (1.0 - Math.Cos(dMoveT)); return(xMarkPos); }
private XScalar GetDelta(int a, int b) { XScalar xCenter = m_xCam[a].Mark + m_xCam[b].Mark; if (xCenter.X < 1 && xCenter.Y < 1) { return((m_xCam[a].Dist + m_xCam[b].Dist) / 2); } else { double dT = m_xDeviation.T; XScalar A = new XScalar(m_xCam[a].Coordinate); XScalar B = new XScalar(m_xCam[b].Coordinate); A.Rotate(-dT); B.Rotate(-dT); return(((A - m_xCam[a].Mark) + (B - m_xCam[b].Mark)) / 2); } }
public PScalar() { m_nSelect = 0; m_dCalX = 1.0; m_dCalY = 1.0; m_dNomX = 0.0; m_dNomY = 0.0; m_dMinX = -100000.0; m_dMaxX = 100000.0; m_dMinY = -100000.0; m_dMaxY = 100000.0; m_sFormatX = "{0:F1}"; m_sFormatY = "{0:F1}"; m_cBolderColor = Color.DarkBlue; m_cValueColor = Color.White; InitializeComponent(); m_xScalar = new XScalar(); }
public bool GetMotionUVWX(XVector xMove, ref XScalar xU, ref XScalar xV, ref XScalar xW, ref XScalar xX) { xMove.X *= m_xMotorDirection.X; xMove.Y *= m_xMotorDirection.Y; xMove.T *= m_xMotorDirection.T; double dTx = 0, dTy = 0; { //U RotateMethod(-1005000, 755000, xMove.T, ref dTx, ref dTy); xU.Set(dTx, dTy); } { //V RotateMethod(1005000, 755000, xMove.T, ref dTx, ref dTy); xV.Set(dTx, dTy); } { //W RotateMethod(-1005000, -755000, xMove.T, ref dTx, ref dTy); xW.Set(dTx, dTy); } { //W RotateMethod(1005000, -755000, xMove.T, ref dTx, ref dTy); xX.Set(dTx, dTy); } xMove.T *= 180000 / Math.PI; double dLimitT = m_xMoveLimit.T * 180000 / Math.PI; if (m_xMoveLimit.X > Math.Abs(xMove.X) && m_xMoveLimit.Y > Math.Abs(xMove.Y) && dLimitT > Math.Abs(xMove.T)) { return(true); } return(false); }
private void GetDelta(int nCameraMode) { switch (m_nCamCount) { case 1: { m_xDeviation.Set(m_xCam[0].Dist); } break; case 2: { m_xDeviation.Set(GetDelta(0, 1)); } break; case 3: switch (m_nCamPoseMode) { case 7: switch (nCameraMode) { case 3: m_xDeviation.Set(GetDelta(0, 1)); break; case 5: m_xDeviation.Set(GetDelta(2, 0)); break; case 6: m_xDeviation.Set(GetDelta(2, 1)); break; case 7: { XScalar dDeviationSum = new XScalar(); dDeviationSum.Set(dDeviationSum + GetDelta(0, 1)); dDeviationSum.Set(dDeviationSum + GetDelta(2, 1)); m_xDeviation.Set(dDeviationSum / 2); } break; } break; case 11: break; case 12: break; case 13: break; case 14: break; } break; case 4: switch (nCameraMode) { case 3: m_xDeviation.Set(GetDelta(0, 1)); break; case 5: m_xDeviation.Set(GetDelta(2, 0)); break; case 10: m_xDeviation.Set(GetDelta(3, 1)); break; case 12: m_xDeviation.Set(GetDelta(2, 3)); break; case 7: { XScalar dDeviationSum = new XScalar(); dDeviationSum.Set(dDeviationSum + GetDelta(0, 1)); dDeviationSum.Set(dDeviationSum + GetDelta(2, 1)); m_xDeviation.Set(dDeviationSum / 2); } break; case 11: { XScalar dDeviationSum = new XScalar(); dDeviationSum.Set(dDeviationSum + GetDelta(0, 1)); dDeviationSum.Set(dDeviationSum + GetDelta(3, 1)); m_xDeviation.Set(dDeviationSum / 2); } break; case 13: { XScalar dDeviationSum = new XScalar(); dDeviationSum.Set(dDeviationSum + GetDelta(2, 0)); dDeviationSum.Set(dDeviationSum + GetDelta(2, 3)); m_xDeviation.Set(dDeviationSum / 2); } break; case 14: { XScalar dDeviationSum = new XScalar(); dDeviationSum.Set(dDeviationSum + GetDelta(3, 1)); dDeviationSum.Set(dDeviationSum + GetDelta(2, 1)); m_xDeviation.Set(dDeviationSum / 2); } break; case 15: { XScalar dDeviationSum = new XScalar(); dDeviationSum.Set(dDeviationSum + GetDelta(0, 1)); dDeviationSum.Set(dDeviationSum + GetDelta(2, 3)); dDeviationSum.Set(dDeviationSum + GetDelta(2, 0)); dDeviationSum.Set(dDeviationSum + GetDelta(3, 1)); m_xDeviation.Set(dDeviationSum / 4); } break; } break; } }