Commit 9a53769b LN

修改接口

1 个父辈 946f98c7
...@@ -64,9 +64,6 @@ ...@@ -64,9 +64,6 @@
<Compile Include="util\MyWebClient.cs"> <Compile Include="util\MyWebClient.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
<Compile Include="util\NetTCPServer.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
......
...@@ -15,16 +15,11 @@ namespace SmartShelf.Common ...@@ -15,16 +15,11 @@ namespace SmartShelf.Common
/// 系统启动时自动启动料仓,=1时自动启动,并隐藏窗口,=0时不需要 /// 系统启动时自动启动料仓,=1时自动启动,并隐藏窗口,=0时不需要
/// </summary> /// </summary>
public static string App_AutoRun = "App_AutoRun"; public static string App_AutoRun = "App_AutoRun";
/// <summary>
/// 系统主界面标题
/// </summary>
public static string App_Title = "App_Title"; public static string App_Title = "App_Title";
public static string ServerPort = "ServerPort"; public static string ServerPort = "ServerPort";
//以下为流水线料仓的配置
//public static string Store_ConfigPath = "Store_ConfigPath";
public static string Store_Position_Config = "Store_Position_Config"; public static string Store_Position_Config = "Store_Position_Config";
public static string Store_CID = "Store_CID"; public static string Store_CID = "Store_CID";
...@@ -33,10 +28,5 @@ namespace SmartShelf.Common ...@@ -33,10 +28,5 @@ namespace SmartShelf.Common
/// 料架灯类型,0=单色灯料架,1=三色灯料架 /// 料架灯类型,0=单色灯料架,1=三色灯料架
/// </summary> /// </summary>
public static string DeviceLedType = "DeviceLedType"; public static string DeviceLedType = "DeviceLedType";
//public static string Status_Green_Lights = "Status_Green_Lights";
//public static string Status_Red_Lights = "Status_Red_Lights";
//public static string Status_Yellow_Lights = "Status_Yellow_Lights";
} }
} }
...@@ -66,10 +66,7 @@ ...@@ -66,10 +66,7 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="Config\linePositions_2.csv"> <None Include="Config\linePositions.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Config\linePositions_1.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
</ItemGroup> </ItemGroup>
......
...@@ -9,14 +9,11 @@ using System.Threading.Tasks; ...@@ -9,14 +9,11 @@ using System.Threading.Tasks;
namespace SmartShelf.DeviceLibrary namespace SmartShelf.DeviceLibrary
{ {
/// <summary> /// <summary>
/// 三色灯,RGB,红蓝绿 /// 三色灯ArtNet协议,RGB,红蓝绿
/// </summary> /// </summary>
public class LEDColorArtNet : LEDBaseModule public class LEDColorArtNet : LEDBaseModule
{ {
//private const ushort Max_DMX = 16; //private const ushort Max_DMX = 16;
//private int Max_Light = 170; //private int Max_Light = 170;
private int datalength = 512; private int datalength = 512;
......
using log4net; using log4net;
using SmartShelf.Common; using SmartShelf.Common;
using SmartShelf.LoadCSVLibrary; using SmartShelf.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing;
using System.IO.Ports;
using System.Linq; using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
using System.Windows.Forms; using System.Windows.Forms;
namespace SmartShelf.DeviceLibrary namespace SmartShelf.DeviceLibrary
...@@ -161,36 +154,36 @@ namespace SmartShelf.DeviceLibrary ...@@ -161,36 +154,36 @@ namespace SmartShelf.DeviceLibrary
LogUtil.error("timersTimer_Elapsed出错:" + ex.ToString()); LogUtil.error("timersTimer_Elapsed出错:" + ex.ToString());
} }
} }
public static string Path_LedOn = "//ledOn.html"; public static string Path_LedOn = "/rest/api/v1/shelf/posOn";
public static string Path_LedOff = "//ledOff.html"; public static string Path_LedOff = "/rest/api/v1/shelf/posOff";
public static string Path_ledOnAll = "//ledOnAll.html"; public static string Path_ledOnAll = "/rest/api/v1/shelf/allPosOn";
public static string Path_ledOffAll = "//ledOffAll.html"; public static string Path_ledOffAll = "/rest/api/v1/shelf/allPosOff";
public static string Param_posId = "posId"; public static string Param_posId = "posId";
public static char PosId_SpiltChar = ';'; public static char PosId_SpiltChar = ';';
public static char PosId_Color_SpiltChar = '@'; public static char PosId_Color_SpiltChar = '@';
// 开灯:http://localhost:80//ledOn.html?posId=1_3_1@green;1_3_2@green;1_3_7@red // 开灯:http:/localhost:80/rest/api/v1/shelf/posOn?posId=1_3_1@green;1_3_2@green;1_3_7@red
// 关灯:http://localhost:80//ledOff.html?posId=1_3_1;1_3_2;1_3_4 // 关灯:http:/localhost:80/rest/api/v1/shelf/posOff?posId=1_3_1;1_3_2;1_3_4
//关闭所有:http://localhost:80//ledOffAll.html //关闭所有:http:/localhost:80/rest/api/v1/shelf/allPosOn
//打开所有:http://localhost:80//ledOnAll.html //打开所有:http:/localhost:80/rest/api/v1/shelf/allPosOff
private static string ServerOnReceived(string reqPath, string paramStr) private static string ServerOnReceived(string reqPath, string paramStr)
{ {
try try
{ {
Dictionary<string, string> paramMap = GetParam(paramStr); Dictionary<string, string> paramMap = GetParam(paramStr);
string msg = "conot find param:" + Param_posId ; string msg = ": conot find param " + Param_posId ;
if (reqPath.Equals(Path_LedOn)) if (reqPath.Equals(Path_LedOn))
{ {
if (paramMap.ContainsKey(Param_posId)) if (paramMap.ContainsKey(Param_posId))
{ {
string pos = paramMap[Param_posId]; string pos = paramMap[Param_posId];
bool result = ProcessOpenLed(pos); bool result = ProcessOpenLed(pos);
return GetResult(result, "ledOn"); return GetResult(result, "posOn");
} }
else else
{ {
return msg; return GetResult(false, "posOn")+ msg;
} }
} }
else if (reqPath.Equals(Path_LedOff)) else if (reqPath.Equals(Path_LedOff))
...@@ -199,22 +192,22 @@ namespace SmartShelf.DeviceLibrary ...@@ -199,22 +192,22 @@ namespace SmartShelf.DeviceLibrary
{ {
string pos = paramMap[Param_posId]; string pos = paramMap[Param_posId];
bool result = ProcessCloseLed(pos); bool result = ProcessCloseLed(pos);
return GetResult(result, "ledOff"); return GetResult(result, "posOff");
} }
else else
{ {
return msg; return GetResult(false, "posOff") + msg;
} }
} }
else if (reqPath.Equals(Path_ledOnAll)) else if (reqPath.Equals(Path_ledOnAll))
{ {
bool result = ProcessOpenAll(); bool result = ProcessOpenAll();
return GetResult(result, "ledOnAll"); return GetResult(result, "allPosOn");
} }
else if (reqPath.Equals(Path_ledOffAll)) else if (reqPath.Equals(Path_ledOffAll))
{ {
bool result = ProcessCloseAll(); bool result = ProcessCloseAll();
return GetResult(result, "ledOffAll"); return GetResult(result, "allPosOff");
} }
else else
{ {
......
...@@ -49,16 +49,10 @@ ...@@ -49,16 +49,10 @@
<Compile Include="CSVExection.cs" /> <Compile Include="CSVExection.cs" />
<Compile Include="position\CSVPositionReader.cs" /> <Compile Include="position\CSVPositionReader.cs" />
<Compile Include="position\BoxPosition.cs" /> <Compile Include="position\BoxPosition.cs" />
<Compile Include="storeConfig\ConfigItemBase.cs" />
<Compile Include="storeConfig\ConfigProAttribute.cs" /> <Compile Include="storeConfig\ConfigProAttribute.cs" />
<Compile Include="storeConfig\config\BOX_Config.cs" />
<Compile Include="storeConfig\config\StoreType.cs" />
<Compile Include="storeConfig\config\Store_IO_Type.cs" />
<Compile Include="CSVAttribute.cs" /> <Compile Include="CSVAttribute.cs" />
<Compile Include="storeConfig\CSVConfigReader.cs" />
<Compile Include="CSVReaderBase.cs" /> <Compile Include="CSVReaderBase.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="storeConfig\config\StoreConfig.cs" />
<Compile Include="position\StorePostionBase.cs" /> <Compile Include="position\StorePostionBase.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
...@@ -67,6 +61,9 @@ ...@@ -67,6 +61,9 @@
<Name>Common</Name> <Name>Common</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="storeConfig\config\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
......
...@@ -16,7 +16,6 @@ namespace SmartShelf.LoadCSVLibrary ...@@ -16,7 +16,6 @@ namespace SmartShelf.LoadCSVLibrary
[CSVAttribute("料仓ID")] [CSVAttribute("料仓ID")]
public int StoreId { get; set; } public int StoreId { get; set; }
[CSVAttribute("区域ID")] [CSVAttribute("区域ID")]
public int DmxId { get; set; } public int DmxId { get; set; }
......
...@@ -8,17 +8,15 @@ ...@@ -8,17 +8,15 @@
<!--是否开机自动启动料仓--> <!--是否开机自动启动料仓-->
<add key="App_AutoRun" value="0"/> <add key="App_AutoRun" value="0"/>
<add key="App_Title" value="料架"/> <add key="App_Title" value="料架"/>
<!--服务器端口号--> <!--服务器端口号-->
<add key="ServerPort" value="80" /> <add key="ServerPort" value="80" />
<!--料架灯类型,0=单色灯料架,1=三色灯料架,2=art-net--> <!--料架灯类型,0=单色灯料架,1=三色灯料架,2=art-net-->
<add key="DeviceLedType" value="2" /> <add key="DeviceLedType" value="2" />
<!--一下为一个料仓的默认配置 开始--> <!--料仓库位配置文件-->
<add key="Store_Position_Config" value="\Config\linePositions.csv"/> <add key="Store_Position_Config" value="\Config\linePositions.csv"/>
<!--<add key="Store_ConfigPath" value="\Config\StoreConfig.csv" />--> <!--料仓cid-->
<add key="Store_CID" value="rc1272_1" /> <add key="Store_CID" value="rc1272_1" />
<add key ="BoxCount" value ="2"/> <add key ="BoxCount" value ="1"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
...@@ -29,25 +27,13 @@ ...@@ -29,25 +27,13 @@
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" /> <conversionPattern value="[%date][%t]%-5p %m%n" />
</layout> </layout>
</appender>
<appender name="AIOBOXLog" type="log4net.Appender.RollingFileAppender">
<file value="logs/aio/AIOBOX1.log" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t] %m%n" />
</layout>
</appender> </appender>
<logger name="RollingLogFileAppender"> <logger name="RollingLogFileAppender">
<level value="Info" /> <level value="Info" />
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender" />
</logger> </logger>
<logger name="AIOBOXLog">
<level value="Debug" />
<appender-ref ref="AIOBOXLog" />
</logger>
<root> <root>
<level value="INFO" /> <level value="INFO" />
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender" />
......
...@@ -61,11 +61,11 @@ ...@@ -61,11 +61,11 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="SingleLedShelfClient.cs"> <Compile Include="SmartShelfClient.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
<Compile Include="SingleLedShelfClient.Designer.cs"> <Compile Include="SmartShelfClient.Designer.cs">
<DependentUpon>SingleLedShelfClient.cs</DependentUpon> <DependentUpon>SmartShelfClient.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="ProjectInstaller.cs"> <Compile Include="ProjectInstaller.cs">
......
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!