Commit a6da74b6 张东亮

1楼和楼上都使用时,优先楼上

1 个父辈 bf803b1b
......@@ -8,6 +8,6 @@
<add key="Line_Config" value="LineConfig.csv"/>
<add key="ServiceBaseUrl" value="http://127.0.0.1:8887"/>
<add key="Lift_Ids" value="LIFT_D2,LIFT_C1"/>
<add key="Lift_Buffs" value="[{&quot;liftId&quot;:&quot;D2&quot;,&quot;Status&quot;:{&quot;floor&quot;:0,&quot;door&quot;:&quot;&quot;,&quot;sourceClient&quot;:&quot;&quot;,&quot;sourceFloor&quot;:0,&quot;sourcePoint&quot;:&quot;&quot;,&quot;destinationClient&quot;:&quot;&quot;,&quot;destinationFloor&quot;:0,&quot;destinationPoint&quot;:&quot;&quot;},&quot;State&quot;:0,&quot;RunState&quot;:0,&quot;Clients&quot;:[]},{&quot;liftId&quot;:&quot;C1&quot;,&quot;Status&quot;:{&quot;floor&quot;:0,&quot;door&quot;:&quot;&quot;,&quot;sourceClient&quot;:&quot;HY1F&quot;,&quot;sourceFloor&quot;:1,&quot;sourcePoint&quot;:&quot;4DLine5&quot;,&quot;destinationClient&quot;:&quot;ZJ4D&quot;,&quot;destinationFloor&quot;:4,&quot;destinationPoint&quot;:&quot;1CLine3&quot;},&quot;State&quot;:0,&quot;RunState&quot;:0,&quot;Clients&quot;:[{&quot;sourceClient&quot;:&quot;ZJ4D&quot;,&quot;hasIdleAgv&quot;:true,&quot;Online&quot;:true}]}]"/>
<add key="Lift_Buffs" value=""/>
</appSettings>
</configuration>
......@@ -272,7 +272,7 @@
//
// timer1
//
this.timer1.Interval = 1000;
this.timer1.Interval = 500;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// FrmIO
......@@ -284,6 +284,7 @@
this.Name = "FrmIO";
this.Text = "FrmIO";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmIO_FormClosing);
this.Load += new System.EventHandler(this.FrmIO_Load);
this.Shown += new System.EventHandler(this.FrmIOStatus_Shown);
this.tableLayoutPanel1.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
......
......@@ -71,12 +71,19 @@ namespace LiftController
cmbWriteIO.SelectedIndex = index;
}
}
bool inRead = false;
private void timer1_Tick(object sender, EventArgs e)
{
if (this.Visible)
// if (this.Visible)
if (inRead)
return;
try
{
inRead = true;
ReadIOList();
}
catch { }
finally { inRead = false; }
}
private void ReadIOList()
{
......@@ -88,7 +95,6 @@ namespace LiftController
{
control.IOValue = iov;
control.ShowData();
LogUtil.info($"IO状态DI更新:{key}={iov}");
}
}
foreach (string key in this.DOControlList.Keys)
......@@ -99,7 +105,6 @@ namespace LiftController
{
control.IOValue = iov;
control.ShowData();
LogUtil.info($"IO状态DO更新:{key}={iov}");
}
}
}
......@@ -191,7 +196,6 @@ namespace LiftController
}
private void FrmIOStatus_Shown(object sender, EventArgs e)
{
timer1.Start();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
......@@ -200,5 +204,10 @@ namespace LiftController
groupBox4.Enabled=chked;
LogUtil.info($"IO调试状态:{chked}");
}
private void FrmIO_Load(object sender, EventArgs e)
{
timer1.Start();
}
}
}
......@@ -32,9 +32,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Asa.IOModule.AIOBOX, Version=2.3.0.4, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>.\Asa.IOModule.AIOBOX.dll</HintPath>
<Reference Include="Asa.IOModule.AIOBOX">
<HintPath>..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>.\log4net.dll</HintPath>
......
......@@ -85,12 +85,9 @@ namespace DeviceLibrary
//aioBox.LogPath(Application.StartupPath + @"\logs\aio\", LogType.OnlyError);
aioBox.IP = ioIp;
aioBox.SetInput(Asa.IOModule.Box_Type.DI, DILength);
aioBox.SetOutput(Asa.IOModule.Box_Type.DO, DOLength);
aioBox.SetType(Box_Type.DI, DILength, Box_Type.DO, DOLength);
//DI主动上传
aioBox.AutoReadInput(true,DIMS);
aioBox.AutoReadOutput(false, DOMS);
aioBox.Upload = true;
aioBox.DI_Changed_Event += AioBox_DI_Changed_Event; ;
......@@ -180,6 +177,7 @@ namespace DeviceLibrary
DIValueMap.Remove(ip);
}
DIValueMap.Add(ip, newList);
LogUtil.info($"DI状态变化【{ip}】:{string.Join("-", newList.ToArray())}");
}
}
}
......@@ -219,6 +217,7 @@ namespace DeviceLibrary
DOValueMap.Remove(ip);
}
DOValueMap.Add(ip, newList);
LogUtil.info($"DO状态变化【{ip}】:{string.Join("-", newList.ToArray())}");
}
}
}
......
......@@ -21,12 +21,11 @@ namespace DeviceLibrary
{
if (LineManager.Config.DOList.ContainsKey(ioType))
{
int trytimes = 5;
ConfigIO configIo = LineManager.Config.DOList[ioType];
instance.WriteSingleDO(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr(), ioValue);
Thread.Sleep(60);
if(!IOValue(ioType).Equals(ioValue))
instance.WriteSingleDO(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr(), ioValue);
Thread.Sleep(100);
}
else
{
......
此文件类型无法预览
......@@ -29,7 +29,7 @@ namespace DeviceLibrary.Models.Service.Request
public bool continueUse {get;set;}=false;
public override string ToString()
{
return $"{sourceClient}[{sourceFloor}]:{liftId}";
return $"{sourceClient}[{sourceFloor}][continue={continueUse}]:{liftId}";
}
}
}
......@@ -56,7 +56,17 @@ namespace DeviceLibrary.Service
}
return result;
}
string preLogInfo = "";
string curLogInfo = "";
void LogInfo(string txt)
{
curLogInfo = txt;
if(!curLogInfo.Equals(preLogInfo))
{
Log.Info(curLogInfo);
preLogInfo = curLogInfo;
}
}
public Result sendIn(Stream stream)
{
Result result = new Result();
......@@ -72,7 +82,7 @@ namespace DeviceLibrary.Service
else
{
bool idle= Context.LiftContext.RequestSendIn(sendInInfo,out string msg);
Log.Info($"请求接口被调用:{sendInInfo},[{msg}]");
LogInfo($"请求接口被调用:{sendInInfo},[{msg}]");
result.msg = msg;
}
return result;
......
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!