Commit 83e877cb 刘韬

优化温湿度控制,添加湿度补偿

1 个父辈 d6afcf61
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
<!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)--> <!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)-->
<add key="StopBlowValue" value="4"/> <add key="StopBlowValue" value="4"/>
<add key="DoorOpenAirBlow" value="0"/> <add key="DoorOpenAirBlow" value="0"/>
<add key="humidityadjust" value="-11"/>
<add key="humiditylimited" value="4"/>
<add key="ACBaudRate" value ="115200"/> <add key="ACBaudRate" value ="115200"/>
<!--Server address--> <!--Server address-->
......
...@@ -9,7 +9,7 @@ using System.Runtime.InteropServices; ...@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SO951-HC-ACSingleStore 459bc4ee5f86ccae0d831b10a463616def194026")] [assembly: AssemblyProduct("SO951-HC-ACSingleStore d6afcf61f69f86354ab33fb351e3c50845d3f3da")]
[assembly: AssemblyCopyright("Copyright ? 2017")] [assembly: AssemblyCopyright("Copyright ? 2017")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
......
...@@ -344,4 +344,4 @@ AxisTipControl_label_speed_Text#点动速度:#Inching speed#タップスピー ...@@ -344,4 +344,4 @@ AxisTipControl_label_speed_Text#点动速度:#Inching speed#タップスピー
safety_grating_covered#开门时安全光栅被遮挡,料仓暂停运行.#The safety grating is blocked when opening the door, SMD BOX stoped. #ドアを開けると安全格子が遮られ、設備は運転を一時停止します。 safety_grating_covered#开门时安全光栅被遮挡,料仓暂停运行.#The safety grating is blocked when opening the door, SMD BOX stoped. #ドアを開けると安全格子が遮られ、設備は運転を一時停止します。
take_out_reel_failure#料叉没有成功取出料盘,请检查库位[{posId}],取出料盘后请复位.#Take out reel failure. Please check the position [{posId}], take out the reel manually, and reset.#フォークはトレイの取り出しに成功しなかった。保管場所[{posId}]を確認し、手動でパレットを取り出し、リセットしてください。
\ No newline at end of file \ No newline at end of file
take_out_reel_failure#料叉没有成功取出料盘,请检查库位[{0}],取出料盘后请复位.#Take out reel failure. Please check the position [{0}], take out the reel manually, and reset.#フォークはトレイの取り出しに成功しなかった。保管場所[{0}]を確認し、手動でパレットを取り出し、リセットしてください。
\ No newline at end of file \ No newline at end of file
...@@ -106,5 +106,7 @@ namespace OnlineStore.Common ...@@ -106,5 +106,7 @@ namespace OnlineStore.Common
public static string QRCodeCount = "MaxScanCount"; public static string QRCodeCount = "MaxScanCount";
public static string DoorOpenAirBlow= "DoorOpenAirBlow"; public static string DoorOpenAirBlow= "DoorOpenAirBlow";
public static string UseAirBlow = "UseAirBlow"; public static string UseAirBlow = "UseAirBlow";
public static string humidityadjust = "humidityadjust";
public static string humiditylimited = "humiditylimited";
} }
} }
...@@ -12,6 +12,7 @@ using System.Security.Cryptography; ...@@ -12,6 +12,7 @@ using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using System.Reflection; using System.Reflection;
using log4net; using log4net;
using System.Threading;
namespace OnlineStore.Common namespace OnlineStore.Common
{ {
...@@ -41,15 +42,24 @@ namespace OnlineStore.Common ...@@ -41,15 +42,24 @@ namespace OnlineStore.Common
} }
else else
{ {
string json = JsonHelper.SerializeObject(operation); if (Monitor.TryEnter(operation))
string result = Post(url, json);
Operation op = JsonHelper.DeserializeJsonToObject<Operation>(result);
if (operation.op > 0 || (op != null && op.op > 0) || (isLog == 1))
{ {
LogUtil.info("Send [" + json + "] Revice [" + result + "]"); try
{
string json = JsonHelper.SerializeObject(operation);
string result = Post(url, json);
Operation op = JsonHelper.DeserializeJsonToObject<Operation>(result);
if (operation.op > 0 || (op != null && op.op > 0) || (isLog == 1))
{
LogUtil.info("Send [" + json + "] Revice [" + result + "]");
}
return op;
}
finally {
Monitor.Exit(operation);
}
} }
return op;
} }
} }
catch (Exception ex) catch (Exception ex)
......
...@@ -26,8 +26,14 @@ namespace OnlineStore.Common ...@@ -26,8 +26,14 @@ namespace OnlineStore.Common
private static string LogName = ""; private static string LogName = "";
public static int HumitureControllerType = ConfigAppSettings.GetIntValue(Setting_Init.HumitureControllerType); public static int HumitureControllerType = ConfigAppSettings.GetIntValue(Setting_Init.HumitureControllerType);
static double humidityadjust = (double)ConfigAppSettings.GetNumValue(Setting_Init.humidityadjust);
static double humiditylimited = (double)ConfigAppSettings.GetNumValue(Setting_Init.humiditylimited);
public static bool Init(string port) public static bool Init(string port)
{ {
if (IsRun && port.Equals(serialPort)) if (IsRun && port.Equals(serialPort))
{ {
return true; return true;
...@@ -36,8 +42,8 @@ namespace OnlineStore.Common ...@@ -36,8 +42,8 @@ namespace OnlineStore.Common
{ {
Release(); Release();
} }
LogName = "温湿度传感器[" + port + "]"; LogName = "温湿度传感器[" + port + $"]{humidityadjust},{humiditylimited}";
LogUtil.info(LogName);
if (sb == null) if (sb == null)
{ {
serialPort = port; serialPort = port;
...@@ -85,6 +91,14 @@ namespace OnlineStore.Common ...@@ -85,6 +91,14 @@ namespace OnlineStore.Common
List<double> data = queryData(); List<double> data = queryData();
if (data.Count.Equals(2)) if (data.Count.Equals(2))
{ {
if (humidityadjust !=0 && humiditylimited !=0)
{
if (data[0] + humidityadjust < humiditylimited)
{
data[0] = humiditylimited;
}else
data[0] += humidityadjust;
}
param = new ASTemperateParam(data[1], data[0]); param = new ASTemperateParam(data[1], data[0]);
} }
LastData = param; LastData = param;
......
...@@ -1644,11 +1644,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -1644,11 +1644,12 @@ namespace OnlineStore.DeviceLibrary
string codeSize = ""; string codeSize = "";
List<string> codelists = new List<string>(codeList); List<string> codelists = new List<string>(codeList);
//= 7x12 = CODE //= 7x12 = CODE
foreach (string str in codelists.ToArray()) foreach (string code in codelists.ToArray())
{ {
string code = str; if (code.Trim().Length > 5)
continue;
//根据二维码开头获取固定尺寸 //根据二维码开头获取固定尺寸
codeSize = Config.GetCodeSize(str.Trim()); codeSize = Config.GetCodeSize(code.Trim());
if (!String.IsNullOrEmpty(codeSize)) if (!String.IsNullOrEmpty(codeSize))
{ {
LogUtil.info(Name + "夹具弃用条码【" + codeSize + "】:" + code); LogUtil.info(Name + "夹具弃用条码【" + codeSize + "】:" + code);
......
...@@ -725,16 +725,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -725,16 +725,17 @@ namespace OnlineStore.DeviceLibrary
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_12_DeviceOutFromDoor); StoreMove.NextMoveStep(StoreMoveStep.SO_12_DeviceOutFromDoor);
OutStoreLog("出库:SO_12 叉子从出料口返回,,进出轴动作至P1(待机点) "); OutStoreLog("出库:SO_12 叉子从出料口返回,,进出轴动作至P1(待机点) ");
InOutBackToP1(moveP.InOut_P1);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_12_DeviceOutFromDoor) else if (StoreMove.MoveStep == StoreMoveStep.SO_12_DeviceOutFromDoor)
{ {
HIKCamera.Current.CameraGrabOne(HIKCamera.Current.GetFixtureStateFilename(StoreMove.MoveParam, StoreMove.MoveType, FixtureState.DoorOut));
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : ""; string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
lastPosId = posId; lastPosId = posId;
lastPosIdStatus = StoreStatus.OutStorEnd; lastPosIdStatus = StoreStatus.OutStorEnd;
storeStatus = StoreStatus.OutStorEnd; storeStatus = StoreStatus.OutStorEnd;
SendLineStatus(); SendLineStatus();
InOutBackToP1(moveP.InOut_P1);
if (IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.HIGH)) if (IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.HIGH))
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_13_CheckTray); StoreMove.NextMoveStep(StoreMoveStep.SO_13_CheckTray);
...@@ -742,13 +743,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -742,13 +743,14 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
HIKCamera.Current.CameraGrabOne(HIKCamera.Current.GetFixtureStateFilename(StoreMove.MoveParam, StoreMove.MoveType, FixtureState.DoorOut));
StoreMove.NextMoveStep(StoreMoveStep.SO_TakeReelFaile); StoreMove.NextMoveStep(StoreMoveStep.SO_TakeReelFaile);
//StoreMove.NextMoveStep(StoreMoveStep.SO_15_WaitTake); //StoreMove.NextMoveStep(StoreMoveStep.SO_15_WaitTake);
//OutStoreLog("出库:出库未检测到料盘,出库失败"); //OutStoreLog("出库:出库未检测到料盘,出库失败");
//OutStoreLog("出库:SO_12_DeviceOutFromDoor 升降轴返回,轴2至P1(待机点) ,关闭仓门,更改状态为出库完成"); //OutStoreLog("出库:SO_12_DeviceOutFromDoor 升降轴返回,轴2至P1(待机点) ,关闭仓门,更改状态为出库完成");
//ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_P1, Config.UpDownAxis_P1_Speed); //ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
//CloseDoor(); //CloseDoor();
SetWarnMsg(ResourceControl.take_out_reel_failure, $"料叉没有成功取出料盘,请检查库位[{posId}]"); SetWarnMsg(ResourceControl.take_out_reel_failure, posId);
OutStoreLog($"料叉没有成功取出料盘,请检查库位[{posId}]"); OutStoreLog($"料叉没有成功取出料盘,请检查库位[{posId}]");
} }
//改为出库完成 //改为出库完成
...@@ -758,10 +760,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -758,10 +760,11 @@ namespace OnlineStore.DeviceLibrary
else if (StoreMove.MoveStep == StoreMoveStep.SO_TakeReelFaile) else if (StoreMove.MoveStep == StoreMoveStep.SO_TakeReelFaile)
{ {
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : ""; string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
SetWarnMsg(ResourceControl.CustAlarm, $"料叉没有成功取出料盘,请检查库位[{posId}]"); SetWarnMsg(ResourceControl.take_out_reel_failure, posId);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_13_CheckTray) else if (StoreMove.MoveStep == StoreMoveStep.SO_13_CheckTray)
{ {
HIKCamera.Current.CameraGrabOne(HIKCamera.Current.GetFixtureStateFilename(StoreMove.MoveParam, StoreMove.MoveType, FixtureState.DoorOut));
SO_14_GoBack(); SO_14_GoBack();
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_14_GoBack) else if (StoreMove.MoveStep == StoreMoveStep.SO_14_GoBack)
......
...@@ -32,7 +32,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -32,7 +32,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (QRCodeCount < 1) if (QRCodeCount < 1)
{ {
QRCodeCount = 1; QRCodeCount = 2;
} }
string nameStr = ConfigAppSettings.GetValue(Setting_Init.CameraName); string nameStr = ConfigAppSettings.GetValue(Setting_Init.CameraName);
string codeStr = ConfigAppSettings.GetValue(Setting_Init.CodeType); string codeStr = ConfigAppSettings.GetValue(Setting_Init.CodeType);
...@@ -135,7 +135,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -135,7 +135,7 @@ namespace OnlineStore.DeviceLibrary
[HandleProcessCorruptedStateExceptions] [HandleProcessCorruptedStateExceptions]
public static List<string> CameraScan() public static List<string> CameraScan()
{ {
int codeCount = 1; int codeCount = QRCodeCount;
List<string> codeList = new List<string>(); List<string> codeList = new List<string>();
if (cameraNameList == null || cameraNameList.Count <= 0) if (cameraNameList == null || cameraNameList.Count <= 0)
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!