Commit 9a53769b LN

修改接口

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