Commit 2ab07c86 几米阳光

回原点反向都是负方向,料格都是7*8的

1 个父辈 542e90dd
......@@ -131,6 +131,7 @@ namespace ACServoDriveTest
}
private void Form1_Load(object sender, EventArgs e)
{
ACServerManager.IsShowMsg = true;
LogUtil.logBox = this.richTextBox1;
//ACServerManager.richeBox = this.richTextBox1;
formStatus(false);
......
......@@ -20,7 +20,7 @@
<add key="Store_Position_Config" value="\StoreConfig\AC\linePositions.csv" />
<add key="Store_ConfigPath" value="\StoreConfig\AC\StoreConfig.csv" />
<add key="Store_Type" value="RC_AC_SA" />
<add key="Store_CID" value="bjac1" />
<add key="Store_CID" value="ldac1" />
<!--end one store config-->
<!--摄像机名称列表配置,用#分割-->
......
......@@ -485,10 +485,10 @@
//
this.txtHeight.Enabled = false;
this.txtHeight.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtHeight.Location = new System.Drawing.Point(84, 116);
this.txtHeight.Location = new System.Drawing.Point(113, 116);
this.txtHeight.MaxLength = 10;
this.txtHeight.Name = "txtHeight";
this.txtHeight.Size = new System.Drawing.Size(240, 23);
this.txtHeight.Size = new System.Drawing.Size(211, 23);
this.txtHeight.TabIndex = 254;
this.txtHeight.Text = "0";
//
......@@ -499,9 +499,9 @@
this.label9.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label9.Location = new System.Drawing.Point(15, 119);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(68, 17);
this.label9.Size = new System.Drawing.Size(92, 17);
this.label9.TabIndex = 253;
this.label9.Text = "实时高度:";
this.label9.Text = "实时料盘高度:";
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label8
......
......@@ -13,7 +13,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public partial class ACServerManager
{
private static bool IsShowMsg = false ;
public static bool IsShowMsg = false ;
private static int SleepMSendons = 100;
private static Dictionary<string, Dictionary<string, int>> ComAddrValue = new Dictionary<string, Dictionary<string, int>>();
......@@ -298,21 +298,21 @@ namespace OnlineStore.DeviceLibrary
//byte[] data = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteRegisters, ACCMDManager.BlockNo, ACCMDManager.Block_HomeMove1, 2);
//SendData(portName, data);
//旋转轴回正方向,其他轴回负方向
if (portName.Equals(ACStoreManager.store.Config.Middle_Axis.DeviceName))
{
UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove0);
LogUtil.info("旋转轴原点返回方向:正方向");
}
else if (portName.Equals(ACStoreManager.store.Config.InOut_Axis.DeviceName))
{
UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove0);
LogUtil.info("进出轴原点返回方向:正方向");
}
else
{
//if (portName.Equals(ACStoreManager.store.Config.Middle_Axis.DeviceName))
//{
// UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove0);
// LogUtil.info("旋转轴原点返回方向:正方向");
//}
//else if (portName.Equals(ACStoreManager.store.Config.InOut_Axis.DeviceName))
//{
// UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove0);
// LogUtil.info("进出轴原点返回方向:正方向");
//}
//else
//{
UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove1);
LogUtil.info("升降轴原点返回方向:反方向");
}
LogUtil.info("回原点:反方向");
//}
Thread.Sleep(SleepMSendons);
OpenAndCloseSTB(portName, slvAddr);
}
......
......@@ -119,6 +119,6 @@ PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,,,
,,,,,,,,, ,
PRO,模拟量IO模块的IP地址,AIDevice_IP,192.168.200.11,,,,,,,
PRO,模拟信号1默认高度,AIDI1_DefaultPosition,2500,,,,,,,
PRO,模拟信号2默认高度,AIDI2_DefaultPosition,2500,,,,,,,
PRO,模拟信号3默认高度,AIDI3_DefaultPosition,2500,,,,,,,
PRO,模拟信号2默认高度,AIDI2_DefaultPosition,2510,,,,,,,
PRO,模拟信号3默认高度,AIDI3_DefaultPosition,2520,,,,,,,
,,,,,,,,, ,
......@@ -418,7 +418,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(LOGGER, StoreName + "到待机状态,压紧轴回原点,关闭舱门");
if (IsHasCompress_Axis)
{
ShuoKeControls.HomeMove(Config.CompressAxis_Slv, 1);
ShuoKeControls.HomeMove(Config.CompressAxis_Slv, 0);
StoreMove.WaitList.Add(WaitResultInfo.WaitShuoKe(Config.CompressAxis_Slv, 1, true));
}
//关闭舱门
......@@ -950,12 +950,12 @@ namespace OnlineStore.DeviceLibrary
{
TimeSpan span = DateTime.Now - StartWaitScanTime;
if (span.TotalSeconds > 0.5)
{
{
isWaitScan = false;
IsScanCode = true;
LogUtil.info(StoreName + "检测到料盘信号且等待0.5秒,开始扫码");
//BeginScannering();
GetCameraCode();
GetCameraCode();
}
}
else
......@@ -1316,19 +1316,24 @@ namespace OnlineStore.DeviceLibrary
private string spiltStr = "##";
private void scanTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
int height = GetHeight();
DateTime date = DateTime.Now;
scanTimer.Enabled = false;
KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
string message = "";
List<string> codeList = HDevelopExport.CameraScan();
//= 1 + 123.4x100.5 - 7x12 = CODE
foreach (string str in codeList)
{
string code = HDevelopExport.SubStrCode(str);
code = "=7X"+height+" =" + code;
message = message + code + spiltStr;
}
KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
double height = GetHeight();
onCodeReceived(message);
}
......@@ -1351,15 +1356,42 @@ namespace OnlineStore.DeviceLibrary
#endregion
#region 高度传感器处理
public double GetHeight()
public int GetHeight()
{
double result = 0;
double ai1Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP,1), Config.AIDI1_DefaultPosition);
int result = 0;
double ai1Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, 1), Config.AIDI1_DefaultPosition);
double ai2Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, 2), Config.AIDI2_DefaultPosition);
double ai3Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, 3), Config.AIDI3_DefaultPosition);
result =Math.Round( (ai1Value + ai2Value + ai3Value) / 3,1);
double Value = Math.Round((ai1Value + ai2Value + ai3Value) / 3, 1);
//int radValue =(int) ( Value / 4);
//double mValue = (Value % 4);
//if (mValue > 1)
//{
// result = radValue * 4 + 4;
//}
//else
//{
// result = radValue * 4;
//}
if (Value > 14)
{
result = 16;
}
else if (Value >= 10)
{
result = 12;
}
else if (Value >= 4)
{
result = 8;
}
else
{
result = 0;
}
return result;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!