ClsWebService.cs
2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
namespace LineWebService
{
// 注意: 使用“重构”菜单上的“重命名”命令,可以同时更改代码和配置文件中的类名“Service1”。
//[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Reentrant)]
///[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]
public class ClsWebService : IWebService
{
//private readonly log4net.ILog LOG = log4net.LogManager.GetLogger("ClsWebService");
public ClsWebService()
{
}
public Result CreateEmptyRecycleTask(string line)
{
//LOG.Info("CreateEmptyRecycleTask emptyStation=" + line);
Result res;
if (!line.Equals(""))
{
res = new Result() { Succeed = "true", ResultData = "", ErrorMessage = "" };
//IWebService_Callback callback = OperationContext.Current.GetCallbackChannel<IWebService_Callback>();
//callback.GetEmptyRecycleTask(line);
}
else
{
res = new Result() { Succeed = "false", ResultData = "", ErrorMessage = "Not find " + line };
}
//if (AGVControl.Common.agvProductionLine.TryGetValue(line, out string value))
//{
// res = new Result() { Succeed = "true", ResultData = "", ErrorMessage = "" };
//LOG.Info("WebService Response OK");
// //加到任务
// //int idx = AGVControl.Common.nodeInfo.FindIndex(s => s.Name == value);
// //if (idx > -1)
// // AGVControl.Common.linePlace.Add(value);
// //else
// // AGVControl.Common.log.Error("CreateEmptyRecycleTask " + value + "不存在");
// if (!Common.AddLinePlace(value))
// Common.log.Error("CreateEmptyRecycleTask 节点【" + value + "】不存在");
// else
// {
// Common.LogInfo("任务:" + value + " 出空料架 【" + line + "】");
// }
// //System.IO.File.WriteAllLines(Common.CONFIG_PATH + "LinePlace.txt", Common.linePlace);
//}
//else
//{
// res = new Result() { Succeed = "false", ResultData = "", ErrorMessage = "Not find " + line };
//LOG.Info("WebService Response false");
//}
return res;
}
}
}