Commit c94edc52 顾剑亮

软件重构

1 个父辈 4a17d764
......@@ -13,6 +13,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgvServer", "AgvServer\AgvS
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgvClientProduction", "AgvClientProduction\AgvClientProduction.csproj", "{ADB09B8F-1560-4038-B6CE-A0F876DC1AA0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BLL", "BLL\BLL.csproj", "{27E4CF12-F299-4439-9D58-C32F97DE6179}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Model", "Model\Model.csproj", "{CB525EC1-745D-44D4-AE49-B0D16744600B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UI", "UI\UI.csproj", "{B2384612-3693-4BFD-AD71-078FB1704566}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Clinet", "Clinet\Clinet.csproj", "{284B40AD-DD3E-4BC5-9FDC-016490AF17AE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientTest", "ClientTest\ClientTest.csproj", "{ABCA001E-D223-4FFD-B9E9-3E47E0F5DB7A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -39,6 +49,26 @@ Global
{ADB09B8F-1560-4038-B6CE-A0F876DC1AA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ADB09B8F-1560-4038-B6CE-A0F876DC1AA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADB09B8F-1560-4038-B6CE-A0F876DC1AA0}.Release|Any CPU.Build.0 = Release|Any CPU
{27E4CF12-F299-4439-9D58-C32F97DE6179}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{27E4CF12-F299-4439-9D58-C32F97DE6179}.Debug|Any CPU.Build.0 = Debug|Any CPU
{27E4CF12-F299-4439-9D58-C32F97DE6179}.Release|Any CPU.ActiveCfg = Release|Any CPU
{27E4CF12-F299-4439-9D58-C32F97DE6179}.Release|Any CPU.Build.0 = Release|Any CPU
{CB525EC1-745D-44D4-AE49-B0D16744600B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB525EC1-745D-44D4-AE49-B0D16744600B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB525EC1-745D-44D4-AE49-B0D16744600B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB525EC1-745D-44D4-AE49-B0D16744600B}.Release|Any CPU.Build.0 = Release|Any CPU
{B2384612-3693-4BFD-AD71-078FB1704566}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2384612-3693-4BFD-AD71-078FB1704566}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2384612-3693-4BFD-AD71-078FB1704566}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2384612-3693-4BFD-AD71-078FB1704566}.Release|Any CPU.Build.0 = Release|Any CPU
{284B40AD-DD3E-4BC5-9FDC-016490AF17AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{284B40AD-DD3E-4BC5-9FDC-016490AF17AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{284B40AD-DD3E-4BC5-9FDC-016490AF17AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{284B40AD-DD3E-4BC5-9FDC-016490AF17AE}.Release|Any CPU.Build.0 = Release|Any CPU
{ABCA001E-D223-4FFD-B9E9-3E47E0F5DB7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ABCA001E-D223-4FFD-B9E9-3E47E0F5DB7A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ABCA001E-D223-4FFD-B9E9-3E47E0F5DB7A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ABCA001E-D223-4FFD-B9E9-3E47E0F5DB7A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = 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>{27E4CF12-F299-4439-9D58-C32F97DE6179}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BLL</RootNamespace>
<AssemblyName>BLL</AssemblyName>
<TargetFrameworkVersion>v4.6</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>
<PropertyGroup>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<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="Job\ChargeJob.cs" />
<Compile Include="Control.cs" />
<Compile Include="Job\MissionJob.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Job\RecycleJob.cs" />
<Compile Include="Job\SendFullJob.cs" />
<Compile Include="Server.cs" />
<Compile Include="Job\StandbyJob.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Model\Model.csproj">
<Project>{cb525ec1-745d-44d4-ae49-b0d16744600b}</Project>
<Name>Model</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using System;
using System.Diagnostics;
using System.Threading;
using Model;
namespace BLL
{
public class Control
{
private Timer timerCall;
public delegate void AgvChangedEvent(int agvIndex);
public event AgvChangedEvent AgvChanged;
public event AgvChangedEvent AgvOnline;
public Control()
{
ThreadPool.SetMaxThreads(5, 5); //线程池最大数量
}
public void Start()
{
timerCall = new Timer(CallProcess, null, 0, 2000);
}
public void Stop()
{
if (timerCall != null)
timerCall.Dispose();
}
private void CallProcess(object obj)
{
for (int i = 0; i < Common.agvInfos.Count; i++)
{
AgvInfo info = Common.agvInfos[i];
if (info.IsCall) continue;
try
{
info.IsCall = true;
CheckAgvOnline(ref info);
if (!info.IsOnline) continue; //脱机
GetAgvState(ref info);
if (!info.IsAuto) continue; //手动
if (info.StateID == (int)StateID.Pause)
MiR_API.State_Ready(info.IP, info.Authorization);
if (info.CurrentJob == null)
info.CurrentJob = new StandbyJob();
else
info.CurrentJob = info.CurrentJob.Execute(info);
}
catch (Exception ex)
{
LogOut.Error("CallProcess " + info.Name, ex);
}
finally
{
info.IsCall = false;
}
}
}
private void GetAgvState(ref AgvInfo info)
{
if (!info.IsOnline) return;
bool rtn = MiR_API.Get_State(info.IP, info.Authorization, out int stateID, out string stateText, out int battery, out string missionText, out System.Drawing.PointF position);
//Common.log.Debug(string.Format("{1} GetAgvState[return={0}] stateID={2}, stateText={3}, battery={4}, missionText={5}, position={6}", rtn, info.FullName, stateID, stateText, battery, missionText, position));
if (rtn)
{
info.StateID = stateID;
info.StateText = stateText;
info.Battery = battery;
info.MissionText = missionText;
info.Position = position;
string ip = info.IP;
int idx = Common.agvInfos.FindIndex(s => s.IP == ip);
if (idx > -1) AgvChanged?.Invoke(idx);
}
}
private void CheckAgvOnline(ref AgvInfo info)
{
bool rtn = MiR_API.CheckIP(info.IP);
if (rtn)
{
if (!info.IsOnline)
{
info.IsOnline = true;
string ip = info.IP;
int idx = Common.agvInfos.FindIndex(s => s.IP == ip);
if (idx > -1) AgvOnline?.Invoke(idx);
//rtn = Common.mir.Get_IO_Modules(info.IP, info.Authorization, out string[] guid);
//if (rtn) info.IOGuid = guid[0];
}
}
else
{
if (info.IsOnline)
{
info.IsOnline = false;
string ip = info.IP;
int idx = Common.agvInfos.FindIndex(s => s.IP == ip);
if (idx > -1) AgvOnline?.Invoke(idx);
}
LogOut.Debug(string.Format("{0}[{1}] 脱机", info.Name, info.IP));
}
}
private enum StateID : int
{
None,
Starting,
ShuttingDown,
Ready,
Pause,
Executing,
Aborted,
Completed,
Docked,
Docking,
EmergencyStop,
ManualControl,
Error
}
}
}
\ No newline at end of file
using System;
using Model;
namespace BLL
{
public class ChargeJob : IJob
{
private AgvInfo _info;
private MissionJob move;
private string mission;
private JobStep<ChargeStep> chargeStep;
private int currBattery;
public ChargeJob()
{
chargeStep = new JobStep<ChargeStep>(ChargeStep.None);
LogOut.Debug("加载ChargeJob");
}
public bool IsEnd { get; private set; }
public IJob Execute(AgvInfo info)
{
_info = info;
if (chargeStep.Equals(ChargeStep.None))
{
currBattery = _info.Battery;
if (_info.IsWorkshop4D)
SendCharge();
else
PassDoor4D();
}
else if (chargeStep.Equals(ChargeStep.PassDoor))
{
move.Execute(_info);
if (move.IsEnd)
SendCharge();
}
else if (chargeStep.Equals(ChargeStep.MoveStation))
{
move.Execute(_info);
MoveStation();
}
else if (chargeStep.Equals(ChargeStep.Charging))
{
if (_info.Battery == _info.BatteryMax)
{
chargeStep.Msg = _info.Name + "电量达到" + _info.BatteryMax;
chargeStep.NextStep(ChargeStep.End);
}
else if (_info.Battery > _info.BatteryMin)
{
//IJob job = SteelManage.GetSteelJob(_info);
//if (job != null)
//{
// Common.mir.Del_Mission(_info.IP, _info.Authorization);
// return job;
//}
}
}
else if (chargeStep.Equals(ChargeStep.End))
{
MiR_API.Del_Mission(_info.IP, _info.Authorization);
chargeStep.Msg = _info.Name + "充电工作结束,回待机位";
return new StandbyJob();
}
return this;
}
/// <summary>
/// 发送充电任务
/// </summary>
private void SendCharge()
{
mission = Common.MISSION_CHARGE + _info.Name;
_info.Place = mission;
move = new MissionJob(mission);
move.Execute(_info);
chargeStep.NextStep(ChargeStep.MoveStation);
chargeStep.Msg = _info.Name + "发送任务" + mission;
}
/// <summary>
/// 过车间门去4D
/// </summary>
private void PassDoor4D()
{
mission = Common.MISSION_PASS_DOOR_4D;
_info.Place = mission;
move = new MissionJob(mission);
move.Execute(_info);
chargeStep.NextStep(ChargeStep.PassDoor);
chargeStep.Msg = _info.Name + "发送任务" + mission;
}
/// <summary>
/// 移动到充电桩
/// </summary>
private void MoveStation()
{
if (_info.Battery > currBattery)
{
chargeStep.Msg = _info.Name + "到达充电位,准备充电";
chargeStep.NextStep(ChargeStep.Charging);
}
}
private enum ChargeStep
{
None,
End,
PassDoor,
MoveStation,
Charging
}
}
}
/*
* 这是一个子job,只运行一个小车任务,需要其他job来调用
*
*/
using System;
using Model;
namespace BLL
{
public class MissionJob : IJob
{
private string _id;
private string _mission;
private bool _fleetSend;
private AgvInfo _info;
private int _times; //发送次数
private DateTime _getTime; //用于调用API的间隔时间
private JobStep<MissionStep> missionStep;
public MissionJob(string mission)
{
_times = 0;
IsEnd = false;
_mission = mission;
_fleetSend = Common.fleetSend;
missionStep = new JobStep<MissionStep>(MissionStep.Send);
}
public bool IsEnd { get; private set; }
public IJob Execute(AgvInfo info)
{
_info = info;
if (missionStep.Equals(MissionStep.Send))
Send();
else if (missionStep.Equals(MissionStep.Working))
Working();
else if (missionStep.Equals(MissionStep.Error))
Error();
else if (missionStep.Equals(MissionStep.End))
IsEnd = true;
return this;
}
private void Send()
{
bool rtn;
string log;
if (_fleetSend)
rtn = MiR_API.Add_Mission_Fleet(_info.FleetID, _info.Authorization, _mission, out _id);
else
rtn = MiR_API.Add_Mission(_info.IP, _info.Authorization, _mission, out _id);
if (rtn)
{
_times = 0;
log = string.Format("MissionJob To:{0},[{1}]发送成功", _info.Name, _mission);
LogOut.Debug(log);
_getTime = DateTime.Now;
missionStep.NextStep(MissionStep.Working);
}
else
{
_times++;
log = string.Format("MissionJob To:{0},[{1}]发送失败{2}次", _info.Name, _mission, _times);
LogOut.Warn(log);
}
}
private void Working()
{
TimeSpan span = DateTime.Now - _getTime;
if (span.TotalMilliseconds >= 5000) //间隔5s取一次任务状态
{
bool rtn;
string state;
string log;
if (_fleetSend)
rtn = MiR_API.Get_MissionState_Fleet(_info.Authorization, _id, out state);
else
rtn = MiR_API.Get_MissionState(_info.IP, _info.Authorization, _id, out state);
if (rtn)
{
log = string.Format("MissionJob To:{0},[{1}]任务状态{2}", _info.Name, _mission, state);
LogOut.Debug(log);
if (state == MissionState.Done.ToString())
missionStep.NextStep(MissionStep.End);
else if (state == MissionState.Aborted.ToString())
missionStep.NextStep(MissionStep.Error);
else if (state == MissionState.Executing.ToString())
_getTime = DateTime.Now;
else if (state == MissionState.Pending.ToString())
_getTime = DateTime.Now;
}
else
{
log = string.Format("MissionJob To:{0},[{1}]获取状态失败", _info.Name, _mission);
LogOut.Warn(log);
}
}
}
private void Error()
{
LogOut.Debug(string.Format("MissionJob To:{0},[{1}]重新发送", _info.Name, _mission));
MiR_API.Clear_Error(_info.IP, _info.Authorization);
MiR_API.Del_Mission(_info.IP, _info.Authorization);
missionStep.NextStep(MissionStep.Send);
}
private enum MissionStep
{
Send,
Working,
Error,
End
}
private enum MissionState
{
/// <summary>
/// 异常
/// </summary>
Aborted,
/// <summary>
/// 正在执行
/// </summary>
Executing,
/// <summary>
/// 未发送(fleet收到任务,还未分配给小车)
/// </summary>
Pending,
/// <summary>
/// 完成
/// </summary>
Done
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
class RecycleJob
{
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
class SendFullJob
{
}
}
using System;
using Model;
namespace BLL
{
public class StandbyJob : IJob
{
private AgvInfo _info;
private MissionJob move;
private string mission;
private JobStep<StandbyStep> standbyStep;
private DateTime _getTime;
public StandbyJob()
{
standbyStep = new JobStep<StandbyStep>(StandbyStep.None);
LogOut.Debug("加载StandbyJob");
}
public bool IsEnd { get; private set; }
public IJob Execute(AgvInfo info)
{
_info = info;
if (standbyStep.Equals(StandbyStep.None))
{
if (_info.IsWorkshop4D)
SendStandby();
else
PassDoor4D();
}
else if (standbyStep.Equals(StandbyStep.PassDoor))
{
move.Execute(_info);
if (move.IsEnd)
SendStandby();
}
else if (standbyStep.Equals(StandbyStep.MoveStandby))
{
move.Execute(_info);
if (move.IsEnd)
{
standbyStep.NextStep(StandbyStep.End);
standbyStep.Msg = _info.Name + "到达待机位";
_getTime = DateTime.Now;
}
}
else if (standbyStep.Equals(StandbyStep.End))
{
if (_info.Battery <= _info.BatteryMin)
{
standbyStep.Msg = _info.Name + "电量小于" + _info.BatteryMin + ",执行充电任务";
return new ChargeJob();
}
else
{
TimeSpan span = DateTime.Now - _getTime;
if (span.TotalMinutes >= 2)
{
standbyStep.Msg = _info.Name + "在待机位停留超过2分钟,执行充电任务";
return new ChargeJob();
}
else
{
//IJob job = SteelManage.GetSteelJob(info);
//if (job != null) return job;
}
}
}
return this;
}
/// <summary>
/// 发送待机位任务
/// </summary>
private void SendStandby()
{
mission = Common.MISSION_STANDBY + _info.Name;
_info.Place = mission;
move = new MissionJob(mission);
move.Execute(_info);
standbyStep.NextStep(StandbyStep.MoveStandby);
standbyStep.Msg = _info.Name + "发送任务" + mission;
}
/// <summary>
/// 过车间门去4D
/// </summary>
private void PassDoor4D()
{
mission = Common.MISSION_PASS_DOOR_4D;
_info.Place = mission;
move = new MissionJob(mission);
move.Execute(_info);
standbyStep.NextStep(StandbyStep.PassDoor);
standbyStep.Msg = _info.Name + "发送任务" + mission;
}
private enum StandbyStep
{
None,
End,
PassDoor,
MoveStandby
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("BLL")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BLL")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("27e4cf12-f299-4439-9d58-c32f97de6179")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
此文件的差异被折叠, 点击展开。
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup>
</configuration>
\ No newline at end of file
<?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>{ABCA001E-D223-4FFD-B9E9-3E47E0F5DB7A}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>ClientTest</RootNamespace>
<AssemblyName>ClientTest</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</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="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="FrmMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmMain.Designer.cs">
<DependentUpon>FrmMain.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FrmMain.resx">
<DependentUpon>FrmMain.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>
</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="..\Clinet\Clinet.csproj">
<Project>{284b40ad-dd3e-4bc5-9fdc-016490af17ae}</Project>
<Name>Clinet</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
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;
using Clinet;
namespace ClientTest
{
public partial class FrmMain : Form
{
private AgvClient client;
public FrmMain()
{
InitializeComponent();
}
private void FrmMain_Load(object sender, EventArgs e)
{
client = new AgvClient("127.0.0.1");
client.Log += Client_Log;
client.Connect();
}
private void Client_Log(string s)
{
TxtLog.AppendText(s + "\r\n");
}
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
{
client.Close();
}
private void BtnAdd_Click(object sender, EventArgs e)
{
string idx = (sender as Button).Name.Substring(6, 1);
string name = Controls["TxtName" + idx].Text;
string mark = Controls["TxtMark" + idx].Text;
string rfid = Controls["TxtRfid" + idx].Text;
ClientAction action = (ClientAction)((ComboBox)Controls["CboAction" + idx]).SelectedIndex;
ClientLevel level = (ClientLevel)((ComboBox)Controls["CboLevel" + idx]).SelectedIndex;
client.SetStatus(name, mark, rfid, action, level);
}
}
}
<?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 System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ClientTest
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FrmMain());
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("ClientTest")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ClientTest")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("abca001e-d223-4ffd-b9e9-3e47e0f5db7a")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [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 ClientTest.Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.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 ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ClientTest.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 覆盖当前线程的 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>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ClientTest.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.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"?>
<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>{284B40AD-DD3E-4BC5-9FDC-016490AF17AE}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Clinet</RootNamespace>
<AssemblyName>Clinet</AssemblyName>
<TargetFrameworkVersion>v4.6</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.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="AgvClient.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Clinet")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Clinet")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("284b40ad-dd3e-4bc5-9fdc-016490af17ae")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class AgvInfo
{
/// <summary>
/// 小车名称
/// </summary>
public string Name { set; get; } = "";
/// <summary>
/// 在Fleet中的ID
/// </summary>
public string FleetID { set; get; } = "";
/// <summary>
/// 小车IP地址
/// </summary>
public string IP { set; get; } = "";
/// <summary>
/// 授权码
/// </summary>
public string Authorization { set; get; } = "";
/// <summary>
/// 是否自动使用
/// </summary>
public bool IsAuto { set; get; } = false;
/// <summary>
/// 是否在线
/// </summary>
public bool IsOnline { set; get; } = false;
/// <summary>
/// 电量百分比
/// </summary>
public int Battery { set; get; } = 0;
/// <summary>
/// AGV最大充电电量
/// </summary>
public int BatteryMax { set; get; } = 0;
/// <summary>
/// AGV最低电量,小于此值必须充电
/// </summary>
public int BatteryMin { set; get; } = 0;
/// <summary>
/// 状态ID号
/// </summary>
public int StateID { set; get; } = -1;
/// <summary>
/// 状态文本
/// </summary>
public string StateText { set; get; } = "";
/// <summary>
/// 任务文本
/// </summary>
public string MissionText { set; get; } = "";
/// <summary>
/// 小车坐标位置
/// </summary>
public System.Drawing.PointF Position { set; get; }
/// <summary>
/// 是否正在被调用
/// </summary>
public bool IsCall { set; get; } = false;
/// <summary>
/// 当前的工作
/// </summary>
public IJob CurrentJob { set; get; } = null;
/// <summary>
/// 当前位置
/// </summary>
public string Place { set; get; } = "";
public AgvInfo()
{
}
public bool IsWorkshop4D
{
get
{
//小车地图中的Y坐标
if (Position.Y < 55)
return true;
else if (Position.Y > 62)
return false;
else
return false;
}
}
public string[] ToGridRow()
{
string[] arr = new string[] { Name, Place, StateText, Battery.ToString(), IsOnline.ToString(), IsAuto.ToString(), "清除" };
return arr;
}
public string ToMissionState()
{
string s = Name + " [" + IP + "]\r\n\r\n" + MissionText;
return s;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
/// <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
}
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; }
public ClientNode()
{
}
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;
}
public ClientNode ToCopy()
{
ClientNode node = new ClientNode(Name, Mark, RFID, Action, Level);
return node;
}
}
}
using System;
using System.Collections.Generic;
namespace Model
{
public static class Common
{
public static List<AgvInfo> agvInfos;
public static bool fleetSend;
public static List<ClientNode> nodeInfos;
public const string MISSION_CHARGE = "AutoCharge";
public const string MISSION_STANDBY = "MoveStandby";
public const string MISSION_PASS_DOOR = "PassDoorInto";
public const string MISSION_PASS_DOOR_4D = "PassDoorInto4D";
public const string MISSION_PASS_DOOR_4C = "PassDoorInto4C";
}
}
using System;
namespace Model
{
public interface IJob
{
public bool IsEnd { get; }
public IJob Execute(AgvInfo info);
}
}
using System;
namespace Model
{
public class JobStep<T>
{
private T _step;
private DateTime _time;
private string _msg;
public JobStep(T step)
{
_step = step;
_time = DateTime.Now;
_msg = "";
}
public bool Equals(T step)
{
return _step.Equals(step);
}
public bool TimeOut(int ms)
{
TimeSpan span = DateTime.Now - _time;
if (span.TotalMilliseconds > ms)
return true;
else
return false;
}
public void NextStep(T step)
{
_step = step;
_time = DateTime.Now;
_msg = "";
}
public string Msg
{
get
{
return _msg;
}
set
{
if (!string.IsNullOrEmpty(value) && !_msg.Equals(value))
{
_msg = value;
string s = string.Format("{0} (step={1})", _msg, _step.ToString());
//LogOut.Info(s);
LogOut.UIShow(s);
}
}
}
}
}
using System;
namespace Model
{
public static class LogOut
{
private static log4net.ILog LOG;
public static System.Windows.Forms.TextBox LogBox { set; get; }
public static void Init(string name)
{
LOG = log4net.LogManager.GetLogger(name);
}
public static void UIShow(string s)
{
if (LogBox == null) return;
string time = string.Format("[{0:HH:mm:ss}] ", DateTime.Now);
LogBox.AppendText(time + s + "\r\n");
LogBox.ScrollToCaret();
}
public static void Error(string s, Exception ex)
{
LOG.Error(s, ex);
}
public static void Debug(string s)
{
LOG.Debug(s);
}
public static void Info(string s)
{
LOG.Info(s);
}
public static void Fatal(string s, Exception ex)
{
LOG.Fatal(s, ex);
}
public static void Warn(string s)
{
LOG.Warn(s);
}
}
}
此文件的差异被折叠, 点击展开。
<?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>{CB525EC1-745D-44D4-AE49-B0D16744600B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Model</RootNamespace>
<AssemblyName>Model</AssemblyName>
<TargetFrameworkVersion>v4.6</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>
<PropertyGroup>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=2.0.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.11\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="RestSharp, Version=106.11.7.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
<HintPath>..\packages\RestSharp.106.11.7\lib\net452\RestSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Windows.Forms" />
<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="AgvInfo.cs" />
<Compile Include="Client.cs" />
<Compile Include="IJob.cs" />
<Compile Include="JobStep.cs" />
<Compile Include="LogOut.cs" />
<Compile Include="MiR_API.cs" />
<Compile Include="Common.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="log4net.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Model")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Model")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("cb525ec1-745d-44d4-ae49-b0d16744600b")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<log4net>
<logger name="AGVControl_SMD">
<level value="Debug"/>
<appender-ref ref="smd"/>
</logger>
<logger name="MiR_API">
<level value="Debug"/>
<appender-ref ref="api"/>
</logger>
<appender name="smd" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\\AGVControl_SMD.log" />
<param name="Encoding" value="UTF-8"/>
<param name="AppendToFile" value="true" />
<param name="RollingStyle" value="Date" />
<param name="DatePattern" value="yyyy-MM-dd" />
<param name="MaxSizeRollBackups" value="100" />
<param name="MaxFileSize" value="10240" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="[%d][%t][%c:%L]%-5p %m%n" />
</layout>
</appender>
<appender name="api" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\\MiR_API.log" />
<param name="Encoding" value="UTF-8"/>
<param name="AppendToFile" value="true" />
<param name="RollingStyle" value="Date" />
<param name="DatePattern" value="yyyy-MM-dd" />
<param name="MaxSizeRollBackups" value="100" />
<param name="MaxFileSize" value="10240" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="[%d][%t][%c:%L]%-5p %m%n" />
</layout>
</appender>
</log4net>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.11" targetFramework="net46" />
<package id="RestSharp" version="106.11.7" targetFramework="net46" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup>
</configuration>
\ No newline at end of file
namespace AGVControl
{
partial class FrmMain
{
/// <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.TxtLog = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// TxtLog
//
this.TxtLog.Location = new System.Drawing.Point(22, 12);
this.TxtLog.Multiline = true;
this.TxtLog.Name = "TxtLog";
this.TxtLog.ReadOnly = true;
this.TxtLog.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.TxtLog.Size = new System.Drawing.Size(212, 211);
this.TxtLog.TabIndex = 0;
//
// FrmMain
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.TxtLog);
this.Name = "FrmMain";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Form1";
this.Load += new System.EventHandler(this.FrmMain_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox TxtLog;
}
}
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;
using Model;
namespace AGVControl
{
public partial class FrmMain : Form
{
public FrmMain()
{
InitializeComponent();
}
private void FrmMain_Load(object sender, EventArgs e)
{
LogOut.LogBox = TxtLog;
}
}
}
<?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 System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AGVControl
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
Application.ThreadException += Application_ThreadException;
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Model.LogOut.Init("AGVControl_SMD");
Model.LogOut.Info("=====程序开始=====");
Application.Run(new FrmMain());
Model.LogOut.Info("=====程序结束=====\r\n");
}
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Model.LogOut.Error("CurrentDomain_UnhandledException", (Exception)e.ExceptionObject);
}
private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
{
Model.LogOut.Error("Application_ThreadException", e.Exception);
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("UI")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UI")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("b2384612-3693-4bfd-ad71-078fb1704566")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [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 AGVControl.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("AGVControl.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 AGVControl.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"?>
<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>{B2384612-3693-4BFD-AD71-078FB1704566}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>AGVControl</RootNamespace>
<AssemblyName>AGVControl</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</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>
<Prefer32Bit>false</Prefer32Bit>
</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="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="FrmMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmMain.Designer.cs">
<DependentUpon>FrmMain.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FrmMain.resx">
<DependentUpon>FrmMain.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="..\Model\Model.csproj">
<Project>{cb525ec1-745d-44d4-ae49-b0d16744600b}</Project>
<Name>Model</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!