Commit 2f259b5a LN

增加服务器通信代码。与http接口可选配置。

1 个父辈 9562c160
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SmartShelf.Common
{
/// <summary>
/// 与服务器通信用对象
/// </summary>
public class Operation
{
/// <summary>
/// 料仓唯一标识
/// </summary>
private string _cid = "";
public string cid
{
get { return _cid; }
set { _cid = value; }
}
/// <summary>
/// 请求序列号
/// </summary>
public int seq { get; set; }
/// <summary>
/// 操作码(0无操作(发送料仓状态给服务器),1扫码入库(扫码成功后发送给服务器),2 出库(服务器发送),3表示错误信息 )
/// </summary>
public int op { get; set; }
/// <summary>
/// 操作相关数据,
/// op=1时,客户端发送 code 二维码给服务器,服务器返回时有:posId库位编号,plateW:料盘宽度,plateH:料盘高度
/// 如果需要更新温湿度的报警值,服务器会发送alarmTemperature,alarmHumidity给客户端,客户端缓存,如果没有发送,不处理
/// op=3时,data发送BoxID和AlarmCode
/// </summary>
private Dictionary<string, string> _data = new Dictionary<string, string>();
public Dictionary<string, string> data
{
get { return _data; }
set { _data = value; }
}
/// <summary>
/// 整体料仓状态
/// 1=正常运行中
/// 2=急停中
/// 3=故障(气压检测不到等,用msg发送详细故障说明)
/// 4=警告(用msg发送提醒,如出库到达工位但是没有工人操作)
/// </summary>
public int status { get; set; }
/// <summary>
/// 提示消息
/// 出入库错误: BOX正在调试中,不能出入库
/// 出入库错误: 急停了不能出入库
/// 入库错误:料盘过大,放不到指定的位置中去
/// 故障:气压信号检测不到
/// 警告:出库盘到达工位但是没有工人操作
/// </summary>
public string msg { get; set; }
/// <summary>
/// 包含的多个 BOX 的状态信息
/// </summary>
public Dictionary<int, BoxStatus> boxStatus = new Dictionary<int, BoxStatus>();
/// <summary>
/// 报警集合
/// </summary>
public List<AlarmInfo> alarmList = new List<AlarmInfo>();
}
/// <summary>
/// 单台料仓状态(包含流水线)
/// </summary>
public class BoxStatus
{
/// <summary>
/// Box编号,从1开始
/// </summary>
public int boxId { get; set; }
/// <summary>
/// 单台BOX状态
/// 急停,故障,调试中,就绪状态(正常待机)
/// 入库执行中,入库完成,入库失败
/// 出库执行中,出库完成,出库失败
/// </summary>
public int status { get; set; }
/// <summary>
/// 单台BOX的消息
/// 正在调试中,不能出入库
/// 入库失败原因:
/// 出库失败原因:
/// </summary>
public string msg { get; set; }
/// <summary>
/// 温度
/// </summary>
public string temperature { get; set; }
/// <summary>
/// 湿度
/// </summary>
public string humidity { get; set; }
/// <summary>
/// 操作相关数据,
/// 出库完成后发送posId库位编号给服务器
/// </summary>
private Dictionary<string, string> _data = new Dictionary<string, string>();
public Dictionary<string, string> data
{
get { return _data; }
set { _data = value; }
}
}
public class AlarmInfo
{
public AlarmInfo(int StoreID, int aType, string alarmDetial, string WarnMsg, int inoutStatus)
{
// TODO: Complete member initialization
this.boxId = StoreID;
this.alarmType = aType;
this.alarmDetail = alarmDetial;
this.alarmMsg = WarnMsg;
this.inOutStatus = inoutStatus;
}
public AlarmInfo()
{
// TODO: Complete member initialization
}
/// <summary>
/// 料仓ID,0表示流水线
/// </summary>
public int boxId { get; set; }
/// <summary>
/// 报警类型,
/// </summary>
public int alarmType { get; set; }
/// <summary>
/// 报警详情
///AlarmType= 0 消息 "1=原点返回
//AlarmType= 0 消息 2=复位"
//AlarmType=1 总体错误 "1=急停
//AlarmType=1 总体错误 2=没有气压信号
//AlarmType=1 总体错误,3=盘错乱"
//AlarmType=2 运动轴错误 1=第一轴(旋转)
//AlarmType=2 运动轴错误 2=第二轴(上下轴)
//AlarmType=2 运动轴错误 3=第三轴(前进轴)
//AlarmType=2 运动轴错误 4=第四轴(压紧轴)"
//AlarmType=2 电钢报警 5=上下电钢
//AlarmType=3 IO报警,信号超时 io电器定义(电器定义)
/// </summary>
public string alarmDetail { get; set; }
/// <summary>
/// 报警消息
/// </summary>
public string alarmMsg { get; set; }
/// <summary>
/// 0,1=入库,2=出库
/// </summary>
public int inOutStatus { get; set; }
}
public class ParamDefine
{
/// <summary>
/// 开灯: key为open value为库位信息,如果多个用|分割
/// </summary>
public static string open = "open";
/// <summary>
/// 关灯: key为close value为库位信息,如果多个用|分割
/// </summary>
public static string close = "close";
/// <summary>
/// 关灯: key为closeAll value为库位信息,如果多个用|分割
/// </summary>
public static string closeAll = "closeAll";
/// <summary>
/// 客户端发送 当前灯的状态:key为posOpened value为当前亮灯的库位,如果多个用|分割
/// </summary>
public static string posOpened = "posOpened";
///// <summary>
///// 卡信息: key为card value为读取到的卡内容,卡号-内容
///// </summary>
//public static string card = "card";
///// <summary>
///// 写卡: key=writeCard value为要写的内容
///// </summary>
//public static string writeCard = "writeCard";
///// <summary>
///// key= cardResult value = OK表示写成功
///// </summary>
//public static string cardResult = "cardResult";
}
}
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Bean.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Setting_Init.cs" /> <Compile Include="Setting_Init.cs" />
<Compile Include="util\AcSerialBean.cs" /> <Compile Include="util\AcSerialBean.cs" />
......
...@@ -40,5 +40,8 @@ namespace SmartShelf.Common ...@@ -40,5 +40,8 @@ namespace SmartShelf.Common
/// 颜色规则配置 /// 颜色规则配置
/// </summary> /// </summary>
public static string ColorRuleConfig = "ColorRuleConfig"; public static string ColorRuleConfig = "ColorRuleConfig";
public static string HttpServerAddr = "HttpServerAddr";
} }
} }
...@@ -117,5 +117,39 @@ namespace SmartShelf.Common ...@@ -117,5 +117,39 @@ namespace SmartShelf.Common
return str; return str;
} }
public static Operation Post(string url, Operation operation)
{
try
{
string json = "";
try
{
json = JsonHelper.SerializeObject(operation);
}
catch (Exception ex)
{
LOGGER.Error("JsonHelper.SerializeObject(operation) 出错【operation.op=" + operation.op + "】" + ex);
}
string result = Post(url, json);
if (!string.IsNullOrEmpty(result))
{
try
{
return JsonHelper.DeserializeJsonToObject<Operation>(result);
}
catch (Exception ex)
{
LOGGER.Error("JsonHelper.DeserializeJsonToObject 出错【result=" + result + "】" + ex);
}
}
}
catch (Exception ex)
{
LOGGER.Error("Post 出错【operation.op=" + operation.op + "】:" + ex);
}
return null;
}
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -44,11 +44,18 @@ namespace SmartShelf.Common ...@@ -44,11 +44,18 @@ namespace SmartShelf.Common
{ {
try try
{ {
LogUtil.debug("Stop Http Listener\n"); if (serverListener != null)
{
LogUtil.debug("Stop Http Listener");
serverListener.Stop(); serverListener.Stop();
serverListener = null; serverListener = null;
} }
catch { } }
catch (Exception ex)
{
LogUtil.error("HttpServer Stop Error:" + ex.ToString());
}
} }
/// <summary> /// <summary>
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
<Compile Include="manager\BOXManager.cs" /> <Compile Include="manager\BOXManager.cs" />
<Compile Include="DeviceLibrary\led\BaseLedManager.cs" /> <Compile Include="DeviceLibrary\led\BaseLedManager.cs" />
<Compile Include="DeviceLibrary\led\LEDColorArtNet.cs" /> <Compile Include="DeviceLibrary\led\LEDColorArtNet.cs" />
<Compile Include="manager\BOXManager_Partial.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
...@@ -8,17 +8,13 @@ using System.Windows.Forms; ...@@ -8,17 +8,13 @@ using System.Windows.Forms;
namespace SmartShelf.DeviceLibrary namespace SmartShelf.DeviceLibrary
{ {
/// <summary> public partial class BOXManager
/// 流水线自动料仓-流水线类
/// </summary>
public class BOXManager
{ {
private static int ServerPort = ConfigAppSettings.GetIntValue(Setting_Init.ServerPort);
// private static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public static string BoxName = " Shelf "; public static string BoxName = " Shelf ";
public static string CID = ""; public static string CID = "";
private static System.Timers.Timer timersTimer; private static System.Timers.Timer timersTimer;
private static System.Timers.Timer serverConTimer;
private static bool isInit = false; private static bool isInit = false;
public static string WarnMsg = ""; public static string WarnMsg = "";
public static Dictionary<string, BoxPosition> PositionMap = null; public static Dictionary<string, BoxPosition> PositionMap = null;
...@@ -100,6 +96,7 @@ namespace SmartShelf.DeviceLibrary ...@@ -100,6 +96,7 @@ namespace SmartShelf.DeviceLibrary
} }
return false; return false;
} }
protected static void Init() protected static void Init()
{ {
if (!isInit) if (!isInit)
...@@ -109,19 +106,39 @@ namespace SmartShelf.DeviceLibrary ...@@ -109,19 +106,39 @@ namespace SmartShelf.DeviceLibrary
timersTimer.Interval = 1000; timersTimer.Interval = 1000;
timersTimer.Elapsed += timersTimer_Elapsed; timersTimer.Elapsed += timersTimer_Elapsed;
timersTimer.AutoReset = true; timersTimer.AutoReset = true;
serverConTimer = new System.Timers.Timer();
serverConTimer.Enabled = false;
serverConTimer.Interval = 1000;
serverConTimer.Elapsed += server_connect_timer;
serverConTimer.AutoReset = true;
isInit = true; isInit = true;
} }
} }
public static bool StartRun() public static bool StartRun()
{ {
ServerPort = ConfigAppSettings.GetIntValue(Setting_Init.ServerPort);
LogUtil.info(BoxName + "开始启动:" + DateTime.Now.ToString() + "!"); LogUtil.info(BoxName + "开始启动:" + DateTime.Now.ToString() + "!");
timersTimer.Enabled = true; timersTimer.Enabled = true;
IsRun = true; IsRun = true;
LEDManager.OpenStatusLights("green"); LEDManager.OpenStatusLights("green");
ServerPort = ConfigAppSettings.GetIntValue(Setting_Init.ServerPort);
string host = ConfigAppSettings.GetValue(Setting_Init.HttpServerAddr);
if (ServerPort > 0)
{
PosId_SpiltChar = ';';
HttpServer.Start(ServerOnReceived, ServerPort); HttpServer.Start(ServerOnReceived, ServerPort);
LogUtil.info("启动服务完成,ServerPort【" + ServerPort + "】"); LogUtil.info("启动HttpServer接口服务完成,分隔符 "+PosId_SpiltChar+",端口号【" + ServerPort + "】");
}
else if(!String.IsNullOrEmpty(host))
{
PosId_SpiltChar = '|';
serverConTimer.Start();
LogUtil.info("启动与服务器连接定时器完成,分隔符 " + PosId_SpiltChar + ",地址 【" + host + "】");
}
return true; return true;
} }
...@@ -135,6 +152,7 @@ namespace SmartShelf.DeviceLibrary ...@@ -135,6 +152,7 @@ namespace SmartShelf.DeviceLibrary
} }
LEDManager.CloseStatusLights(); LEDManager.CloseStatusLights();
HttpServer.Stop(); HttpServer.Stop();
serverConTimer.Stop();
IsRun = false; IsRun = false;
LogUtil.info(BoxName + "停止运行,时间" + DateTime.Now.ToShortTimeString() + "!"); LogUtil.info(BoxName + "停止运行,时间" + DateTime.Now.ToShortTimeString() + "!");
} }
...@@ -175,137 +193,6 @@ namespace SmartShelf.DeviceLibrary ...@@ -175,137 +193,6 @@ namespace SmartShelf.DeviceLibrary
LogUtil.error("timersTimer_Elapsed出错:" + ex.ToString()); LogUtil.error("timersTimer_Elapsed出错:" + ex.ToString());
} }
} }
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 string Param_color = "color";
public static string Param_shelf = "shelf";
public static char PosId_SpiltChar = ';';
public static char PosId_Color_SpiltChar = '@';
// 开灯: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
//rest/api/v1/shelf/allPosOff? color = green 指定灭灯的颜色,如果为空,所有灯全部熄灭
private static string ServerOnReceived(string reqPath, string paramStr)
{
LogUtil.info("ServerOnReceived [" + reqPath + "] [" + paramStr + "] ");
paramStr = paramStr.Replace("%23", "#");
try
{
Dictionary<string, string> paramMap = GetParam(paramStr);
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, "posOn");
}
else
{
return GetResult(false, "posOn") + msg;
}
}
else if (reqPath.Equals(Path_LedOff))
{
if (paramMap.ContainsKey(Param_posId))
{
string pos = paramMap[Param_posId];
bool result = ProcessCloseLed(pos);
return GetResult(result, "posOff");
}
else
{
return GetResult(false, "posOff") + msg;
}
}
else if (reqPath.Equals(Path_ledOnAll))
{
bool result = ProcessOpenAll();
return GetResult(result, "allPosOn");
}
else if (reqPath.Equals(Path_ledOffAll))
{
bool result = true;
string color = "";
string shelf = "";
if (paramMap.ContainsKey(Param_color) && (paramMap[Param_color] != ""))
{
color = paramMap[Param_color];
}
if (paramMap.ContainsKey(Param_shelf) && paramMap[Param_shelf] != "")
{
shelf = paramMap[Param_shelf];
}
if(String.IsNullOrEmpty(color)&&String.IsNullOrEmpty(shelf))
{
result = ProcessCloseAll();
}
else
{
result = ProcessCloseByParam(color,shelf);
}
return GetResult(result, "allPosOff");
}
else
{
LogUtil.info("[" + reqPath + "]没有相关处理");
return "[" + reqPath + "]没有相关处理";
}
return "OK";
}
catch (Exception ex)
{
LogUtil.info("[" + reqPath + "][" + paramStr + "]处理错误:" + ex.ToString());
return "Error";
}
}
private static Dictionary<string, string> GetParam(string paramStr)
{
Dictionary<string, string> paramMap = new Dictionary<string, string>();
try
{
string[] paramArray = paramStr.Split('&');
foreach (string param in paramArray)
{
string[] data = param.Split('=');
if (data.Length == 2)
{
string paramName = data[0];
string paramValue = data[1];
//LogUtil.info("解析参数【"+paramStr+"】 : ["+paramName+"]["+paramValue+"]");
paramMap.Add(paramName, paramValue);
}
}
}
catch (Exception ex)
{
LogUtil.error("解析参数【" + paramStr + "】出错:" + ex.ToString());
}
return paramMap;
}
private static string GetResult(bool result, string op)
{
if (result)
{
return op + " OK";
}
else
{
return op + " FAIL";
}
}
public static string StrMsg = ""; public static string StrMsg = "";
......
using SmartShelf.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SmartShelf.DeviceLibrary
{
partial class BOXManager
{
#region HTT服务器通信
private static bool isInProcess = false;
private static void server_connect_timer(object sender, EventArgs e)
{
if (isInProcess)
{
return;
}
isInProcess = true;
try
{
SendInOutPosId();
}
catch (Exception ex)
{
LogUtil.error("server_connect_timer_Tick 出错:" + ex.ToString());
}
isInProcess = false;
}
private static Operation GetLineBoxStatus()
{
//构建发送给服务器的对象
Operation lineOperation = new Operation();
lineOperation.cid = BOXManager.CID;
lineOperation.seq = ConfigAppSettings.nextSeq();
lineOperation.status = 1;
BoxStatus boxStatus = new BoxStatus();
boxStatus.boxId = 1;
boxStatus.status = 1;
lineOperation.boxStatus.Add(1, boxStatus);
return lineOperation;
}
private static string api_communication = "service/store/communication"; //流水线状态通信接口
public static string GetPostApi(string host)
{
if (host == "")
{
host = ConfigAppSettings.GetValue(Setting_Init.HttpServerAddr);
}
if (!host.StartsWith("http://"))
{
host = "http://" + host;
}
if (!host.EndsWith("/"))
{
host = host + "/";
}
return host + api_communication;
}
// public static string StrMsg = "";
public static void SendInOutPosId()
{
StrMsg = "";
//构建发送给服务器的对象
Operation lineOperation = GetLineBoxStatus();
//获取亮灯的库位
string posId = "";
foreach (string key in StatusColorMap.Keys)
{
if (!String.IsNullOrEmpty(StatusColorMap[key]))
{
posId = posId + key + "|";
}
}
if (String.IsNullOrEmpty(posId).Equals(false))
{
lineOperation.data.Add(ParamDefine.posOpened, posId);
}
foreach (string str in lineOperation.data.Keys)
{
StrMsg += "[" + str + "=" + lineOperation.data[str] + "]\r\n";
}
string server = ConfigAppSettings.GetValue(Setting_Init.HttpServerAddr);
Operation resultOperation = HttpHelper.Post(GetPostApi(server), lineOperation);
if (resultOperation == null || resultOperation.data == null)
{
//判断服务端是否返回出库操作
return;
}
//与服务器通信用 | 分割
if (resultOperation.data.ContainsKey(ParamDefine.open))
{
ProcessOpenLed(resultOperation.data[ParamDefine.open]);
}
if (resultOperation.data.ContainsKey(ParamDefine.close))
{
ProcessCloseLed(resultOperation.data[ParamDefine.close]);
}
if (resultOperation.data.ContainsKey(ParamDefine.closeAll))
{
ProcessCloseAll();
}
}
#endregion
#region HTTP接口协议通信
private static int ServerPort = ConfigAppSettings.GetIntValue(Setting_Init.ServerPort);
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 string Param_color = "color";
public static string Param_shelf = "shelf";
public static char PosId_SpiltChar = ';';
public static char PosId_Color_SpiltChar = '@';
// 开灯: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
//rest/api/v1/shelf/allPosOff? color = green 指定灭灯的颜色,如果为空,所有灯全部熄灭
private static string ServerOnReceived(string reqPath, string paramStr)
{
LogUtil.info("ServerOnReceived [" + reqPath + "] [" + paramStr + "] ");
paramStr = paramStr.Replace("%23", "#");
try
{
Dictionary<string, string> paramMap = GetParam(paramStr);
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, "posOn");
}
else
{
return GetResult(false, "posOn") + msg;
}
}
else if (reqPath.Equals(Path_LedOff))
{
if (paramMap.ContainsKey(Param_posId))
{
string pos = paramMap[Param_posId];
bool result = ProcessCloseLed(pos);
return GetResult(result, "posOff");
}
else
{
return GetResult(false, "posOff") + msg;
}
}
else if (reqPath.Equals(Path_ledOnAll))
{
bool result = ProcessOpenAll();
return GetResult(result, "allPosOn");
}
else if (reqPath.Equals(Path_ledOffAll))
{
bool result = true;
string color = "";
string shelf = "";
if (paramMap.ContainsKey(Param_color) && (paramMap[Param_color] != ""))
{
color = paramMap[Param_color];
}
if (paramMap.ContainsKey(Param_shelf) && paramMap[Param_shelf] != "")
{
shelf = paramMap[Param_shelf];
}
if (String.IsNullOrEmpty(color) && String.IsNullOrEmpty(shelf))
{
result = ProcessCloseAll();
}
else
{
result = ProcessCloseByParam(color, shelf);
}
return GetResult(result, "allPosOff");
}
else
{
LogUtil.info("[" + reqPath + "]没有相关处理");
return "[" + reqPath + "]没有相关处理";
}
return "OK";
}
catch (Exception ex)
{
LogUtil.info("[" + reqPath + "][" + paramStr + "]处理错误:" + ex.ToString());
return "Error";
}
}
private static Dictionary<string, string> GetParam(string paramStr)
{
Dictionary<string, string> paramMap = new Dictionary<string, string>();
try
{
string[] paramArray = paramStr.Split('&');
foreach (string param in paramArray)
{
string[] data = param.Split('=');
if (data.Length == 2)
{
string paramName = data[0];
string paramValue = data[1];
//LogUtil.info("解析参数【"+paramStr+"】 : ["+paramName+"]["+paramValue+"]");
paramMap.Add(paramName, paramValue);
}
}
}
catch (Exception ex)
{
LogUtil.error("解析参数【" + paramStr + "】出错:" + ex.ToString());
}
return paramMap;
}
private static string GetResult(bool result, string op)
{
if (result)
{
return op + " OK";
}
else
{
return op + " FAIL";
}
}
#endregion
}
}
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
this.btnSave.Anchor = System.Windows.Forms.AnchorStyles.Top; this.btnSave.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSave.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnSave.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSave.Location = new System.Drawing.Point(226, 256); this.btnSave.Location = new System.Drawing.Point(226, 250);
this.btnSave.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.btnSave.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnSave.Name = "btnSave"; this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(103, 36); this.btnSave.Size = new System.Drawing.Size(103, 36);
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
this.btnBack.Anchor = System.Windows.Forms.AnchorStyles.Top; this.btnBack.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBack.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnBack.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnBack.Location = new System.Drawing.Point(118, 256); this.btnBack.Location = new System.Drawing.Point(118, 250);
this.btnBack.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.btnBack.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnBack.Name = "btnBack"; this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(103, 36); this.btnBack.Size = new System.Drawing.Size(103, 36);
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(459, 339); this.ClientSize = new System.Drawing.Size(459, 357);
this.Controls.Add(this.comBoxColor); this.Controls.Add(this.comBoxColor);
this.Controls.Add(this.label3); this.Controls.Add(this.label3);
this.Controls.Add(this.txtStaDmxId); this.Controls.Add(this.txtStaDmxId);
......
...@@ -9,22 +9,22 @@ ...@@ -9,22 +9,22 @@
<!--是否开机自动启动料仓--> <!--是否开机自动启动料仓-->
<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="8080" />
<!--服务器地址--> <!--服务器地址-->
<add key="http.server" value="http://192.168.200.22:8080/" /> <add key="HttpServerAddr" value="http://192.168.200.22:8080/" />
<!--料架灯类型,0=单色灯料架,1=三色灯料架,2=art-net-->
<!--料架灯类型,0=单色灯料架,1=三色灯料架--> <add key="DeviceLedType" value="2" />
<add key="DeviceLedType" value="1" /> <!--料仓库位配置文件-->
<!--一下为一个料仓的默认配置 开始--> <add key="Store_Position_Config" value="\Config\linePositions.csv"/>
<add key="Store_Position_Config" value="\Config\GW\linePositions.csv"/> <!--料仓cid-->
<add key="Store_ConfigPath" value="\Config\StoreConfig.csv" /> <add key="Store_CID" value="rc1272_1" />
<add key="Store_CID" value="SmartShelf3" /> <add key ="BoxCount" value ="1"/>
<add key ="DIMS" value="300"/> <add key ="DefaultDeviceIP" value ="192.168.201.191"/>
<add key ="DOMS" value ="300"/> <!--状态灯地址,;分割-->
<add key ="BoxCount" value ="7"/> <add key ="StatusLedDmx" value ="0"/>
<add key ="Status_Green_Lights" value ="192.168.1.151:129,130,131,132,133,134,135,136,137,138"/> <!--灯条颜色规则配置-->
<add key ="Status_Yellow_Lights" value ="192.168.1.151:140,141,142,143,144,145,146,147,148,149"/> <add key ="ColorRuleConfig" value ="RGB"/>
<add key ="Status_Red_Lights" value ="192.168.1.151:150,151,152,153,154,155,156,157,158,159,160"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
...@@ -35,28 +35,13 @@ ...@@ -35,28 +35,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>
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="INFO" />
<levelMax value="ERROR" />
</filter>
</appender>
<appender name="AIOBOXLog" type="log4net.Appender.RollingFileAppender">
<file value="logs/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" />
......
...@@ -32,8 +32,7 @@ ...@@ -32,8 +32,7 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<ApplicationIcon> <ApplicationIcon>shelf.ico</ApplicationIcon>
</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<PropertyGroup /> <PropertyGroup />
<PropertyGroup /> <PropertyGroup />
...@@ -102,7 +101,9 @@ ...@@ -102,7 +101,9 @@
<Name>DeviceLibrary</Name> <Name>DeviceLibrary</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup>
<Content Include="shelf.ico" />
</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.
......
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!