You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
2.0 KiB
C#

using Rs.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Rs.MotionPlat.Commom
{
public static class NozzleHelper
{
public static double GetNozzle2CameraDistX(int nozzleIndex)
{
//先计算吸嘴1到相机中心的距离
double nozzle12CameraDist = SysConfigParam.GetValue<double>("InkpadX") - SysConfigParam.GetValue<double>("CameraInkpadX");
//在计算指定吸嘴到吸嘴1的距离
double nozzle2Nozzle1Dist= SysConfigParam.GetValue<double>($"Nozzle{nozzleIndex}CenterX") - SysConfigParam.GetValue<double>("Nozzle1CenterX");
return nozzle12CameraDist + nozzle2Nozzle1Dist;
}
public static double GetNozzle2CameraDistY(int nozzleIndex)
{
//先计算吸嘴1到相机中心的距离
double nozzle12CameraDist = SysConfigParam.GetValue<double>("InkpadY") - SysConfigParam.GetValue<double>("CameraInkpadY");
//在计算指定吸嘴到吸嘴1的距离
double nozzle2Nozzle1Dist = SysConfigParam.GetValue<double>($"Nozzle{nozzleIndex}CenterY") - SysConfigParam.GetValue<double>("Nozzle1CenterY");
return nozzle12CameraDist + nozzle2Nozzle1Dist;
}
/// <summary>
/// 获取吸嘴下压的偏移高度
/// </summary>
/// <param name="fetchNum"></param>
/// <returns></returns>
private static double GetNozzleOffsetHeight(int fetchNum)
{
switch (fetchNum)
{
case 0:
return 0;
case 1:
return -0.1;
case 2:
return -0.2;
case 3:
return -0.3;
case 4:
return 0.1;
case 5:
return 0.2;
case 6:
return 0.3;
default:
return 0;
}
}
}
}