Commit 68e56f25 LN

io修改

1 个父辈 561968aa
......@@ -1455,7 +1455,7 @@ namespace OnlineStore.ACSingleStore
// if (store.Config.StoreDIList.ContainsKey(IO_Type.UpdownPositionSingal))
if (store.Config.StoreDIList.ContainsKey(IO_Type.TrayCheck_Fixture))
{
ioIP = store.Config.StoreDIList[IO_Type.TrayCheck_Fixture].DeviceName;
ioIP = store.Config.StoreDIList[IO_Type.TrayCheck_Fixture].IO_IP;
ioIndex = store.Config.StoreDIList[IO_Type.TrayCheck_Fixture].GetIOAddr();
}
FrmPositionTool frm = new FrmPositionTool(PortName, slvAddr, ioIP, ioIndex);
......
......@@ -35,7 +35,7 @@ namespace OnlineStore.ACSingleStore
this.IoIndex = ioIndex;
toolTimer.Enabled = false;
toolTimer.Interval = 100;
toolTimer.Interval = 50;
toolTimer.AutoReset = true;
toolTimer.Elapsed += ToolTimer_Elapsed;
......@@ -187,7 +187,7 @@ namespace OnlineStore.ACSingleStore
string filePath = Application.StartupPath + @"\logs\" + fileName;
if (File.Exists(filePath))
{
string msg = "文件【{0}】已存在,是否确定覆盖?";
string msg = "文件【"+fileName+"】已存在,是否确定覆盖?";
DialogResult result = MessageBox.Show(msg, "", MessageBoxButtons.OKCancel,MessageBoxIcon.Question);
if (!result.Equals(DialogResult.OK))
{
......
......@@ -119,7 +119,7 @@ namespace OnlineStore.DeviceLibrary
aioBox.SetInput(Asa.IOModule.Box_Type.DI, DILength);
aioBox.SetOutput(Asa.IOModule.Box_Type.DO, DOLength);
//DI主动上传
aioBox.AutoReadInput(true);
aioBox.AutoReadInput(true,DIMS);
aioBox.AutoReadOutput(true, DOMS);
aioBox.LogOut = true;
......
......@@ -34,19 +34,7 @@ namespace OnlineStore.LoadCSVLibrary
[CSVAttribute("属性值")]
public string ProValue { get; set; }
public ushort GetIOAddr()
{
ushort value = 0;
try
{
value = (ushort)Convert.ToInt32(ProValue);
}
catch (Exception ex)
{
LOGGER.Error("出错:", ex);
}
return value;
}
public virtual int GetValue()
{
if (ProValue.Equals(""))
......@@ -271,49 +259,18 @@ namespace OnlineStore.LoadCSVLibrary
{
}
}
public override int GetValue()
{
return GetIOValue();
}
public int GetIOValue()
public ushort GetIOAddr()
{
if (IoValue >= -1)
{
return IoValue;
}
ushort value = 0;
try
{
if (ProValue.Equals("") || ProValue.Equals("-1"))
{
IoValue = -1;
}
else if (ProType.Equals(ConfigItemType.DI))
{
IoValue = Convert.ToInt32(ProValue, 8);
}
else if (ProType.Equals(ConfigItemType.DO))
{
if (ProValue.Length == 2)
{
int a = Convert.ToInt32(ProValue.Substring(0, 1), 16) - 8;
string str =a+ProValue.Substring(1,1);
IoValue = Convert.ToInt32( str, 8);
//IoValue = a + b;
}
else
{
IoValue = Convert.ToInt32(ProValue, 16) - Convert.ToInt32("80", 16);
}
}
//LOGGER.Info("IO转换:(" + ElectricalDefinition + ")" + ProVale + "=" + IoValue);
value = (ushort)Convert.ToInt32(ProValue);
}
catch (Exception ex)
{
LOGGER.Error("出错了:", ex);
return -1;
LOGGER.Error("出错:", ex);
}
return IoValue;
return value;
}
public override string ToString()
......
......@@ -138,7 +138,7 @@ namespace OnlineStore.LoadCSVLibrary
if (IO_Type.GetTypeList().Contains(con.ProName))
{
ConfigIO io = (ConfigIO)con;
if (!DIODeviceNameList.Contains(io.DeviceName) && (io.GetIOValue() >= 0 || io.GetIOAddr() >= 0)&&io.DeviceName.Contains(IOIP_Str).Equals(false))
if (!DIODeviceNameList.Contains(io.DeviceName) && (io.GetIOAddr() >= 0 || io.GetIOAddr() >= 0)&&io.DeviceName.Contains(IOIP_Str).Equals(false))
{
DIODeviceNameList.Add(io.DeviceName);
}
......@@ -154,7 +154,7 @@ namespace OnlineStore.LoadCSVLibrary
if (IO_Type.GetTypeList().Contains(con.ProName))
{
ConfigIO io = (ConfigIO)con;
if (!DIODeviceNameList.Contains(io.DeviceName) && io.GetIOValue() >= 0 && io.DeviceName.Contains(IOIP_Str).Equals(false))
if (!DIODeviceNameList.Contains(io.DeviceName) && io.GetIOAddr() >= 0 && io.DeviceName.Contains(IOIP_Str).Equals(false))
{
DIODeviceNameList.Add(io.DeviceName);
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!