signalr test
This commit is contained in:
1 parent
a87e5e5ff9
commit
d250bca681
16 files changed
+8779
-62
No files matched your search
@@ -5,6 +5,9 @@ using IoTClient.Clients.PLC;
|
||||
using IoTClient.Common.Enums;
|
||||
using IoTClient.Enums;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Query.Expressions.Internal;
|
||||
using NPOI.XSSF.Streaming.Values;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Mvc;
|
||||
|
||||
@@ -26,24 +29,30 @@ namespace HHWMS.Web.Controllers
|
||||
[ActionDescription("Sys.Search")]
|
||||
public ActionResult Index()
|
||||
{
|
||||
SiemensClient client = new SiemensClient(SiemensVersion.S7_1500, "127.0.0.1", 102);
|
||||
client.Write("V2209", 33);
|
||||
|
||||
Dictionary<string, DataTypeEnum> addresses = new Dictionary<string, DataTypeEnum>();
|
||||
addresses.Add("DB4.24", DataTypeEnum.Float);
|
||||
addresses.Add("DB1.434.0", DataTypeEnum.Bool);
|
||||
addresses.Add("V4109", DataTypeEnum.Byte);
|
||||
var result = client.BatchRead(addresses);
|
||||
var tt = result.Value.First(x => x.Key.Equals("DB1.434.0")).Value;
|
||||
|
||||
var inv = _unitWork
|
||||
.Find<Inventory>(x => x.TaskStatus != InventoryTaskStatus.任务中)
|
||||
.ToList()
|
||||
.GroupBy(x => x.ContainerCode);
|
||||
var vm = Wtm.CreateVM<ContainerListVM>();
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
#endregion Search
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Test()
|
||||
{
|
||||
SiemensClient client = new SiemensClient(SiemensVersion.S7_1500, "127.0.0.1", 102);
|
||||
|
||||
// 声明设备列表
|
||||
Dictionary<string, DataTypeEnum> addresses = new Dictionary<string, DataTypeEnum>();
|
||||
addresses.Add("V2207", DataTypeEnum.Float);
|
||||
addresses.Add("V2307", DataTypeEnum.Float);
|
||||
addresses.Add("V2407", DataTypeEnum.Float);
|
||||
var result = client.BatchRead(addresses);
|
||||
if(result.IsSucceed)
|
||||
{
|
||||
var re = result.Value.ToList();
|
||||
return JsonMore(re);
|
||||
}
|
||||
return JsonMore(null);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user