Commit 5cf3d1bc 张东亮

配置添加注释

1 个父辈 2a98a472
...@@ -11,31 +11,30 @@ namespace OnlineStore.Common ...@@ -11,31 +11,30 @@ namespace OnlineStore.Common
/// 记录配置的key /// 记录配置的key
/// </summary> /// </summary>
public class Setting_Init public class Setting_Init
{ /// <summary> {
/// 系统启动时自动启动料仓,=1时自动启动,并隐藏窗口,=0时不需要
/// </summary>
public static string App_AutoRun = "App_AutoRun";
/// <summary>
/// 系统主界面标题
/// </summary>
public static string App_Title = "App_Title";
[MyConfigComment("系统启动时自动启动料仓,=1时自动启动,并隐藏窗口,=0时不需要")]
public static MyConfig<int> App_AutoRun = 0;
[MyConfigComment("系统主界面标题")]
public static MyConfig<string> App_Title = "MIMO G2";
/// <summary> /// <summary>
/// 摄像机名称 /// 摄像机名称
/// </summary> /// </summary>
public static string CameraName = "CameraName"; public static string CameraName = "CameraName";
[MyConfigComment("条码类型")]
public static string CodeType = "CodeType"; public static MyConfig<string> CodeType = "QR Code";
public static string CodeParamPath = "CodeParamPath"; [MyConfigComment("条码解码参数路径")]
public static MyConfig<string> CodeParamPath = "";
public static string QRCodeCount = "QRCodeCount"; [MyConfigComment("筛选条码数量")]
public static MyConfig<int> QRCodeCount = 3;
public static string CodeTimeOut = "CodeTimeOut"; [MyConfigComment("解码的超时时间")]
public static MyConfig<int> CodeTimeOut = 1000;
/// <summary> /// <summary>
/// 校准库位的料盘信息 /// 校准库位的料盘信息
/// </summary> /// </summary>
public static string FixBuffInfo = "FixBuffInfo"; [MyConfigComment("校准库位的料盘信息")]
public static MyConfig<string> FixBuffInfo = "";
[MyConfigComment("进出轴运动负载阈值")] [MyConfigComment("进出轴运动负载阈值")]
public static MyConfig<float> Device_InOutMaxLoadRate = 50; public static MyConfig<float> Device_InOutMaxLoadRate = 50;
...@@ -75,5 +74,69 @@ namespace OnlineStore.Common ...@@ -75,5 +74,69 @@ namespace OnlineStore.Common
[MyConfigComment("是否禁止单盘入库")] [MyConfigComment("是否禁止单盘入库")]
public static MyConfig<bool> DisableSingleReelIn = false; public static MyConfig<bool> DisableSingleReelIn = false;
[MyConfigComment("是否启用上料提升轴的料叉检测")]
public static MyConfig<bool> Swicth_BatchFixCheck = false;
[MyConfigComment("料串门光栅触发处理方式:0-设备急停;1-仅料串门停止")]
public static MyConfig<int> StringDoor_SafetyLightCurtainsProcStrategy = 1;
[MyConfigComment("是否启用AGV")]
public static MyConfig<bool> AGV_Enable = false;
[MyConfigComment("AGV服务软件所在电脑IP")]
public static MyConfig<string> AGV_ServerIp = "127.0.0.1";
[MyConfigComment("AGV服务接口")]
public static MyConfig<int> AGV_ServerPort = 12000;
[MyConfigComment("AGV节点编号")]
public static MyConfig<int> AGV_NodeId = 1;
[MyConfigComment("AGV节点名称")]
public static MyConfig<string> AGV_NodeName = "MIMO";
[MyConfigComment("库位高低点最大相差的值")]
public static MyConfig<int> UpDownAxis_Position_MaxRange = 30000;
[MyConfigComment("湿度修正值,写负数 -5等于减5")]
public static MyConfig<int> Device_humidityadjust = 0;
[MyConfigComment("湿度修正最低值,防止修正过头")]
public static MyConfig<int> Device_humiditylimited = 0;
[MyConfigComment("是否使用一维码检测料盘在NG平台")]
public static MyConfig<bool> CamTestReel_useBarcode = false;
[MyConfigComment("NG平台一维码检测料盘:一维码的内容")]
public static MyConfig<string> CamTestReel_barcode = "RW0000015";
[MyConfigComment("NG平台一维码检测料盘:阈值设置,小于该该数量认为有料")]
public static MyConfig<int> CamTestReel_barcodeThreshold = 2;
[MyConfigComment("是否打开NG平台检测料盘调试")]
public static MyConfig<bool> CamTestReel_debug = false;
[MyConfigComment("NG平台颜色检测料盘:总的覆盖数量")]
public static MyConfig<int> CamTestReel_totalcover = 69577;
[MyConfigComment("NG平台颜色检测料盘:色相H的最低值")]
public static MyConfig<int> CamTestReel_HL = 40;
[MyConfigComment("NG平台颜色检测料盘:色相H的最大值")]
public static MyConfig<int> CamTestReel_HH = 70;
[MyConfigComment("NG平台颜色检测料盘:亮度L的最低值")]
public static MyConfig<int> CamTestReel_LL = 15;
[MyConfigComment("NG平台颜色检测料盘:亮度L的最大值")]
public static MyConfig<int> CamTestReel_LH = 100;
[MyConfigComment("NG平台颜色检测料盘:饱和度S的最小值")]
public static MyConfig<int> CamTestReel_SL = 20;
[MyConfigComment("NG平台颜色检测料盘:饱和度S的最大值")]
public static MyConfig<int> CamTestReel_SH = 100;
[MyConfigComment("NG平台颜色检测料盘:阈值设置,小于该值认为有料")]
public static MyConfig<double> CamTestReel_threshold = 0.6;
[MyConfigComment("是否单进单出")]
public static MyConfig<bool> Device_SingleInSingleOut = false;
[MyConfigComment("SMF服务器地址")]
public static MyConfig<string> http_server = "";
[MyConfigComment("料仓CID")]
public static MyConfig<string> CID = "";
[MyConfigComment("温湿度串口号")]
public static MyConfig<string> Device_Humiture_Port = "CMO1";
} }
} }
...@@ -95,9 +95,9 @@ namespace OnlineStore.Common ...@@ -95,9 +95,9 @@ namespace OnlineStore.Common
public static ASTemperateParam QueryData() public static ASTemperateParam QueryData()
{ {
//修正值, 配置中写负数 -5等于减5 //修正值, 配置中写负数 -5等于减5
var humidityadjust = Config.Get("Device_humidityadjust", 0); var humidityadjust = Setting_Init.Device_humidityadjust;
//最低值,防止修正过头 //最低值,防止修正过头
var humiditylimited = Config.Get("Device_humiditylimited", 0); var humiditylimited = Setting_Init.Device_humiditylimited;
ASTemperateParam param = new ASTemperateParam(0, 0); ASTemperateParam param = new ASTemperateParam(0, 0);
List<double> data = queryData(); List<double> data = queryData();
if (data.Count.Equals(2)) if (data.Count.Equals(2))
......
...@@ -20,7 +20,7 @@ public class HIKCamera ...@@ -20,7 +20,7 @@ public class HIKCamera
public event EventHandler<Bitmap> camera_event; public event EventHandler<Bitmap> camera_event;
public string DeviceName = "monitor1"; public string DeviceName = "monitor1";
public PictureBox picture = new PictureBox(); public PictureBox picture = new PictureBox();
bool enableCamera = ConfigHelper.Config.Get("Func_EnableCam", true); //bool enableCamera = ConfigHelper.Config.Get("Func_EnableCam", true);
//public bool LoadCameraConfig(out string msg, object preview = null) //public bool LoadCameraConfig(out string msg, object preview = null)
//{ //{
// msg = ""; // msg = "";
......
...@@ -22,9 +22,9 @@ namespace DeviceLibrary ...@@ -22,9 +22,9 @@ namespace DeviceLibrary
{ {
public class CodeManager public class CodeManager
{ {
public static string CodeType = ConfigHelper.Config.Get(Setting_Init.CodeType, "QR Code"); public static string CodeType = Setting_Init.CodeType;
private static int QRCodeCount = ConfigHelper.Config.Get(Setting_Init.QRCodeCount, 3); private static int QRCodeCount = Setting_Init.QRCodeCount;
private static int CodeTimeOut = ConfigHelper.Config.Get(Setting_Init.CodeTimeOut, 1000); private static int CodeTimeOut = Setting_Init.CodeTimeOut;
public static List<string> cameraNameList = new List<string>(); public static List<string> cameraNameList = new List<string>();
public static List<string> codeTypeList = new List<string>(); public static List<string> codeTypeList = new List<string>();
public static List<string> hikNameList = new List<string>(); public static List<string> hikNameList = new List<string>();
...@@ -263,7 +263,7 @@ namespace DeviceLibrary ...@@ -263,7 +263,7 @@ namespace DeviceLibrary
string logtxt = $"【" + cameraName + "】开始取图片测试是否有料盘" + "\r\n"; string logtxt = $"【" + cameraName + "】开始取图片测试是否有料盘" + "\r\n";
DateTime startTime = DateTime.Now; DateTime startTime = DateTime.Now;
Bitmap bmp = null; Bitmap bmp = null;
bool usebarcode = ConfigHelper.Config.Get("CamTestReel_useBarcode", false); bool usebarcode = Setting_Init.CamTestReel_useBarcode;
if (usebarcode) if (usebarcode)
{ {
try try
...@@ -284,8 +284,8 @@ namespace DeviceLibrary ...@@ -284,8 +284,8 @@ namespace DeviceLibrary
} }
logtxt += $"【" + cameraName + "】获取到图像" + "\r\n"; logtxt += $"【" + cameraName + "】获取到图像" + "\r\n";
string code = ConfigHelper.Config.Get("CamTestReel_barcode", "RW0000015"); string code = Setting_Init.CamTestReel_barcode;
int codeThreshold = ConfigHelper.Config.Get("CamTestReel_barcodeThreshold", 2); int codeThreshold = Setting_Init.CamTestReel_barcodeThreshold;
//if (ConfigHelper.Config.Get("CamTestReel_debug", false)) //if (ConfigHelper.Config.Get("CamTestReel_debug", false))
// srcimg = SaveImageToFile("test", cameraName, bmp); // srcimg = SaveImageToFile("test", cameraName, bmp);
...@@ -318,15 +318,15 @@ namespace DeviceLibrary ...@@ -318,15 +318,15 @@ namespace DeviceLibrary
}); });
} }
logtxt += $" 一维码扫描结果:{count}[{r}],设置可扫描到条码数量:{codeThreshold},result:{((count < codeThreshold)?"有料":"无料")}\r\n"; logtxt += $" 一维码扫描结果:{count}[{r}],设置可扫描到条码数量:{codeThreshold},result:{((count < codeThreshold) ? "有料" : "无料")}\r\n";
if (hasReel != lastHasReel) if (hasReel != lastHasReel)
{ {
lastHasReel = hasReel; lastHasReel = hasReel;
} }
else if (!ConfigHelper.Config.Get("CamTestReel_debug", false)) else if (!Setting_Init.CamTestReel_debug)
logtxt = ""; logtxt = "";
if (ConfigHelper.Config.Get("CamTestReel_debug", false) || (TestHasRight.HasValue && TestHasRight.Value != hasReel)) if (Setting_Init.CamTestReel_debug || (TestHasRight.HasValue && TestHasRight.Value != hasReel))
prcimg = SaveImageToFile("test2", cameraName, bmp); prcimg = SaveImageToFile("test2", cameraName, bmp);
TestHasRight = null; TestHasRight = null;
return hasReel; return hasReel;
...@@ -370,17 +370,17 @@ namespace DeviceLibrary ...@@ -370,17 +370,17 @@ namespace DeviceLibrary
goto retry; goto retry;
} }
logtxt += $"【" + cameraName + "】获取到图像" + "\r\n"; logtxt += $"【" + cameraName + "】获取到图像" + "\r\n";
int totalcover = ConfigHelper.Config.Get("CamTestReel_totalcover", 69577); int totalcover = Setting_Init.CamTestReel_totalcover;
int hl = ConfigHelper.Config.Get("CamTestReel_HL", 40); int hl =Setting_Init.CamTestReel_HL;
int hh = ConfigHelper.Config.Get("CamTestReel_HH", 70); int hh = Setting_Init.CamTestReel_HH;
int ll = ConfigHelper.Config.Get("CamTestReel_LL", 15); int ll = Setting_Init.CamTestReel_LL;
int lh = ConfigHelper.Config.Get("CamTestReel_LH", 100); int lh = Setting_Init.CamTestReel_LH;
int sl = ConfigHelper.Config.Get("CamTestReel_SL", 20); int sl = Setting_Init.CamTestReel_SL;
int sh = ConfigHelper.Config.Get("CamTestReel_SH", 100); int sh = Setting_Init.CamTestReel_SH;
double threshold = ConfigHelper.Config.Get("CamTestReel_threshold", 0.6); double threshold = Setting_Init.CamTestReel_threshold;
if (ConfigHelper.Config.Get("CamTestReel_debug", false)) if (Setting_Init.CamTestReel_debug)
srcimg = SaveImageToFile("test", cameraName, bmp); srcimg = SaveImageToFile("test", cameraName, bmp);
...@@ -391,7 +391,7 @@ namespace DeviceLibrary ...@@ -391,7 +391,7 @@ namespace DeviceLibrary
g.DrawImage(bmp, 0, 0, b.Width, b.Height); g.DrawImage(bmp, 0, 0, b.Width, b.Height);
} }
ImageLockMode imageLockMode = ImageLockMode.ReadOnly; ImageLockMode imageLockMode = ImageLockMode.ReadOnly;
if (ConfigHelper.Config.Get("CamTestReel_debug", false)) if (Setting_Init.CamTestReel_debug)
imageLockMode = ImageLockMode.ReadWrite; imageLockMode = ImageLockMode.ReadWrite;
var bd = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), imageLockMode, b.PixelFormat); var bd = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), imageLockMode, b.PixelFormat);
...@@ -430,7 +430,7 @@ namespace DeviceLibrary ...@@ -430,7 +430,7 @@ namespace DeviceLibrary
if (h.H >= hl && h.H <= hh && h.V >= ll && h.V <= lh && h.S >= sl && h.S <= sh) if (h.H >= hl && h.H <= hh && h.V >= ll && h.V <= lh && h.S >= sl && h.S <= sh)
{ {
maskcout++; maskcout++;
if (ConfigHelper.Config.Get("CamTestReel_debug", false)) if (Setting_Init.CamTestReel_debug)
{ {
Marshal.WriteByte(bd.Scan0, x, 0); Marshal.WriteByte(bd.Scan0, x, 0);
Marshal.WriteByte(bd.Scan0, x + 1, 0); Marshal.WriteByte(bd.Scan0, x + 1, 0);
...@@ -472,10 +472,10 @@ namespace DeviceLibrary ...@@ -472,10 +472,10 @@ namespace DeviceLibrary
{ {
lastHasReel = hasReel; lastHasReel = hasReel;
} }
else if (!ConfigHelper.Config.Get("CamTestReel_debug", false)) else if (!Setting_Init.CamTestReel_debug)
logtxt = ""; logtxt = "";
if (ConfigHelper.Config.Get("CamTestReel_debug", false) || (TestHasRight.HasValue && TestHasRight.Value != hasReel)) if (Setting_Init.CamTestReel_debug || (TestHasRight.HasValue && TestHasRight.Value != hasReel))
prcimg = SaveImageToFile("test2", cameraName, b); prcimg = SaveImageToFile("test2", cameraName, b);
b.Dispose(); b.Dispose();
TestHasRight = null; TestHasRight = null;
...@@ -584,7 +584,7 @@ namespace DeviceLibrary ...@@ -584,7 +584,7 @@ namespace DeviceLibrary
public static string GetCodeParamFilePath(string codePath) public static string GetCodeParamFilePath(string codePath)
{ {
string appPath = Application.StartupPath; string appPath = Application.StartupPath;
string path = Path.Combine(appPath, ConfigHelper.Config.Get(Setting_Init.CodeParamPath)); string path = Path.Combine(appPath,Setting_Init.CodeParamPath);
string filePath = Path.Combine(path, codePath + ".dcm"); string filePath = Path.Combine(path, codePath + ".dcm");
if (File.Exists(filePath)) if (File.Exists(filePath))
{ {
......
...@@ -25,8 +25,8 @@ namespace DeviceLibrary ...@@ -25,8 +25,8 @@ namespace DeviceLibrary
_storeStatus = value; _storeStatus = value;
} }
} }
static string server = ConfigHelper.Config.Get("http_server"); static string server = Setting_Init.http_server;
static string CID = ConfigHelper.Config.Get("CID"); static string CID = Setting_Init.CID;
int StoreID = 1; int StoreID = 1;
string StoreName = ""; string StoreName = "";
...@@ -123,7 +123,7 @@ namespace DeviceLibrary ...@@ -123,7 +123,7 @@ namespace DeviceLibrary
operation.op = 1; operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", code }, { "boxId", StoreID.ToString() }, { "doorReelSignal", "1" } }; operation.data = new Dictionary<string, string>() { { "code", code }, { "boxId", StoreID.ToString() }, { "doorReelSignal", "1" } };
if (reel.PlateH == 100 && ConfigHelper.Config.Get("Device_SingleInSingleOut", false)) if (reel.PlateH == 100 && Setting_Init.Device_SingleInSingleOut)
{ {
//singleIn 单盘入库 //singleIn 单盘入库
operation.data.Add("singleIn", "true"); operation.data.Add("singleIn", "true");
......
...@@ -78,7 +78,7 @@ namespace DeviceLibrary ...@@ -78,7 +78,7 @@ namespace DeviceLibrary
/// <summary> /// <summary>
/// 是否启用上料提升轴的料叉检测 /// 是否启用上料提升轴的料叉检测
/// </summary> /// </summary>
public bool EnableBatchFixCheck { get { return ConfigAppSettings.GetValue("Swicth_BatchFixCheck", false, "是否启用上料提升轴的料叉检测"); } } public bool EnableBatchFixCheck { get { return Setting_Init.Swicth_BatchFixCheck; } }
public MainMachine(Robot_Config _config) public MainMachine(Robot_Config _config)
{ {
Config = _config; Config = _config;
...@@ -652,7 +652,7 @@ namespace DeviceLibrary ...@@ -652,7 +652,7 @@ namespace DeviceLibrary
/// <summary> /// <summary>
/// 料串门光栅触发处理方式 /// 料串门光栅触发处理方式
/// </summary> /// </summary>
int stringdoorSafetyProcStrategy = ConfigAppSettings.GetValue("StringDoor_SafetyLightCurtainsProcStrategy", 1, "料串门光栅触发处理方式:0-设备急停;1-仅料串门停止"); int stringdoorSafetyProcStrategy = Setting_Init.StringDoor_SafetyLightCurtainsProcStrategy;
bool SafeCheck() bool SafeCheck()
{ {
bool ok = true; bool ok = true;
......
...@@ -13,10 +13,10 @@ namespace DeviceLibrary ...@@ -13,10 +13,10 @@ namespace DeviceLibrary
{ {
public partial class MainMachine public partial class MainMachine
{ {
string serverIp = ConfigAppSettings.GetValue("AGV_ServerIp", "127.0.0.1", "AGV服务软件所在电脑IP"); string serverIp = Setting_Init.AGV_ServerIp;
int serverPort = ConfigAppSettings.GetValue("AGV_ServerPort", 12000, "AGV服务接口"); int serverPort = Setting_Init.AGV_ServerPort;
int nodeId = ConfigAppSettings.GetValue("AGV_NodeId", 1, "AGV节点编号"); int nodeId = Setting_Init.AGV_NodeId;
string nodeName = ConfigAppSettings.GetValue("AGV_NodeName", "MIMO", "AGV节点名称"); string nodeName = Setting_Init.AGV_NodeName;
Client client; Client client;
Node curNode; Node curNode;
MoveInfo AGVMoveInfo; MoveInfo AGVMoveInfo;
...@@ -39,7 +39,7 @@ namespace DeviceLibrary ...@@ -39,7 +39,7 @@ namespace DeviceLibrary
} }
public bool UseAgv() public bool UseAgv()
{ {
return ConfigAppSettings.GetValue("AGV_Enable", false, "是否启用AGV"); return Setting_Init.AGV_Enable;
} }
public void SetStatus(NodeStatus nodeStatus) public void SetStatus(NodeStatus nodeStatus)
{ {
......
...@@ -94,10 +94,10 @@ namespace DeviceLibrary ...@@ -94,10 +94,10 @@ namespace DeviceLibrary
// IsLoadOk = false; // IsLoadOk = false;
// msg += errmsg + "\r\n"; // msg += errmsg + "\r\n";
//} //}
if (!HumitureController.Init(ConfigHelper.Config.Get("Device_Humiture_Port"))) if (!HumitureController.Init(Setting_Init.Device_Humiture_Port))
{ {
IsLoadOk = false; IsLoadOk = false;
msg += crc.GetString(L.tempnhum_sensor_init_fail, $"温湿度传感器初始化失败,端口:") + $"{ConfigHelper.Config.Get("Device_Humiture_Port")}\n"; msg += crc.GetString(L.tempnhum_sensor_init_fail, $"温湿度传感器初始化失败,端口:") + $"{Setting_Init.Device_Humiture_Port}\n";
} }
//Thread.Sleep(1000); //Thread.Sleep(1000);
//if (!IOManager.ConnectionIOList(new List<string>())) //if (!IOManager.ConnectionIOList(new List<string>()))
...@@ -213,7 +213,7 @@ namespace DeviceLibrary ...@@ -213,7 +213,7 @@ namespace DeviceLibrary
reelParam = null; reelParam = null;
try try
{ {
string fix = ConfigHelper.Config.Get(Setting_Init.FixBuffInfo, ""); string fix = Setting_Init.FixBuffInfo;
if (!string.IsNullOrEmpty(fix)) if (!string.IsNullOrEmpty(fix))
{ {
reelParam = JsonHelper.DeserializeJsonToObject<ReelParam>(fix); reelParam = JsonHelper.DeserializeJsonToObject<ReelParam>(fix);
...@@ -229,11 +229,11 @@ namespace DeviceLibrary ...@@ -229,11 +229,11 @@ namespace DeviceLibrary
public static void PutReelInFixPos(ReelParam reelParam) public static void PutReelInFixPos(ReelParam reelParam)
{ {
if (mainMachine.AutoInOutTest) return; if (mainMachine.AutoInOutTest) return;
ConfigHelper.Config.Set(Setting_Init.FixBuffInfo, JsonHelper.SerializeObject(reelParam)); Setting_Init.FixBuffInfo = JsonHelper.SerializeObject(reelParam);
} }
public static void ClearReelInFixPos() public static void ClearReelInFixPos()
{ {
ConfigHelper.Config.Set(Setting_Init.FixBuffInfo, ""); Setting_Init.FixBuffInfo = "";
} }
#endregion #endregion
} }
......
...@@ -26,7 +26,7 @@ namespace TheMachine ...@@ -26,7 +26,7 @@ namespace TheMachine
crc.OpenResourceLog = true; crc.OpenResourceLog = true;
InitializeComponent(); InitializeComponent();
this.FormClosing += Form1_FormClosing; this.FormClosing += Form1_FormClosing;
this.Text = Config.Get(Setting_Init.App_Title) + " " + Config.Get("CID"); this.Text =Setting_Init.App_Title + " " + Setting_Init.CID;
crc.GetLanguageEvent += Crc_GetLanguageEvent; crc.GetLanguageEvent += Crc_GetLanguageEvent;
crc.LanguageChangeEvent += Crc_LanguageChangeEvent; crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
crc.CurrLanguage = Crc_GetLanguageEvent(); crc.CurrLanguage = Crc_GetLanguageEvent();
......
...@@ -34,7 +34,7 @@ namespace TheMachine ...@@ -34,7 +34,7 @@ namespace TheMachine
_ = new Mutex(true, Application.ProductName, out bool ret); _ = new Mutex(true, Application.ProductName, out bool ret);
if (!ret) if (!ret)
{ {
IntPtr formhwnd = FindWindow(null, Config.Get(Setting_Init.App_Title)); IntPtr formhwnd = FindWindow(null, Setting_Init.App_Title);
ShowWindow(formhwnd, SW_RESTORE); ShowWindow(formhwnd, SW_RESTORE);
SwitchToThisWindow(formhwnd, true); SwitchToThisWindow(formhwnd, true);
//MessageBox.Show("该程序已经启动", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); //MessageBox.Show("该程序已经启动", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
...@@ -54,12 +54,12 @@ namespace TheMachine ...@@ -54,12 +54,12 @@ namespace TheMachine
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{ {
LogUtil.error($"CurrentDomain_UnhandledException:" +e.ToString()); LogUtil.error($"CurrentDomain_UnhandledException:" + e.ToString());
} }
private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{ {
LogUtil.error($"Application_ThreadException:" +e.ToString()); LogUtil.error($"Application_ThreadException:" + e.ToString());
} }
......
...@@ -25,7 +25,7 @@ namespace TheMachine ...@@ -25,7 +25,7 @@ namespace TheMachine
InitializeComponent(); InitializeComponent();
RobotManage.LoadFinishEvent += RobotManage_LoadFinishEvent; RobotManage.LoadFinishEvent += RobotManage_LoadFinishEvent;
//chbAutoRun.Enabled = false; //chbAutoRun.Enabled = false;
chbAutoRun.Checked = Convert.ToBoolean(ConfigAppSettings.GetValue(Setting_Init.App_AutoRun,0, "系统启动时自动启动料仓,=1时自动启动,并隐藏窗口,=0时不需要")); chbAutoRun.Checked = Convert.ToBoolean(Setting_Init.App_AutoRun == 1);
this.chbAutoRun.CheckedChanged += new System.EventHandler(this.chbAutoRun_CheckedChanged); this.chbAutoRun.CheckedChanged += new System.EventHandler(this.chbAutoRun_CheckedChanged);
//chbAutoRun.Enabled = true; //chbAutoRun.Enabled = true;
for (int i = 0; i < 20; i++) for (int i = 0; i < 20; i++)
...@@ -80,12 +80,12 @@ namespace TheMachine ...@@ -80,12 +80,12 @@ namespace TheMachine
{ {
if (chbAutoRun.Checked) if (chbAutoRun.Checked)
{ {
ConfigAppSettings.SetValue(Setting_Init.App_AutoRun, 1); Setting_Init.App_AutoRun = 1;
AutoRun(Application.ExecutablePath, true); AutoRun(Application.ExecutablePath, true);
} }
else else
{ {
ConfigAppSettings.SetValue(Setting_Init.App_AutoRun, 0); Setting_Init.App_AutoRun = 0;
AutoRun(Application.ExecutablePath, false); AutoRun(Application.ExecutablePath, false);
} }
} }
...@@ -94,7 +94,7 @@ namespace TheMachine ...@@ -94,7 +94,7 @@ namespace TheMachine
{ {
if (RobotManage.isRunning) if (RobotManage.isRunning)
{ {
MessageBox.Show(crc.GetString(L.before_FrmPositionTool_stopmuchine,"运行库位校准程序前,需要先停止料仓的运行")); MessageBox.Show(crc.GetString(L.before_FrmPositionTool_stopmuchine, "运行库位校准程序前,需要先停止料仓的运行"));
} }
else else
{ {
...@@ -110,7 +110,7 @@ namespace TheMachine ...@@ -110,7 +110,7 @@ namespace TheMachine
private void cb_tempsensorport_SelectedIndexChanged(object sender, EventArgs e) private void cb_tempsensorport_SelectedIndexChanged(object sender, EventArgs e)
{ {
HumitureController.Init(ConfigHelper.Config.Get("Device_Humiture_Port")); HumitureController.Init(Setting_Init.Device_Humiture_Port);
} }
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
...@@ -130,7 +130,7 @@ namespace TheMachine ...@@ -130,7 +130,7 @@ namespace TheMachine
private void button1_Click_1(object sender, EventArgs e) private void button1_Click_1(object sender, EventArgs e)
{ {
Task.Run(()=>CodeManager.TestHasReel(CodeManager.hikNameList[0], out _, out _)); Task.Run(() => CodeManager.TestHasReel(CodeManager.hikNameList[0], out _, out _));
} }
//private void button2_Click(object sender, EventArgs e) //private void button2_Click(object sender, EventArgs e)
......
...@@ -303,7 +303,7 @@ namespace TheMachine ...@@ -303,7 +303,7 @@ namespace TheMachine
MessageBox.Show(crc.GetString("not_allow", "禁止") + ":\r\n" + crc.GetString("UpDownAxis_IHPosition_P3", "升降轴库位入料高点P3") + $"[{_aCStorePosition.UpDownAxis_IHPosition_P3}]" + "<" + crc.GetString("UpDownAxis_ILPosition_P4", "升降轴库位入料低点P4") + $"[{_aCStorePosition.UpDownAxis_ILPosition_P4}]"); MessageBox.Show(crc.GetString("not_allow", "禁止") + ":\r\n" + crc.GetString("UpDownAxis_IHPosition_P3", "升降轴库位入料高点P3") + $"[{_aCStorePosition.UpDownAxis_IHPosition_P3}]" + "<" + crc.GetString("UpDownAxis_ILPosition_P4", "升降轴库位入料低点P4") + $"[{_aCStorePosition.UpDownAxis_ILPosition_P4}]");
return; return;
} }
int maxDiff = ConfigAppSettings.GetValue("UpDownAxis_Position_MaxRange", 30000, "库位高低点最大相差的值"); int maxDiff = Setting_Init.UpDownAxis_Position_MaxRange;
if ((_aCStorePosition.UpDownAxis_IHPosition_P3 - _aCStorePosition.UpDownAxis_ILPosition_P4) > maxDiff) if ((_aCStorePosition.UpDownAxis_IHPosition_P3 - _aCStorePosition.UpDownAxis_ILPosition_P4) > maxDiff)
{ {
MessageBox.Show(crc.GetString("not_allow", "禁止") + ":\r\n(" MessageBox.Show(crc.GetString("not_allow", "禁止") + ":\r\n("
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!