Commit 53cce1c4 张东亮

init

0 个父辈
正在显示 125 个修改的文件 包含 3721 行增加0 行删除
此文件类型无法预览

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30523.141
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgvClientTest", "AgvClientTest\AgvClientTest.csproj", "{E1C0827A-FA12-49A9-AC71-6D3E6518754A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client", "AgvClient\Client.csproj", "{7DAD8F15-0EC9-42DF-AE0B-94B45DE0F0AC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Agv", "Agv\Agv.csproj", "{A2EF9EFC-51C5-4BF6-965F-3A06BEADD632}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\Server.csproj", "{F539CEF2-CBD5-4ABF-AFD2-56C848DED0C0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E1C0827A-FA12-49A9-AC71-6D3E6518754A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E1C0827A-FA12-49A9-AC71-6D3E6518754A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1C0827A-FA12-49A9-AC71-6D3E6518754A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1C0827A-FA12-49A9-AC71-6D3E6518754A}.Release|Any CPU.Build.0 = Release|Any CPU
{7DAD8F15-0EC9-42DF-AE0B-94B45DE0F0AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7DAD8F15-0EC9-42DF-AE0B-94B45DE0F0AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7DAD8F15-0EC9-42DF-AE0B-94B45DE0F0AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7DAD8F15-0EC9-42DF-AE0B-94B45DE0F0AC}.Release|Any CPU.Build.0 = Release|Any CPU
{A2EF9EFC-51C5-4BF6-965F-3A06BEADD632}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A2EF9EFC-51C5-4BF6-965F-3A06BEADD632}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A2EF9EFC-51C5-4BF6-965F-3A06BEADD632}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A2EF9EFC-51C5-4BF6-965F-3A06BEADD632}.Release|Any CPU.Build.0 = Release|Any CPU
{F539CEF2-CBD5-4ABF-AFD2-56C848DED0C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F539CEF2-CBD5-4ABF-AFD2-56C848DED0C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F539CEF2-CBD5-4ABF-AFD2-56C848DED0C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F539CEF2-CBD5-4ABF-AFD2-56C848DED0C0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4DB6715D-4E7C-4269-B866-4D258875A186}
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A2EF9EFC-51C5-4BF6-965F-3A06BEADD632}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Agv</RootNamespace>
<AssemblyName>Agv</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>.\log4net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>.\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Common.cs" />
<Compile Include="JsonHelper.cs" />
<Compile Include="LogUtil.cs" />
<Compile Include="Node.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Agv
{
public class Common
{
/// <summary>
/// 编码
/// </summary>
/// <param name="node">单个节点</param>
/// <returns></returns>
public static byte[] Encode(Node node)
{
try
{
string json =JsonHelper.SerializeObject(node);
log.debug(string.Format("Encode[{0}]", json));
byte[] buff = System.Text.Encoding.UTF8.GetBytes(json);
return buff;
}
catch (Exception ex)
{
log.error("Encode Error", ex);
return null;
}
}
/// <summary>
/// 编码
/// </summary>
/// <param name="nodes">多个节点</param>
/// <returns></returns>
public static byte[] Encode(List<Node> nodes)
{
try
{
string json = JsonHelper.SerializeObject(nodes);
log.debug(string.Format("Encode[{0}]", json));
byte[] buff = System.Text.Encoding.UTF8.GetBytes(json);
return buff;
}
catch (Exception ex)
{
log.error("Encode Error", ex);
return null;
}
}
/// <summary>
/// 解码单个节点
/// </summary>
/// <param name="buff"></param>
/// <returns></returns>
public static Node Decode(byte[] buff)
{
try
{
string json = System.Text.Encoding.UTF8.GetString(buff);
log.debug(string.Format("Decode[{0}]", json));
Node node = JsonHelper.DeserializeJsonToObject<Node>(json);
return node;
}
catch (Exception ex)
{
log.error("Decode Error", ex);
return null;
}
}
/// <summary>
/// 解码多个节点
/// </summary>
/// <param name="buff"></param>
/// <returns></returns>
public static List<Node> DecodeNodes(byte[] buff)
{
try
{
string json = System.Text.Encoding.UTF8.GetString(buff);
log.debug(string.Format("DecodeNodes[{0}]", json));
List<Node> node = JsonHelper.DeserializeJsonToList<Node>(json);
return node;
}
catch (Exception ex)
{
log.error("Decode Error", ex);
return null;
}
}
}
/// <summary>
/// 客户端的动作
/// </summary>
public enum ClientAction : byte
{
/// <summary>
/// 没有动作
/// </summary>
None,
/// <summary>
/// 完成(服务器发送)
/// </summary>
CloseDoor,
/// <summary>
/// 可以进入料架
/// </summary>
MayEnter,
/// <summary>
/// 可以流出料架
/// </summary>
MayLeave,
/// <summary>
/// 需要进入料架
/// </summary>
NeedEnter,
/// <summary>
/// 需要流出料架
/// </summary>
NeedLeave,
/// <summary>
/// 完成进入料架
/// </summary>
FinishEnter,
/// <summary>
/// 完成流出料架
/// </summary>
FinishLeave,
/// <summary>
/// 到达包装料仓门口(服务器发送)
/// </summary>
Arrive,
/// <summary>
/// 小车准备好(服务器发送)
/// </summary>
Ready,
/// <summary>
/// 只能入料不能出料(仅包装料仓)
/// </summary>
EnterShelf,
/// <summary>
/// 不允许
/// </summary>
MayNot,
/// <summary>
/// 需要进入流出料架
/// </summary>
NeedEnterLeave,
/// <summary>
/// 可以停靠
/// </summary>
MayDock,
/// <summary>
/// 不可以进入料架
/// </summary>
MayNotEnter,
/// <summary>
/// 不可以流出料架
/// </summary>
MayNotLeave,
/// <summary>
/// 不可以停靠
/// </summary>
MayNotDock,
/// <summary>
/// 小车准备好送出料架(服务器发送)
/// </summary>
ReadyEnter,
/// <summary>
/// 小车准备好进入料架(服务器发送)
/// </summary>
ReadyLeave,
/// <summary>
/// 完成(服务器发送)
/// </summary>
Complete,
}
/// <summary>
/// 客户端的优先级
/// </summary>
public enum ClientLevel : byte
{
/// <summary>
/// 低
/// </summary>
Low,
/// <summary>
/// 中等
/// </summary>
Middle,
/// <summary>
/// 高
/// </summary>
High,
None,
}
/// <summary>
/// 客户端的料架
/// </summary>
public enum ClientShelf
{
/// <summary>
/// 没有架子
/// </summary>
None,
/// <summary>
/// 空架子
/// </summary>
Empty,
/// <summary>
/// 满料架子
/// </summary>
Full
}
/// <summary>
/// 类型
/// </summary>
public enum ClientType
{
/// <summary>
/// 无
/// </summary>
None,
/// <summary>
/// 紧急料
/// </summary>
Urgent,
/// <summary>
/// 包装料
/// </summary>
Pack,
/// <summary>
/// 分盘料
/// </summary>
Cut
}
}
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
namespace Agv
{
/// <summary>
/// Json帮助类
/// </summary>
public class JsonHelper
{
/// <summary>
/// 将对象序列化为JSON格式
/// </summary>
/// <param name="o">对象</param>
/// <returns>json字符串</returns>
public static string SerializeObject(object o)
{
string json = JsonConvert.SerializeObject(o);
return json;
}
/// <summary>
/// 解析JSON字符串生成对象实体
/// </summary>
/// <typeparam name="T">对象类型</typeparam>
/// <param name="json">json字符串(eg.{"ID":"112","Name":"石子儿"})</param>
/// <returns>对象实体</returns>
public static T DeserializeJsonToObject<T>(string json) where T : class
{
JsonSerializer serializer = new JsonSerializer();
StringReader sr = new StringReader(json);
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(T));
T t = o as T;
return t;
}
/// <summary>
/// 解析JSON数组生成对象实体集合
/// </summary>
/// <typeparam name="T">对象类型</typeparam>
/// <param name="json">json数组字符串(eg.[{"ID":"112","Name":"石子儿"}])</param>
/// <returns>对象实体集合</returns>
public static List<T> DeserializeJsonToList<T>(string json) where T : class
{
JsonSerializer serializer = new JsonSerializer();
StringReader sr = new StringReader(json);
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(List<T>));
List<T> list = o as List<T>;
return list;
}
/// <summary>
/// 反序列化JSON到给定的匿名对象.
/// </summary>
/// <typeparam name="T">匿名对象类型</typeparam>
/// <param name="json">json字符串</param>
/// <param name="anonymousTypeObject">匿名对象</param>
/// <returns>匿名对象</returns>
public static T DeserializeAnonymousType<T>(string json, T anonymousTypeObject)
{
T t = JsonConvert.DeserializeAnonymousType(json, anonymousTypeObject);
return t;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;
using System.Reflection;
using System.Drawing;
namespace Agv
{
public class log
{
//private static LogUtil instance = new LogUtil();
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static Dictionary<int, DateTime> lastErrorLogTime = new Dictionary<int, DateTime>();
public static void info(string msg)
{
LOGGER.Info(msg);
}
public static void debug(string msg)
{
LOGGER.Debug(msg);
}
public static void error(string errorMsg, Exception ex = null)
{
LOGGER.Error(errorMsg, ex);
}
}
}
此文件类型无法预览
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Agv
{
public class Node
{
/// <summary>
/// 节点名称
/// </summary>
public string Name { set; get; } = "";
/// <summary>
/// 料架号
/// </summary>
public string RFID { set; get; } = "";
/// <summary>
/// 标记
/// </summary>
public string Mark { set; get; } = "";
/// <summary>
/// 动作
/// </summary>
public ClientAction Action { set; get; } = ClientAction.None;
/// <summary>
/// 优先级
/// </summary>
public ClientLevel Level { set; get; } = ClientLevel.Low;
/// <summary>
/// 客户端类型
/// </summary>
public ClientType Type { set; get; } = ClientType.None;
/// <summary>
/// 料架类型
/// </summary>
public ClientShelf Shelf { set; get; } = ClientShelf.None;
public Node(string name,string rfid="",string mark="",ClientAction action = ClientAction.None,
ClientLevel level = ClientLevel.Low,ClientShelf shelfType = ClientShelf.None,ClientType clientType = ClientType.None)
{
Name = name;
RFID = rfid;
Mark = mark;
Action = action;
Level = level;
Type = clientType;
Shelf = shelfType;
}
public Node(string name, string rfid = "", ClientAction action = ClientAction.None)
{
Name = name;
RFID = rfid;
Action = action;
}
public Node(string name)
{
Name = name;
}
public Node() { }
/// <summary>
/// 所有属性的文本形式
/// </summary>
/// <returns></returns>
public string ToText()
{
System.Reflection.PropertyInfo[] info = this.GetType().GetProperties();
string[] arr = new string[info.Length];
for (int i = 0; i < info.Length; i++)
arr[i] = info[i].Name + "=" + info[i].GetValue(this).ToString();
return string.Join(",", arr);
}
public override bool Equals(object obj)
{
if (obj is Node)
{
Node node = (Node)obj;
if (Name.Equals(node.Name) && RFID.Equals(node.RFID) && Mark.Equals(node.Mark) &&
Action.Equals(node.Action) && Level.Equals(node.Level) && Type.Equals(node.Type) &&
Shelf.Equals(node.Shelf))
return true;
else
return false;
}
return false;
}
/// <summary>
/// 拷贝一个新的实例
/// </summary>
/// <returns></returns>
public Node ToCopy()
{
Node node = new Node();
System.Reflection.PropertyInfo[] info1 = node.GetType().GetProperties();
System.Reflection.PropertyInfo[] info2 = this.GetType().GetProperties();
for (int i = 0; i < info1.Length; i++)
info1[i].SetValue(node, info2[i].GetValue(this));
return node;
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Agv")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Agv")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("a2ef9efc-51c5-4bf6-965f-3a06beadd632")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
35c3965847f80e2b5445247f75e89b4af09c6e34
E:\Neotel\Projects\Gitee\AGV-Com\Agv\bin\Debug\Agv.dll
E:\Neotel\Projects\Gitee\AGV-Com\Agv\bin\Debug\Agv.pdb
E:\Neotel\Projects\Gitee\AGV-Com\Agv\bin\Debug\log4net.dll
E:\Neotel\Projects\Gitee\AGV-Com\Agv\bin\Debug\Newtonsoft.Json.dll
E:\Neotel\Projects\Gitee\AGV-Com\Agv\obj\Debug\Agv.csproj.CoreCompileInputs.cache
E:\Neotel\Projects\Gitee\AGV-Com\Agv\obj\Debug\Agv.csproj.CopyComplete
E:\Neotel\Projects\Gitee\AGV-Com\Agv\obj\Debug\Agv.dll
E:\Neotel\Projects\Gitee\AGV-Com\Agv\obj\Debug\Agv.pdb
此文件类型无法预览
此文件类型无法预览
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace Agv
{
/// <summary>
/// AGV客户端
/// </summary>
public class AgvClient
{
private bool _loopClient;
private int _countRecon;
private bool _loopRecon;
private Socket _clientSocket; //客户端
private List<Node> _node;
private List<Node> _nodeNoneState;
private Thread tSend; //发送
private Thread tListen; //监听网络
private Thread tRecon;
private string SERVER_IP; //远程IP地址
private int SERVER_PORT; //端口
private bool _IsEecodeSingleNode = false;//是否编码单个节点(默认编码多个节点)
/// <summary>
/// 小车接收事件委托
/// </summary>
public delegate void ReceiveEvent(Node node);
/// <summary>
/// 服务器连接事件
/// </summary>
/// <param name="status"></param>
public delegate void ConnectEvent(bool status);
/// <summary>
/// 小车接收事件
/// </summary>
public event ReceiveEvent Received;
/// <summary>
/// 服务器连接事件
/// </summary>
public event ConnectEvent Connected;
/// <summary>
/// 服务端信息
/// </summary>
public string ServerInfo
{
get
{
return string.Format("{0}:{1}", SERVER_IP, SERVER_PORT.ToString());
}
}
/// <summary>
/// AGV客户端
/// </summary>
/// <param name="_IsEecodeSingleNode">编码方式,默认编码多个节点</param>
public AgvClient(bool _IsEecodeSingleNode = false)
{
_node = new List<Node>();
_nodeNoneState = new List<Node>();
this._IsEecodeSingleNode = _IsEecodeSingleNode;
}
/// <summary>
/// 是否连接服务器
/// </summary>
public bool IsConn { private set; get; } = false;
/// <summary>
/// 发送命令的时间间隔,不能大于10s(单位:秒)
/// </summary>
public int SendSleep { set; get; } = 1;
/// <summary>
/// 禁用状态(true:发送None,false:正常发送)
/// </summary>
public bool CancelState { get; set; } = true;
/// <summary>
/// 连接
/// </summary>
public void Connect(string serverIP, int port = 12000)
{
SERVER_IP = serverIP;
SERVER_PORT = port;
_countRecon = 0;
_loopRecon = true;
IsConn = false;
_loopClient = true;
tListen = new Thread(new ThreadStart(ListenServerNet));
tSend = new Thread(new ThreadStart(KeepSendStatus));
tRecon = new Thread(new ThreadStart(Reconnect));
tRecon.Start();
//Open();
tListen.Start();
tSend.Start();
Agv.log.info("连接服务器");
}
/// <summary>
/// 关闭
/// </summary>
public void Close()
{
CancelState = true;
_loopClient = false;
_loopRecon = false;
if (_clientSocket != null)
{
_clientSocket.Close();
_clientSocket = null;
}
log.info("客户端关闭");
}
/// <summary>
/// 设置状态
/// </summary>
/// <param name="nodeName">节点名</param>
/// <param name="mark">虚拟rfid</param>
/// <param name="rfid">rfid</param>
/// <param name="action">动作</param>
/// <param name="level">等级</param>
/// <param name="shelf">料架类型</param>
/// <param name="type">客户端类型</param>
public void SetStatus(string nodeName, string mark = "", string rfid = "", ClientAction action = ClientAction.None, ClientLevel level = ClientLevel.Low, ClientShelf shelf = ClientShelf.None, ClientType type = ClientType.None)
{
int index = _node.FindIndex(s => s.Name == nodeName);
if (index == -1) //没有找到
{
Node node = new Node
{
Name = nodeName,
RFID = rfid,
Action = action,
Level = level,
Shelf = shelf,
Type = type,
Mark = mark
};
_node.Add(node);
_nodeNoneState.Add(new Node { Name=nodeName});
log.info("SetStatus " + node.ToText());
}
else
{
_node[index].RFID = rfid;
_node[index].Action = action;
_node[index].Level = level;
_node[index].Shelf = shelf;
_node[index].Type = type;
_node[index].Mark = mark;
log.info("SetStatus " + _node[index].ToText());
}
}
/// <summary>
/// 设置状态
/// </summary>
/// <param name="nodeName">节点名称</param>
/// <param name="action">动作</param>
public void SetStatus(string nodeName, ClientAction action)
{
int index = _node.FindIndex(s => s.Name == nodeName);
if (index == -1) //没有找到
{
log.info("SetStatus 没有找到" + nodeName);
}
else
{
_node[index].Action = action;
log.info("SetStatus " + _node[index].ToText());
}
}
/// <summary>
/// 重连线程
/// </summary>
private void Reconnect()
{
while (_loopRecon)
{
if (!IsConn)
{
Open();
if (IsConn)
{
_countRecon = 0;
log.info("连接服务器成功");
Connected?.Invoke(IsConn);
}
else
{
log.info("连接服务器失败" + ++_countRecon + "次");
}
}
Thread.Sleep(2000);
}
log.info("Quit Thread Reconnect");
}
/// <summary>
/// 打开,连接到服务器
/// </summary>
private void Open()
{
try
{
if (CheckIP(SERVER_IP))
{
_clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_clientSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, 2000);
_clientSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 2000);
_clientSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.NoDelay, 1);
_clientSocket.Connect(IPAddress.Parse(SERVER_IP), SERVER_PORT);
if (!_loopRecon) return;
IsConn = true;
Connected?.Invoke(IsConn);
}
}
catch (Exception ex)
{
IsConn = false;
log.error("Open Error", ex);
}
}
/// <summary>
/// 监听服务端发送的内容
/// </summary>
private void ListenServerNet()
{
int timeout = 100;
while (true)
{
while (_loopClient)
{
Thread.Sleep(timeout);
if (!IsConn) continue;
if (_clientSocket == null) continue;
if (!_loopClient) break;
try
{
// 定义一个缓存区;
byte[] arrMsgRec = new byte[1024];
// 将接收到的数据存入到输入 arrMsgRec中;
int length = -1;
if (_clientSocket.Poll(-1, SelectMode.SelectRead))
{
try
{
length = _clientSocket.Receive(arrMsgRec); // 接收数据,并返回数据的长度;
if (length == 0)//连接正常断开
{
IsConn = false;
Connected?.Invoke(IsConn);
log.info(string.Format("服务端[{1}]断开与客户端的连接", _clientSocket.RemoteEndPoint.ToString(), ServerInfo));
break;
}
}
catch (SocketException se)
{
IsConn = false;
Connected?.Invoke(IsConn);
log.error(string.Format("客户端[{0}]接收服务端[{1}]的消息出现异常", _clientSocket.RemoteEndPoint.ToString(), ServerInfo), se);
break;
}
catch (Exception e)
{
IsConn = false;
Connected?.Invoke(IsConn);
log.error(string.Format("客户端[{0}]接收服务端[{1}]的消息出现异常", _clientSocket.RemoteEndPoint.ToString(), ServerInfo), e);
break;
}
}
if (length > 0)
{
byte[] buff = new byte[length];
Array.Copy(arrMsgRec, 0, buff, 0, length);
Node node = Common.Decode(buff);
if (node == null)
{
log.error("命令解析失败");
}
else
{
log.info("触发Received事件," + node.ToText());
Received?.Invoke(node);
}
}
//if (_clientSocket.Available > 0)
//{
// int count = _clientSocket.Receive(temp);
// byte[] buff = new byte[count];
// Array.Copy(temp, 0, buff, 0, count);
// Node node = Common.Decode(buff);
// if (node == null)
// {
// LogUtil.error("命令解析失败");
// }
// else
// {
// LogUtil.info("触发Received事件," + node.ToText());
// Received?.Invoke(node);
// }
//}
}
catch (Exception ex)
{
IsConn = false;
log.error("ListenNet Error", ex);
Connected?.Invoke(IsConn);
}
}
}
log.info("Quit Thread ListenNet");
}
/// <summary>
/// 连续发送状态线程
/// </summary>
private void KeepSendStatus()
{
bool bln;
while (_loopClient)
{
Thread.Sleep(SendSleep * 1000);
if (!IsConn) continue;
if (_clientSocket == null) continue;
if (_IsEecodeSingleNode)
{
for (int i = 0; i < _node.Count; i++)
{
if (!_loopClient) break;
Thread.Sleep(500);
if (!CancelState)
{
byte[] buff = Common.Encode(_node[i]);
bln = Send(buff);
}
else
{
Node nostate = _node[i].ToCopy();
nostate.Action = ClientAction.None;
byte[] buff = Common.Encode(nostate);
bln = Send(buff);
}
if (!bln) continue;
}
}
else
{
if (_node.Count == 0) continue;
if (!CancelState)
{
byte[] buff = Common.Encode(_node);
if (!_loopClient) break;
bln = Send(buff);
}
else
{
byte[] buff = Common.Encode(_nodeNoneState);
if (!_loopClient) break;
bln = Send(buff);
}
}
}
log.info("Quit Thread SendStatus");
}
/// <summary>
/// 发送命令
/// </summary>
/// <param name="buff"></param>
/// <returns></returns>
private bool Send(byte[] buff)
{
if (!IsConn)
{
log.info("Send 服务器没有连接");
return false;
}
try
{
if (!_loopRecon) return false;
if (buff == null) return false;
_clientSocket.Send(buff);
log.debug(string.Format("Send to Server:{0}", string.Join(" ", buff)));
return true;
}
catch (Exception ex)
{
log.error("Send Error", ex);
IsConn = false;
Connected?.Invoke(IsConn);
return false;
}
}
/// <summary>
/// 检查IP地址
/// </summary>
/// <param name="ip"></param>
/// <returns></returns>
private bool CheckIP(string ip)
{
//IP合法
string pattern = @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$";
bool rtn = System.Text.RegularExpressions.Regex.IsMatch(ip, pattern);
if (!rtn)
{
log.info("非法的IP地址" + ip);
return false;
}
//Ping服务端
try
{
System.Net.NetworkInformation.Ping ping = new System.Net.NetworkInformation.Ping();
System.Net.NetworkInformation.PingReply result = ping.Send(ip, 2000);
ping.Dispose();
if (result.Status != System.Net.NetworkInformation.IPStatus.Success)
{
log.info("Ping " + ip + " 请求没有响应");
return false;
}
return true;
}
catch (Exception ex)
{
log.error("CheckIP Error", ex);
return false;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7DAD8F15-0EC9-42DF-AE0B-94B45DE0F0AC}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Agv</RootNamespace>
<AssemblyName>Agv.Client</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>8.0</LangVersion>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\..\..\..\DLL\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="OldClient.cs" />
<Compile Include="AgvClient.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Agv\Agv.csproj">
<Project>{a2ef9efc-51c5-4bf6-965f-3a06beadd632}</Project>
<Name>Agv</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace Asa
{
/// <summary>
/// AGV客户端-旧协议
/// </summary>
public class AgvClient
{
private bool loop;
private string _ip; //远程IP地址
private Socket client; //客户端
private Thread tSend; //发送
private Thread tListen; //监听网络
private Thread tReceive; //接收事件
private int countRecon;
private bool loopRecon;
private Thread tRecon;
private List<ClientNode> _node;
private System.Collections.Concurrent.ConcurrentQueue<ClientNode> _receive;
private const int PORT = 12000; //端口
/// <summary>
/// 小车动作事件
/// </summary>
public delegate void ActionEvent(string name, string rfid);
/// <summary>
/// 日志事件
/// </summary>
/// <param name="s"></param>
public delegate void LogEvent(string s);
/// <summary>
/// 小车到达,仅包装料仓
/// </summary>
public event ActionEvent Arrive;
/// <summary>
/// 小车已准备,对接完成
/// </summary>
public event ActionEvent Ready;
/// <summary>
/// 关门,仅包装料仓
/// </summary>
public event ActionEvent CloseDoor;
/// <summary>
/// 日志
/// </summary>
public event LogEvent Log;
/// <summary>
/// AGV客户端
/// </summary>
/// <param name="serverIP">服务器IP地址</param>
public AgvClient(string serverIP)
{
_ip = serverIP;
_node = new List<ClientNode>();
_receive = new System.Collections.Concurrent.ConcurrentQueue<ClientNode>();
}
/// <summary>
/// 是否连接服务器
/// </summary>
public bool IsConn { private set; get; } = false;
/// <summary>
/// 发送命令的日志是否打印,不影响其他日志
/// </summary>
public bool SendLog { set; get; } = false;
/// <summary>
/// 发送命令的时间间隔,不能大于10s(单位:秒)
/// </summary>
public int SendSleep { set; get; } = 3;
/// <summary>
/// 取消状态,true发送none,false发送实际状态
/// </summary>
public bool CancelState { set; get; } = false;
/// <summary>
/// 连接
/// </summary>
public void Connect()
{
countRecon = 0;
loopRecon = true;
IsConn = false;
tRecon = new Thread(new ThreadStart(Reconnect));
tRecon.Start();
}
/// <summary>
/// 关闭
/// </summary>
public void Close()
{
loop = false;
loopRecon = false;
if (client != null)
{
client.Close();
client = null;
}
Log?.Invoke("客户端关闭");
}
/// <summary>
/// 设置状态
/// </summary>
/// <param name="name">节点名称</param>
/// <param name="mark">节点标记</param>
/// <param name="rfid">架子RFID</param>
/// <param name="action"></param>
/// <param name="level"></param>
public void SetStatus(string name, string mark = "", string rfid = "", ClientAction action = ClientAction.None, ClientLevel level = ClientLevel.Low)
{
int idx = _node.FindIndex(s => s.Name.Equals(name));
if (idx == -1)
{
ClientNode node = new ClientNode(name, mark, rfid, action, level);
_node.Add(node);
Log?.Invoke("SetStatus " + node.ToText());
}
else
{
_node[idx].Mark = mark;
_node[idx].RFID = rfid;
_node[idx].Action = action;
_node[idx].Level = level;
Log?.Invoke("SetStatus " + _node[idx].ToText());
}
}
/// <summary>
/// 重连线程
/// </summary>
private void Reconnect()
{
while (loopRecon)
{
if (!IsConn)
{
Open();
if (IsConn)
{
countRecon = 0;
Log?.Invoke("连接服务器成功");
}
else
{
Log?.Invoke("连接服务器失败" + ++countRecon + "次");
}
}
Thread.Sleep(5000);
}
}
/// <summary>
/// 打开,连接到服务器
/// </summary>
private void Open()
{
try
{
if (CheckIP(_ip))
{
client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, 2000);
client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 2000);
client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.NoDelay, 1);
client.Connect(IPAddress.Parse(_ip), PORT);
if (!loopRecon) return;
IsConn = true;
loop = true;
tListen = new Thread(new ThreadStart(ListenNet));
tListen.Start();
tReceive = new Thread(new ThreadStart(Resolve));
tReceive.Start();
tSend = new Thread(new ThreadStart(SendStatus));
tSend.Start();
}
}
catch (Exception ex)
{
IsConn = false;
Log?.Invoke(ex.Message);
}
}
/// <summary>
/// 监听线程
/// </summary>
private void ListenNet()
{
byte[] temp = new byte[200];
int time = 100;
while (loop)
{
try
{
if (client.Available > 0)
{
int count = client.Receive(temp);
byte[] _buffer = new byte[count];
Array.Copy(temp, 0, _buffer, 0, count);
ClientNode node = Decode(_buffer);
if (node == null)
{
Log?.Invoke("命令解析失败: " + HexBuff(_buffer));
}
else
{
_receive.Enqueue(node);
Log?.Invoke("From Server: " + node.ToText());
}
}
}
catch (Exception ex)
{
IsConn = false;
Log?.Invoke(ex.Message);
}
Thread.Sleep(time);
}
}
/// <summary>
/// 分析数据包
/// </summary>
private void Resolve()
{
int time = 100;
while (loop)
{
Thread.Sleep(time);
try
{
if (!_receive.TryDequeue(out ClientNode result))
continue;
switch (result.Action)
{
case ClientAction.Arrive:
Log?.Invoke("触发Arrive事件");
Arrive?.Invoke(result.Name, result.RFID);
break;
case ClientAction.Ready:
Log?.Invoke("触发Ready事件");
Ready?.Invoke(result.Name, result.RFID);
break;
case ClientAction.CloseDoor:
Log?.Invoke("触发CloseDoor事件");
CloseDoor?.Invoke(result.Name, result.RFID);
break;
}
}
catch (Exception ex)
{
Log?.Invoke(ex.Message);
}
}
}
/// <summary>
/// 连续发送状态线程
/// </summary>
private void SendStatus()
{
while (loop)
{
//Socket没有建立连接
if (!IsConn)
{
Thread.Sleep(1000);
continue;
}
if (_node.Count == 0)
{
Thread.Sleep(5000);
continue;
}
for (int i = 0; i < _node.Count; i++)
{
if (!loop) break;
Thread.Sleep(100);
byte[] buff = Encode(_node[i]);
bool bln = Send(buff);
if (!bln)
{
IsConn = false;
loop = false;
break;
}
}
Thread.Sleep(SendSleep * 1000);
}
}
/// <summary>
/// 编码
/// </summary>
/// <param name="node"></param>
/// <returns></returns>
private byte[] Encode(ClientNode node)
{
byte[] name = System.Text.Encoding.UTF8.GetBytes(node.Name);
byte[] mark = System.Text.Encoding.UTF8.GetBytes(node.Mark);
byte[] rfid = System.Text.Encoding.UTF8.GetBytes(node.RFID);
int count = name.Length + mark.Length + rfid.Length + 7;
int idx = 0;
byte[] buff = new byte[count];
buff[idx++] = 0xAB;
buff[idx++] = Convert.ToByte(name.Length);
Array.Copy(name, 0, buff, idx, name.Length);
idx += name.Length;
buff[idx++] = Convert.ToByte(mark.Length);
Array.Copy(mark, 0, buff, idx, mark.Length);
idx += mark.Length;
buff[idx++] = Convert.ToByte(rfid.Length);
Array.Copy(rfid, 0, buff, idx, rfid.Length);
idx += rfid.Length;
if (CancelState)
buff[idx++] = (byte)ClientAction.None;
else
buff[idx++] = (byte)node.Action;
buff[idx++] = Convert.ToByte(node.Level);
buff[idx++] = 0xBA;
return buff;
}
/// <summary>
/// 发送命令
/// </summary>
/// <param name="buff"></param>
/// <returns></returns>
private bool Send(byte[] buff)
{
if (!IsConn)
{
Log?.Invoke("Send 服务器没有连接");
return false;
}
try
{
if (!loopRecon) return false;
if (SendLog) Log?.Invoke("Send: " + HexBuff(buff));
client.Send(buff);
return true;
}
catch (Exception ex)
{
Log?.Invoke(ex.Message);
IsConn = false;
return false;
}
}
/// <summary>
/// 解码
/// </summary>
/// <param name="buff"></param>
/// <returns></returns>
private ClientNode Decode(byte[] buff)
{
int idx = 0;
if (buff[idx++] != 0xAB) return null;
byte[] temp1 = new byte[buff[idx++]];
Array.Copy(buff, idx, temp1, 0, temp1.Length);
string name = System.Text.Encoding.UTF8.GetString(temp1);
idx += temp1.Length;
temp1 = new byte[buff[idx++]];
Array.Copy(buff, idx, temp1, 0, temp1.Length);
string mark = System.Text.Encoding.UTF8.GetString(temp1);
idx += temp1.Length;
temp1 = new byte[buff[idx++]];
Array.Copy(buff, idx, temp1, 0, temp1.Length);
string rfid = System.Text.Encoding.UTF8.GetString(temp1);
idx += temp1.Length;
ClientAction action = (ClientAction)buff[idx++];
ClientLevel level = (ClientLevel)buff[idx++];
ClientNode node = new ClientNode(name, mark, rfid, action, level);
if (buff[idx] != 0xBA)
return null;
return node;
}
/// <summary>
/// 16进制
/// </summary>
/// <param name="buff"></param>
/// <returns></returns>
private string HexBuff(byte[] buff)
{
string s = "";
if (buff == null) return s;
for (int i = 0; i < buff.Length; i++)
s += buff[i].ToString("X2") + " ";
return s;
}
/// <summary>
/// 检查IP地址
/// </summary>
/// <param name="ip"></param>
/// <returns></returns>
private bool CheckIP(string ip)
{
//IP合法
string pattern = @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$";
bool rtn = System.Text.RegularExpressions.Regex.IsMatch(ip, pattern);
if (!rtn)
{
Log?.Invoke("非法的IP地址" + ip);
return false;
}
//Ping服务端
try
{
System.Net.NetworkInformation.Ping ping = new System.Net.NetworkInformation.Ping();
System.Net.NetworkInformation.PingReply result = ping.Send(ip, 2000);
ping.Dispose();
if (result.Status != System.Net.NetworkInformation.IPStatus.Success)
{
Log?.Invoke("Ping " + ip + " 请求没有响应");
return false;
}
return true;
}
catch (Exception ex)
{
Log?.Invoke(ex.Message);
return false;
}
}
}
/// <summary>
/// 客户端的节点
/// </summary>
public class ClientNode
{
/// <summary>
/// 节点名称
/// </summary>
public string Name { set; get; }
/// <summary>
/// 标记,用于包装料仓
/// </summary>
public string Mark { set; get; }
/// <summary>
/// 当前架子的RFID
/// </summary>
public string RFID { set; get; }
/// <summary>
/// 动作
/// </summary>
public ClientAction Action { set; get; }
/// <summary>
/// 优先级
/// </summary>
public ClientLevel Level { set; get; }
/// <summary>
/// 客户端节点
/// </summary>
/// <param name="name"></param>
/// <param name="mark"></param>
/// <param name="rfid"></param>
/// <param name="action"></param>
/// <param name="level"></param>
public ClientNode(string name, string mark, string rfid, ClientAction action, ClientLevel level)
{
Name = name;
Mark = mark;
RFID = rfid;
Action = action;
Level = level;
}
/// <summary>
/// 所有属性的文本形式
/// </summary>
/// <returns></returns>
public string ToText()
{
string s = string.Format("Name={0}, Action={1}, Level={2}, Mark={3}, RFID={4}", Name, Action, Level, Mark, RFID);
return s;
}
/// <summary>
/// 服务端的命令
/// </summary>
/// <returns></returns>
public string ToServerText()
{
string s = string.Format("Name={0}, Action={1}, RFID={2}", Name, Action, RFID);
return s;
}
}
/// <summary>
/// 客户端的动作
/// </summary>
public enum ClientAction : byte
{
/// <summary>
/// 没有动作
/// </summary>
None = 0,
/// <summary>
/// 包装料仓关门
/// </summary>
CloseDoor = 1,
/// <summary>
/// 可以进入料架,Arrive事件使用,让小车开始对接
/// </summary>
MayEnter = 2,
/// <summary>
/// 可以出去料架,Arrive事件使用,让小车开始对接
/// </summary>
MayLeave = 3,
/// <summary>
/// 需要进入料架
/// </summary>
NeedEnter = 4,
/// <summary>
/// 需要出去料架
/// </summary>
NeedLeave = 5,
/// <summary>
/// 完成进入料架
/// </summary>
FinishEnter = 6,
/// <summary>
/// 完成出去料架
/// </summary>
FinishLeave = 7,
/// <summary>
/// 小车到达,到达包装料仓门口,等待开门
/// </summary>
Arrive = 8,
/// <summary>
/// 小车已准备,已对接上流水线
/// </summary>
Ready = 9,
/// <summary>
/// 包装料仓只能入料不能出料
/// </summary>
EnterShelf = 10,
/// <summary>
/// 不允许
/// </summary>
MayNot = 11
}
/// <summary>
/// 客户端的优先级
/// </summary>
public enum ClientLevel : byte
{
/// <summary>
/// 低
/// </summary>
Low = 0,
/// <summary>
/// 中等
/// </summary>
Middle = 1,
/// <summary>
/// 高
/// </summary>
High = 2
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Client")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Client")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("7dad8f15-0ec9-42df-ae0b-94b45de0f0ac")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.1.0.0")]
[assembly: AssemblyFileVersion("2.1.0.0")]
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
文件属性发生变化
此文件类型无法预览
文件属性发生变化
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.6.1", FrameworkDisplayName = ".NET Framework 4.6.1")]
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
此文件类型无法预览
此文件类型无法预览
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClient_DL\bin\Debug\AgvClient_DL.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClient_DL\bin\Debug\AgvClient_DL.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClient_DL\bin\Debug\log4net.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClient_DL\obj\Debug\AgvClient.csprojAssemblyReference.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClient_DL\obj\Debug\AgvClient.csproj.CoreCompileInputs.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClient_DL\obj\Debug\AgvClient.csproj.CopyComplete
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClient_DL\obj\Debug\AgvClient_DL.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClient_DL\obj\Debug\AgvClient_DL.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClient\bin\Debug\log4net.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient.csproj.CoreCompileInputs.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient.csproj.CopyComplete
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClient\bin\Debug\AsaPL.AgvClient.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClient\bin\Debug\AsaPL.AgvClient.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AsaPL.AgvClient.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AsaPL.AgvClient.pdb
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\bin\Debug\AsaPL.AgvClient.dll
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\bin\Debug\AsaPL.AgvClient.pdb
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient.csproj.CopyComplete
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AsaPL.AgvClient.dll
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AsaPL.AgvClient.pdb
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient.csprojAssemblyReference.cache
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient.csproj.CoreCompileInputs.cache
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\bin\Debug\AsaPL.AgvClient.dll
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\bin\Debug\AsaPL.AgvClient.pdb
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient.csprojAssemblyReference.cache
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient.csproj.CoreCompileInputs.cache
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient.csproj.CopyComplete
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AsaPL.AgvClient.dll
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AsaPL.AgvClient.pdb
E:\Neotel\Projects\Gitee\3D-AGV-SMD\AgvClient\bin\Debug\Asa.AgvClient.dll
E:\Neotel\Projects\Gitee\3D-AGV-SMD\AgvClient\bin\Debug\Asa.AgvClient.pdb
E:\Neotel\Projects\Gitee\3D-AGV-SMD\AgvClient\obj\Debug\AgvClient.csprojAssemblyReference.cache
E:\Neotel\Projects\Gitee\3D-AGV-SMD\AgvClient\obj\Debug\AgvClient.csproj.CoreCompileInputs.cache
E:\Neotel\Projects\Gitee\3D-AGV-SMD\AgvClient\obj\Debug\AgvClient.csproj.CopyComplete
E:\Neotel\Projects\Gitee\3D-AGV-SMD\AgvClient\obj\Debug\Asa.AgvClient.dll
E:\Neotel\Projects\Gitee\3D-AGV-SMD\AgvClient\obj\Debug\Asa.AgvClient.pdb
E:\Neotel\Projects\Gitee\AGV-Com\AgvClient\bin\Debug\Client.dll
E:\Neotel\Projects\Gitee\AGV-Com\AgvClient\bin\Debug\Client.pdb
E:\Neotel\Projects\Gitee\AGV-Com\AgvClient\obj\Debug\AgvClient.csprojAssemblyReference.cache
E:\Neotel\Projects\Gitee\AGV-Com\AgvClient\obj\Debug\AgvClient.csproj.CoreCompileInputs.cache
E:\Neotel\Projects\Gitee\AGV-Com\AgvClient\obj\Debug\AgvClient.csproj.CopyComplete
E:\Neotel\Projects\Gitee\AGV-Com\AgvClient\obj\Debug\Client.dll
E:\Neotel\Projects\Gitee\AGV-Com\AgvClient\obj\Debug\Client.pdb
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
b85b5ff4afa439da48046bd004c84f66501d0684
E:\Neotel\Projects\Gitee\AGV-Com\AgvClient\bin\Debug\Agv.Client.dll
E:\Neotel\Projects\Gitee\AGV-Com\AgvClient\bin\Debug\Agv.Client.pdb
E:\Neotel\Projects\Gitee\AGV-Com\AgvClient\bin\Debug\Agv.dll
E:\Neotel\Projects\Gitee\AGV-Com\AgvClient\bin\Debug\Newtonsoft.Json.dll
E:\Neotel\Projects\Gitee\AGV-Com\AgvClient\bin\Debug\Agv.pdb
E:\Neotel\Projects\Gitee\AGV-Com\AgvClient\obj\Debug\Client.csprojAssemblyReference.cache
E:\Neotel\Projects\Gitee\AGV-Com\AgvClient\obj\Debug\Client.csproj.CoreCompileInputs.cache
E:\Neotel\Projects\Gitee\AGV-Com\AgvClient\obj\Debug\Client.csproj.CopyComplete
E:\Neotel\Projects\Gitee\AGV-Com\AgvClient\obj\Debug\Agv.Client.dll
E:\Neotel\Projects\Gitee\AGV-Com\AgvClient\obj\Debug\Agv.Client.pdb
此文件类型无法预览
此文件类型无法预览
文件属性发生变化
文件属性发生变化
文件属性发生变化
此文件类型无法预览
此文件类型无法预览
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E1C0827A-FA12-49A9-AC71-6D3E6518754A}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>AgvClientTest</RootNamespace>
<AssemblyName>AgvClientTest</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\..\..\DLL\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AgvClient\Client.csproj">
<Project>{7dad8f15-0ec9-42df-ae0b-94b45de0f0ac}</Project>
<Name>Client</Name>
</ProjectReference>
<ProjectReference Include="..\Agv\Agv.csproj">
<Project>{a2ef9efc-51c5-4bf6-965f-3a06beadd632}</Project>
<Name>Agv</Name>
</ProjectReference>
<ProjectReference Include="..\Server\Server.csproj">
<Project>{f539cef2-cbd5-4abf-afd2-56c848ded0c0}</Project>
<Name>Server</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
<log4net>
<appender name="AgvClient" type="log4net.Appender.RollingFileAppender">
<file value="logs/AgvClient.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout>
</appender>
<root>
<level value="debug"/>
<appender-ref ref="AgvClient"/>
</root>
</log4net>
</configuration>
namespace AgvClientTest
{
partial class Form1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.comboBox2 = new System.Windows.Forms.ComboBox();
this.comboBox3 = new System.Windows.Forms.ComboBox();
this.comboBox4 = new System.Windows.Forms.ComboBox();
this.label8 = new System.Windows.Forms.Label();
this.textBox4 = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.textBox5 = new System.Windows.Forms.TextBox();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.label11 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.button6 = new System.Windows.Forms.Button();
this.label13 = new System.Windows.Forms.Label();
this.button7 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(586, 128);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(150, 38);
this.button1.TabIndex = 0;
this.button1.Text = "向服务端发送";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(124, 21);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 21);
this.textBox1.TabIndex = 1;
this.textBox1.Text = "A1";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(77, 30);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 12);
this.label1.TabIndex = 2;
this.label1.Text = "节点名";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(77, 59);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(29, 12);
this.label2.TabIndex = 3;
this.label2.Text = "RFID";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(124, 50);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(100, 21);
this.textBox2.TabIndex = 4;
this.textBox2.Text = "D1";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(77, 86);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(29, 12);
this.label3.TabIndex = 5;
this.label3.Text = "MARK";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(124, 77);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(100, 21);
this.textBox3.TabIndex = 6;
this.textBox3.Text = "2-1A,cut";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(77, 116);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(41, 12);
this.label4.TabIndex = 7;
this.label4.Text = "Action";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(77, 141);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(35, 12);
this.label5.TabIndex = 8;
this.label5.Text = "Level";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(77, 168);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(29, 12);
this.label6.TabIndex = 9;
this.label6.Text = "Type";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(77, 201);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(35, 12);
this.label7.TabIndex = 10;
this.label7.Text = "Shelf";
//
// comboBox1
//
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(124, 113);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(121, 20);
this.comboBox1.TabIndex = 11;
//
// comboBox2
//
this.comboBox2.FormattingEnabled = true;
this.comboBox2.Location = new System.Drawing.Point(125, 141);
this.comboBox2.Name = "comboBox2";
this.comboBox2.Size = new System.Drawing.Size(121, 20);
this.comboBox2.TabIndex = 12;
//
// comboBox3
//
this.comboBox3.FormattingEnabled = true;
this.comboBox3.Location = new System.Drawing.Point(124, 168);
this.comboBox3.Name = "comboBox3";
this.comboBox3.Size = new System.Drawing.Size(121, 20);
this.comboBox3.TabIndex = 13;
//
// comboBox4
//
this.comboBox4.FormattingEnabled = true;
this.comboBox4.Location = new System.Drawing.Point(124, 198);
this.comboBox4.Name = "comboBox4";
this.comboBox4.Size = new System.Drawing.Size(121, 20);
this.comboBox4.TabIndex = 14;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(77, 240);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(41, 12);
this.label8.TabIndex = 15;
this.label8.Text = "label8";
//
// textBox4
//
this.textBox4.Location = new System.Drawing.Point(365, 12);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(100, 21);
this.textBox4.TabIndex = 16;
this.textBox4.Text = "127.0.0.1";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(318, 21);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(17, 12);
this.label9.TabIndex = 17;
this.label9.Text = "IP";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(312, 42);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(29, 12);
this.label10.TabIndex = 18;
this.label10.Text = "Port";
//
// textBox5
//
this.textBox5.Location = new System.Drawing.Point(365, 39);
this.textBox5.Name = "textBox5";
this.textBox5.Size = new System.Drawing.Size(100, 21);
this.textBox5.TabIndex = 19;
this.textBox5.Text = "12000";
//
// button2
//
this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button2.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button2.Location = new System.Drawing.Point(314, 77);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(138, 38);
this.button2.TabIndex = 20;
this.button2.Text = "服务端开启";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button3.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button3.Location = new System.Drawing.Point(314, 180);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(138, 38);
this.button3.TabIndex = 21;
this.button3.Text = "服务端关闭";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button4
//
this.button4.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button4.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button4.Location = new System.Drawing.Point(586, 26);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(150, 38);
this.button4.TabIndex = 22;
this.button4.Text = "客户端开启";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// button5
//
this.button5.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button5.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button5.Location = new System.Drawing.Point(586, 180);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(150, 38);
this.button5.TabIndex = 23;
this.button5.Text = "客户端关闭";
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(482, 93);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(65, 12);
this.label11.TabIndex = 24;
this.label11.Text = "服务端状态";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(77, 269);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(47, 12);
this.label12.TabIndex = 25;
this.label12.Text = "label12";
//
// button6
//
this.button6.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button6.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button6.Location = new System.Drawing.Point(314, 128);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(138, 38);
this.button6.TabIndex = 26;
this.button6.Text = "向客户端发送";
this.button6.UseVisualStyleBackColor = true;
this.button6.Click += new System.EventHandler(this.button6_Click);
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(472, 198);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(89, 12);
this.label13.TabIndex = 27;
this.label13.Text = "客户端连接状态";
//
// button7
//
this.button7.BackColor = System.Drawing.Color.Red;
this.button7.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button7.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button7.Location = new System.Drawing.Point(586, 77);
this.button7.Name = "button7";
this.button7.Size = new System.Drawing.Size(150, 38);
this.button7.TabIndex = 28;
this.button7.Text = "客户端屏蔽信号";
this.button7.UseVisualStyleBackColor = false;
this.button7.Click += new System.EventHandler(this.button7_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(772, 310);
this.Controls.Add(this.button7);
this.Controls.Add(this.label13);
this.Controls.Add(this.button6);
this.Controls.Add(this.label12);
this.Controls.Add(this.label11);
this.Controls.Add(this.button5);
this.Controls.Add(this.button4);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.textBox5);
this.Controls.Add(this.label10);
this.Controls.Add(this.label9);
this.Controls.Add(this.textBox4);
this.Controls.Add(this.label8);
this.Controls.Add(this.comboBox4);
this.Controls.Add(this.comboBox3);
this.Controls.Add(this.comboBox2);
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.label7);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.label3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.button1);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Form1";
this.ShowIcon = false;
this.Text = "agv对接模拟客户端";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.ComboBox comboBox2;
private System.Windows.Forms.ComboBox comboBox3;
private System.Windows.Forms.ComboBox comboBox4;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox textBox5;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Button button7;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AgvClientTest
{
public partial class Form1 : Form
{
private Agv.Server server;
private Agv.AgvClient client;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
server = new Agv.Server();
server.NodeChanged += Server_NodeChanged;
server.NodeOnline += Server_NodeOnline;
comboBox1.Items.AddRange(Enum.GetNames(typeof(Agv.ClientAction)));
comboBox2.Items.AddRange(Enum.GetNames(typeof(Agv.ClientLevel)));
comboBox3.Items.AddRange(Enum.GetNames(typeof(Agv.ClientType)));
comboBox4.Items.AddRange(Enum.GetNames(typeof(Agv.ClientShelf)));
comboBox1.SelectedIndex = 0;
comboBox2.SelectedIndex = 0;
comboBox3.SelectedIndex = 0;
comboBox4.SelectedIndex = 0;
client = new Agv.AgvClient();
client.Received += Client_Received;
client.Connected += Client_Connected;
}
private void Server_NodeChanged(Agv.Node clientNode)
{
this.Invoke(new Action(() =>
{
label8.Text = "从客户端接收:" + clientNode.ToText();
}
));
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
try
{
if (server != null)
{
server.NodeChanged -= Server_NodeChanged;
server.NodeOnline -= Server_NodeOnline;
server.Stop();
server = null;
}
if (client != null)
{
client.Received -= Client_Received;
client.Connected -= Client_Connected;
client.Close();
client = null;
}
}
catch { }
}
private void button1_Click(object sender, EventArgs e)
{
int i1 = comboBox1.SelectedIndex;
int i2 = comboBox2.SelectedIndex;
int i3 = comboBox4.SelectedIndex;
int i4 = comboBox3.SelectedIndex;
Task task = new Task(new Action(() =>
{
//client.SetStatus(textBox1.Text,textBox3.Text,textBox2.Text, (Agv.ClientAction)i1,
// (Agv.ClientLevel)i2,(Agv.ClientShelf)i3,
// (Agv.ClientType)i4);
client.SetStatus(textBox1.Text, textBox3.Text, textBox2.Text, (Agv.ClientAction)i1, (Agv.ClientLevel)i2, (Agv.ClientShelf)i3);
}));
task.Start();
}
private void button2_Click(object sender, EventArgs e)
{
server.Start(textBox4.Text, int.Parse(textBox5.Text));
this.Invoke(new Action(() =>
{
label11.BackColor = Color.Green;
}
));
}
private void Server_NodeOnline(string nodeName, bool online)
{
this.Invoke(new Action(() =>
{
label11.Text = nodeName;
if (online)
label11.BackColor = Color.Green;
else
label11.BackColor = Color.Red;
}
));
}
private void button3_Click(object sender, EventArgs e)
{
server.Stop();
this.Invoke(new Action(() =>
{
label11.BackColor = Color.Red;
}
));
}
private void button4_Click(object sender, EventArgs e)
{
client.Connect(textBox4.Text, int.Parse(textBox5.Text));
}
private void Client_Connected(bool status)
{
this.Invoke(new Action(() =>
{
if (!status)
label13.BackColor = Color.Red;
else
label13.BackColor = Color.Green;
}
));
}
private void Client_Received(Agv.Node node)
{
this.Invoke(new Action(() =>
{
label12.Text = "从服务端端接收:" + node.ToText();
}
));
}
private void button5_Click(object sender, EventArgs e)
{
client.Close();
}
private void button6_Click(object sender, EventArgs e)
{
int i1 = comboBox1.SelectedIndex;
server.SendToClient(textBox1.Text, textBox2.Text, (Agv.ClientAction)i1);
}
private void button7_Click(object sender, EventArgs e)
{
if (client.CancelState)
{
client.CancelState = false;
button7.BackColor = Color.Green;
}
else
{
client.CancelState = true;
button7.BackColor = Color.Red;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
using log4net.Config;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AgvClientTest
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
XmlConfigurator.Configure();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("AgvClientTest")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AgvClientTest")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("e1c0827a-fa12-49a9-ac71-6d3e6518754a")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace AgvClientTest.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AgvClientTest.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace AgvClientTest.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.7.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
文件属性发生变化
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
<log4net>
<appender name="AgvClient" type="log4net.Appender.RollingFileAppender">
<file value="logs/AgvClient.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout>
</appender>
<root>
<level value="debug"/>
<appender-ref ref="AgvClient"/>
</root>
</log4net>
</configuration>
此文件类型无法预览
此文件的差异太大,无法显示。
文件属性发生变化
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.6.1", FrameworkDisplayName = ".NET Framework 4.6.1")]
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AgvClientTest.exe.config
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AgvClientTest.exe
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AgvClientTest.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\log4net.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csprojAssemblyReference.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.Form1.resources
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.Properties.Resources.resources
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csproj.GenerateResource.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csproj.CoreCompileInputs.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csproj.CopyComplete
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.exe
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AsaPL.AgvClient.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AsaPL.AgvClient.pdb
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AgvClientTest.exe.config
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AgvClientTest.exe
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AgvClientTest.pdb
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AsaPL.AgvClient.dll
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AsaPL.AgvClient.pdb
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.Form1.resources
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.Properties.Resources.resources
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csproj.GenerateResource.cache
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csproj.CopyComplete
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.exe
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.pdb
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csproj.CoreCompileInputs.cache
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csprojAssemblyReference.cache
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AgvClientTest.exe.config
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AgvClientTest.exe
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AgvClientTest.pdb
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AsaPL.AgvClient.dll
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AsaPL.AgvClient.pdb
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csprojAssemblyReference.cache
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.Form1.resources
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.Properties.Resources.resources
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csproj.GenerateResource.cache
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csproj.CoreCompileInputs.cache
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csproj.CopyComplete
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.exe
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.pdb
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\bin\Debug\AgvClientTest.exe.config
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\bin\Debug\AgvClientTest.exe
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\bin\Debug\AgvClientTest.pdb
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\bin\Debug\Agv.Client.dll
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\bin\Debug\Agv.dll
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\bin\Debug\Agv.Server.dll
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\bin\Debug\Newtonsoft.Json.dll
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\bin\Debug\Agv.Client.pdb
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\bin\Debug\Agv.pdb
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\bin\Debug\Agv.Server.pdb
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\obj\Debug\AgvClientTest.csprojAssemblyReference.cache
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\obj\Debug\AgvClientTest.Form1.resources
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\obj\Debug\AgvClientTest.Properties.Resources.resources
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\obj\Debug\AgvClientTest.csproj.GenerateResource.cache
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\obj\Debug\AgvClientTest.csproj.CoreCompileInputs.cache
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\obj\Debug\AgvClientTest.csproj.CopyComplete
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\obj\Debug\AgvClientTest.exe
E:\Neotel\Projects\Gitee\AGV-Com\AgvClientTest\obj\Debug\AgvClientTest.pdb
文件属性发生变化
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Agv
{
public class Server
{
private bool loop;
private Socket _server; //服务端
Dictionary<string, Client> dictClient = new Dictionary<string, Client>(); //所有客户端
private Thread tListenClient; //监听客户端连接
private Dictionary<string, bool> nodeOnline = new Dictionary<string, bool>();
public delegate void NodeChangedEvent(Node clientNode);
public delegate void NodeOnlineEvent(string nodeName, bool online);
public event NodeChangedEvent NodeChanged;
public event NodeOnlineEvent NodeOnline;
private string serverIp;
private int serverPort;
private bool _IsdecodeSingleNode = false;
private Dictionary<string, Node> nodeMap = new Dictionary<string, Node>();
/// <summary>
///
/// </summary>
/// <param name="_IsdecodeSingleNode">解码方式,默认解码多个节点</param>
public Server(bool _IsdecodeSingleNode=false)
{
this._IsdecodeSingleNode = _IsdecodeSingleNode;
}
/// <summary>
/// 服务端信息
/// </summary>
public string ServerInfo
{
get
{
return string.Format("{0}:{1}", serverIp, serverPort.ToString());
}
}
/// <summary>
/// 开启服务
/// </summary>
public void Start(string ip = "127.0.0.1", int port = 12000)
{
try
{
log.info("AGVServer服务启动");
serverIp = ip;
serverPort = port;
IPEndPoint localEP = new IPEndPoint(IPAddress.Parse(serverIp), serverPort);
_server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_server.Bind(localEP);
_server.Listen(100);
loop = true;
//_client = new List<Client>();
tListenClient = new Thread(new ThreadStart(ListenClient));
tListenClient.Start();
}
catch (Exception ex)
{
log.error("AGVServer服务启动", ex);
}
}
/// <summary>
/// 停止服务
/// </summary>
public void Stop()
{
try
{
loop = false;
foreach (string c in dictClient.Keys)
{
try
{
dictClient[c].ListenNet.Abort();
}
catch (Exception ex)
{
log.error(string.Format("关闭连接客户端[{0}]线程失败", c), ex);
}
try
{
dictClient[c].Socket.Close();
}
catch (Exception ex)
{
log.error(string.Format("关闭连接客户端[{0}]Socket失败", c), ex);
}
}
if (dictClient.Count > 0) dictClient.Clear();
if (nodeMap.Count > 0)
nodeMap.Clear();
log.info("AGVServer服务关闭");
}
catch (Exception ex)
{
log.error("AGVServer服务关闭", ex);
}
}
/// <summary>
/// 向服务端发送命令
/// </summary>
/// <param name="info"></param>
/// <returns></returns>
public bool SendToClient(string nodeName, string RFID, ClientAction action)
{
string tar = "";
int n = 0;
do
{
tar = FindClient(nodeName);
if (tar.Equals(""))
{
log.error("没有找到" + nodeName);
Thread.Sleep(500);
n++;
}
else
{
n = 10;
}
} while (n < 4);
if (tar.Equals("")) return false;
Node node = new Node(nodeName, RFID, action);
log.info("SendTo " + nodeName + " RFID=" + RFID + " " + action);
byte[] buff = Common.Encode(node);
return Send(tar, buff);
}
/// <summary>
/// 小车到达
/// </summary>
/// <param name="info"></param>
/// <returns></returns>
public bool Arrive(string nodeName, string RFID = "")
{
string tar = "";
int n = 0;
do
{
tar = FindClient(nodeName);
if (tar.Equals(""))
{
log.error("Arrive: 没有找到" + nodeName);
Thread.Sleep(500);
n++;
}
else
{
n = 10;
}
} while (n < 4);
if (tar.Equals("")) return false;
Node node = new Node(nodeName, RFID, ClientAction.Arrive);
log.info("SendTo " + nodeName + " RFID=" + RFID + " " + ClientAction.Arrive);
byte[] buff = Common.Encode(node);
return Send(tar, buff);
}
/// <summary>
/// 小车已准备好
/// </summary>
/// <param name="info"></param>
/// <returns></returns>
public bool Ready(string nodeName, string RFID = "")
{
string tar = "";
int n = 0;
do
{
tar = FindClient(nodeName);
if (tar.Equals(""))
{
log.error("Ready: 没有找到" + nodeName);
Thread.Sleep(500);
n++;
}
else
{
n = 10;
}
} while (n < 4);
if (tar.Equals("")) return false;
Node node = new Node(nodeName, RFID, ClientAction.Ready);
log.info("SendTo " + nodeName + " RFID=" + RFID + " " + ClientAction.Ready);
byte[] buff = Common.Encode(node);
return Send(tar, buff);
}
/// <summary>
/// 关门
/// </summary>
/// <param name="info"></param>
/// <returns></returns>
public bool CloseDoor(string nodeName, string RFID = "")
{
string tar = "";
int n = 0;
do
{
tar = FindClient(nodeName);
if (tar.Equals(""))
{
log.debug("CloseDoor: 没有找到" + nodeName);
Thread.Sleep(500);
n++;
}
else
{
n = 10;
}
} while (n < 4);
if (tar.Equals("")) return false;
Node node = new Node(nodeName, RFID, ClientAction.CloseDoor);
log.info("SendTo " + nodeName + " RFID=" + RFID + " " + ClientAction.CloseDoor);
byte[] buff = Common.Encode(node);
return Send(tar, buff);
}
/// <summary>
/// 监听客户端连接
/// </summary>
private void ListenClient()
{
while (loop)
{
try
{
// 开始监听客户端连接请求,Accept方法会阻断当前的线程;
Socket sokConnection = _server.Accept(); // 一旦监听到一个客户端的请求,就返回一个与该客户端通信的 套接字;
log.info(string.Format("客户端[{0}]连接服务端[{1}]成功", sokConnection.RemoteEndPoint.ToString(), ServerInfo));
Thread thr = new Thread(ListenNet);
Client client = new Client(sokConnection, thr, sokConnection.RemoteEndPoint.ToString());
thr.IsBackground = true;
thr.Start(client);
dictClient.Add(sokConnection.RemoteEndPoint.ToString(), client);
}
catch (SocketException)
{
//关闭连接,退出阻塞Accept
}
catch (Exception ex)
{
log.error("ListenClient", ex);
}
}
}
/// <summary>
/// 客户端数据接收
/// </summary>
/// <param name="obj">索引</param>
private void ListenNet(object obj)
{
Client client = obj as Client;
Socket sokClient = client.Socket;
while (client.Loop)
{
// Thread.Sleep(sleep);
try
{
// 定义一个缓存区;
byte[] arrMsgRec = new byte[1024];
// 将接收到的数据存入到输入 arrMsgRec中;
int length = -1;
if (sokClient.Poll(-1, SelectMode.SelectRead))
{
try
{
length = sokClient.Receive(arrMsgRec); // 接收数据,并返回数据的长度;
if (length == 0)//连接正常断开
{
Offline(client);
log.debug(string.Format("客户端[{0}]断开与服务端[{1}]的连接", sokClient.RemoteEndPoint.ToString(), ServerInfo));
return;
}
}
catch (SocketException se)
{
Offline(client);
log.error(string.Format("客户端[{0}]接收服务端[{1}]的消息出现异常", sokClient.RemoteEndPoint.ToString(), ServerInfo), se);
return;
}
catch (Exception e)
{
Offline(client);
log.error(string.Format("客户端[{0}]接收服务端[{1}]的消息出现异常", sokClient.RemoteEndPoint.ToString(), ServerInfo), e);
return;
}
}
if (length > 0)
{
byte[] buff = new byte[length];
Array.Copy(arrMsgRec, 0, buff, 0, length);
//解码单个节点
if(_IsdecodeSingleNode)
{
Node node = Common.Decode(buff);
if (node == null)
{
log.error("命令解析失败: " + HexBuff(buff));
}
else
{
//CommonVar.LogUtil.info("Receive[" + client.IP + "] " + node.ToText());
int idx = client.nodeName.FindIndex(s => s == node.Name);
if (idx == -1) client.nodeName.Add(node.Name);
UpdateNode(node);
}
}
else
{
//解码多个节点
List<Node> nodes = Common.DecodeNodes(buff);
if (nodes == null)
{
log.error("命令解析失败: " + HexBuff(buff));
}
else
{
int idx = -1;
foreach (var node in nodes)
{
idx = client.nodeName.FindIndex(s => s == node.Name);
if (idx == -1) client.nodeName.Add(node.Name);
}
UpdateNodes(nodes);
}
}
}
}
catch (Exception ex)
{
log.error("ListenNet", ex);
}
}
}
private string FindClient(string nodeName)
{
foreach (string item in dictClient.Keys)
{
if (dictClient[item].nodeName.Contains(nodeName))
return item;
}
return "";
}
private void UpdateNode(Node node)
{
if(!nodeOnline.Keys.Contains(node.Name))
{
nodeOnline.Add(node.Name,true);
NodeOnline?.Invoke(node.Name, true);
}
else if(nodeOnline[node.Name].Equals(false))
{
nodeOnline[node.Name] = true;
NodeOnline?.Invoke(node.Name, true);
}
if (!nodeMap.Keys.Contains(node.Name))
{
nodeMap.Add(node.Name, node);
NodeChanged?.Invoke(node);
log.info(string.Format("节点添加并状态更新[{0}]", node.ToText()));
}
else if (!nodeMap[node.Name].Equals(node))
{
nodeMap[node.Name]= node;
NodeChanged?.Invoke(node);
log.info(string.Format("节点状态更新[{0}]", node.ToText()));
}
}
private void UpdateNodes(List<Node> nodes)
{
foreach (var node in nodes)
{
UpdateNode(node);
}
}
private void Offline(Client client)
{
client.Loop = false;
client.Socket.Close();
for (int i = 0; i < client.nodeName.Count; i++)
{
if (!nodeOnline.Keys.Contains(client.nodeName[i]))
{
nodeOnline.Add(client.nodeName[i], false);
NodeOnline?.Invoke(client.nodeName[i], false);
}
else if (nodeOnline[client.nodeName[i]].Equals(true))
{
nodeOnline[client.nodeName[i]] = false;
NodeOnline?.Invoke(client.nodeName[i], false);
}
}
client.nodeName.Clear();
client.ListenNet.Abort();
client.Socket = null;
dictClient.Remove(client.IP);
}
private void Offline(string clientKey)
{
if (!dictClient.Keys.Contains(clientKey))
return;
Client client = dictClient[clientKey];
client.Loop = false;
client.Socket.Close();
for (int i = 0; i < client.nodeName.Count; i++)
{
if (!nodeOnline.Keys.Contains(client.nodeName[i]))
{
nodeOnline.Add(client.nodeName[i], false);
NodeOnline?.Invoke(client.nodeName[i], false);
}
else if (nodeOnline[client.nodeName[i]].Equals(true))
{
nodeOnline[client.nodeName[i]] = false;
NodeOnline?.Invoke(client.nodeName[i], false);
}
}
client.nodeName.Clear();
client.ListenNet.Abort();
client.Socket = null;
dictClient.Remove(client.IP);
}
private string HexBuff(byte[] buff)
{
string s = "";
if (buff == null) return s;
for (int i = 0; i < buff.Length; i++)
s += buff[i].ToString("X2") + " ";
return s;
}
/// <summary>
/// 发送命令
/// </summary>
/// <param name="idx"></param>
/// <param name="buff"></param>
/// <returns></returns>
private bool Send(string clientKey, byte[] buff)
{
for (int i = 1; i <= 3; i++)
{
try
{
dictClient[clientKey].Socket.Send(buff);
log.debug(string.Format("服务端[{0}]向客户端[{1}]发送消息:[{2}]", ServerInfo, clientKey, HexBuff(buff)));
return true;
}
catch (Exception ex)
{
log.error("发送失败" + i + "次:" + ex.Message);
}
Thread.Sleep(100);
}
Offline(clientKey);
return false;
}
private class Client
{
public bool Loop;
public string IP;
public List<string> nodeName;
public Socket Socket;
public Thread ListenNet;
public Client(Socket socket,Thread thread,string IP)
{
Socket = socket;
ListenNet = thread;
Loop = true;
this.IP = IP;
nodeName = new List<string>();
}
}
}
/// <summary>
/// 客户端的节点
/// </summary>
public class ClientNode : Node
{
/// <summary>
/// 在线状态
/// </summary>
public bool Online { get; set; }
/// <summary>
/// 是否可调用
/// </summary>
public bool IsUse { set; get; }
/// <summary>
/// 线体名
/// </summary>
public string LineName { set; get; }
public string AliceName { get; set; }
/// <summary>
/// 客户端的节点
/// </summary>
public ClientNode() : base()
{
}
public ClientNode(string nodeName, string rfid, ClientAction clientAction) : base(nodeName)
{
RFID = rfid;
Action = clientAction;
}
/// <summary>
/// 客户端节点
/// </summary>
/// <param name="name"></param>
/// <param name="ip"></param>
/// <param name="isUse"></param>
public ClientNode(string name, string aliceName, string lineName, bool isUse) : base(name)
{
LineName = lineName;
AliceName = aliceName;
Online = false;
IsUse = isUse;
}
/// <summary>
/// 客户端节点
/// </summary>
/// <param name="name"></param>
/// <param name="rfid"></param>
/// <param name="action"></param>
/// <param name="level"></param>
public ClientNode(string name, string rfid = "", string mark = "", ClientAction action = ClientAction.None, Agv.ClientLevel level = Agv.ClientLevel.Low) : base(name)
{
RFID = rfid;
Mark = mark;
Level = level;
Action = action;
}
/// <summary>
/// 脱机
/// </summary>
public void Offline()
{
RFID = "";
Action = ClientAction.None;
Online = false;
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Server")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Server")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("f539cef2-cbd5-4abf-afd2-56c848ded0c0")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F539CEF2-CBD5-4ABF-AFD2-56C848DED0C0}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Agv</RootNamespace>
<AssemblyName>Agv.Server</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AgvServer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Agv\Agv.csproj">
<Project>{a2ef9efc-51c5-4bf6-965f-3a06beadd632}</Project>
<Name>Agv</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
此文件类型无法预览
此文件类型无法预览
16d66be583a4f2090ed9cb687f7d8de924c18050
E:\Neotel\Projects\Gitee\AGV-Com\Server\bin\Debug\Agv.Server.dll
E:\Neotel\Projects\Gitee\AGV-Com\Server\bin\Debug\Agv.Server.pdb
E:\Neotel\Projects\Gitee\AGV-Com\Server\bin\Debug\Agv.dll
E:\Neotel\Projects\Gitee\AGV-Com\Server\bin\Debug\Newtonsoft.Json.dll
E:\Neotel\Projects\Gitee\AGV-Com\Server\bin\Debug\log4net.dll
E:\Neotel\Projects\Gitee\AGV-Com\Server\bin\Debug\Agv.pdb
E:\Neotel\Projects\Gitee\AGV-Com\Server\obj\Debug\Server.csprojAssemblyReference.cache
E:\Neotel\Projects\Gitee\AGV-Com\Server\obj\Debug\Server.csproj.CoreCompileInputs.cache
E:\Neotel\Projects\Gitee\AGV-Com\Server\obj\Debug\Server.csproj.CopyComplete
E:\Neotel\Projects\Gitee\AGV-Com\Server\obj\Debug\Agv.Server.dll
E:\Neotel\Projects\Gitee\AGV-Com\Server\obj\Debug\Agv.Server.pdb
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!