Browse Source

创建缓存文件夹,添加参数自定义上传,处理BUG日志记录异常

章政 6 years ago
parent
commit
9deb1d4209

+ 0 - 8
PLCDataReader/Entity/DeviceStatus.cs

@@ -7,14 +7,6 @@ namespace UAS_PLCDataReader.Entity
 {
     class DeviceStatus
     {
-        private static string running;
-
-        private static string stopped;
-
-        private static string noanswer;
-
-        private static string disconnect;
-
         public static string Running
         {
             get

+ 32 - 32
PLCDataReader/Entity/User.cs

@@ -19,14 +19,14 @@ namespace UAS_PLCDataReader.Entity
         /// 用户岗位
         /// </summary>
         public static string UserPosition;//岗位 em_position
-        /// <summary>
-        /// 当前工序编号
-        /// </summary>
-        public static string CurrentStepCode;//工序 sc_stepcode
-        /// <summary>
-        /// 当前工序名称
-        /// </summary>
-        public static string CurrentStepName;//工序名称
+        ///// <summary>
+        ///// 当前工序编号
+        ///// </summary>
+        //public static string CurrentStepCode;//工序 sc_stepcode
+        ///// <summary>
+        ///// 当前工序名称
+        ///// </summary>
+        //public static string CurrentStepName;//工序名称
         /// <summary>
         /// 用户部门
         /// </summary>
@@ -39,29 +39,29 @@ namespace UAS_PLCDataReader.Entity
         /// 用户类型,admin表示超级管理员,normal表示普通用户
         /// </summary>
         public static string UserAccountType;//用户类型  em_type
-        /// <summary>
-        /// 岗位资源编号
-        /// </summary>
-        public static string UserSourceCode;//岗位资源  ur_resourecode
-        /// <summary>
-        /// 用户分组
-        /// </summary>
-        public static string UserGroup;//用户分组  ug_name
-        /// <summary>
-        ///  用户分组编码
-        /// </summary>
-        public static string UserGroupCode;//用户分组编码   ug_code
-        /// <summary>
-        /// 用户所属的线别
-        /// </summary>
-        public static string UserLineCode;
-        /// <summary>
-        /// 资源所属工作中心
-        /// </summary>
-        public static string WorkCenter;
-        /// <summary>
-        /// 默认不良组别
-        /// </summary>
-        public static string DefaultBadGroup;
+        ///// <summary>
+        ///// 岗位资源编号
+        ///// </summary>
+        //public static string UserSourceCode;//岗位资源  ur_resourecode
+        ///// <summary>
+        ///// 用户分组
+        ///// </summary>
+        //public static string UserGroup;//用户分组  ug_name
+        ///// <summary>
+        /////  用户分组编码
+        ///// </summary>
+        //public static string UserGroupCode;//用户分组编码   ug_code
+        ///// <summary>
+        ///// 用户所属的线别
+        ///// </summary>
+        //public static string UserLineCode;
+        ///// <summary>
+        ///// 资源所属工作中心
+        ///// </summary>
+        //public static string WorkCenter;
+        ///// <summary>
+        ///// 默认不良组别
+        ///// </summary>
+        //public static string DefaultBadGroup;
     }
 }

+ 1 - 1
PLCDataReader/Login.Designer.cs

@@ -123,7 +123,7 @@
             this.FormBorderEffect = DevExpress.XtraEditors.FormBorderEffect.None;
             this.Name = "Login";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = " 设备管理平台";
+            this.Text = "设备管理平台";
             this.Load += new System.EventHandler(this.Login_Load);
             ((System.ComponentModel.ISupportInitialize)(this.UserName.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.PassWord.Properties)).EndInit();

+ 76 - 21
PLCDataReader/Main.Designer.cs

@@ -209,6 +209,10 @@ namespace UAS_PLCDataReader
             this.drr_doman = new DevExpress.XtraGrid.Columns.GridColumn();
             this.drr_remark = new DevExpress.XtraGrid.Columns.GridColumn();
             this.PageClientParam = new DevExpress.XtraTab.XtraTabPage();
+            this.label2 = new System.Windows.Forms.Label();
+            this.CheckOUTQTY = new DevExpress.XtraEditors.CheckEdit();
+            this.CheckPARAM = new DevExpress.XtraEditors.CheckEdit();
+            this.CheckINQTY = new DevExpress.XtraEditors.CheckEdit();
             this.ButtonSaveClientParam = new DevExpress.XtraEditors.SimpleButton();
             this.UpdateTimeSpan = new System.Windows.Forms.NumericUpDown();
             this.label1 = new System.Windows.Forms.Label();
@@ -285,6 +289,9 @@ namespace UAS_PLCDataReader
             ((System.ComponentModel.ISupportInitialize)(this.GridDeviceRunLog)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GirdViewDeviceRunLog)).BeginInit();
             this.PageClientParam.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.CheckOUTQTY.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.CheckPARAM.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.CheckINQTY.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.UpdateTimeSpan)).BeginInit();
             this.PageDeviceData.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.GridDeviceData)).BeginInit();
@@ -942,7 +949,7 @@ namespace UAS_PLCDataReader
             this.PageCommandSet.Controls.Add(this.GridCommandSetting);
             this.PageCommandSet.Name = "PageCommandSet";
             this.PageCommandSet.PageVisible = false;
-            this.PageCommandSet.Size = new System.Drawing.Size(1034, 454);
+            this.PageCommandSet.Size = new System.Drawing.Size(1034, 578);
             this.PageCommandSet.Text = "设备指令设置";
             this.PageCommandSet.VisibleChanged += new System.EventHandler(this.PageCommandSet_VisibleChanged);
             // 
@@ -1019,7 +1026,7 @@ namespace UAS_PLCDataReader
             this.CommandSetRepositoryItemComboBox1,
             this.repositoryItemDateEdit1});
             this.GridCommandSetting.RowCount = 0;
-            this.GridCommandSetting.Size = new System.Drawing.Size(1034, 423);
+            this.GridCommandSetting.Size = new System.Drawing.Size(1034, 547);
             this.GridCommandSetting.TabIndex = 1;
             this.GridCommandSetting.TableName = null;
             this.GridCommandSetting.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -1193,7 +1200,7 @@ namespace UAS_PLCDataReader
             this.PageDeviceNetSetting.Controls.Add(this.GridDeviceNetSetting);
             this.PageDeviceNetSetting.Name = "PageDeviceNetSetting";
             this.PageDeviceNetSetting.PageVisible = false;
-            this.PageDeviceNetSetting.Size = new System.Drawing.Size(1034, 454);
+            this.PageDeviceNetSetting.Size = new System.Drawing.Size(1034, 578);
             this.PageDeviceNetSetting.Text = "设备网络配置";
             // 
             // ButtonDeleteNetConfig
@@ -1243,7 +1250,7 @@ namespace UAS_PLCDataReader
             this.GridDeviceNetSetting.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
             this.dpc_enableCheckEdit});
             this.GridDeviceNetSetting.RowCount = 0;
-            this.GridDeviceNetSetting.Size = new System.Drawing.Size(1031, 420);
+            this.GridDeviceNetSetting.Size = new System.Drawing.Size(1031, 544);
             this.GridDeviceNetSetting.TabIndex = 0;
             this.GridDeviceNetSetting.TableName = null;
             this.GridDeviceNetSetting.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -1353,7 +1360,7 @@ namespace UAS_PLCDataReader
             this.PagePollingSetting.Controls.Add(this.GridPollingSetting);
             this.PagePollingSetting.Name = "PagePollingSetting";
             this.PagePollingSetting.PageVisible = false;
-            this.PagePollingSetting.Size = new System.Drawing.Size(1034, 454);
+            this.PagePollingSetting.Size = new System.Drawing.Size(1034, 578);
             this.PagePollingSetting.Text = "设备轮询配置";
             this.PagePollingSetting.VisibleChanged += new System.EventHandler(this.PagePollingSetting_VisibleChanged);
             // 
@@ -1428,7 +1435,7 @@ namespace UAS_PLCDataReader
             this.PollSettingItemSearchLookUpEdit,
             this.PollSettingDeviceSearchLookUpEdit});
             this.GridPollingSetting.RowCount = 0;
-            this.GridPollingSetting.Size = new System.Drawing.Size(1034, 420);
+            this.GridPollingSetting.Size = new System.Drawing.Size(1034, 544);
             this.GridPollingSetting.TabIndex = 0;
             this.GridPollingSetting.TableName = null;
             this.GridPollingSetting.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -1650,14 +1657,14 @@ namespace UAS_PLCDataReader
             this.PagePolling.Controls.Add(this.GridPolling);
             this.PagePolling.Name = "PagePolling";
             this.PagePolling.PageVisible = false;
-            this.PagePolling.Size = new System.Drawing.Size(1034, 454);
+            this.PagePolling.Size = new System.Drawing.Size(1034, 578);
             this.PagePolling.Text = "xtraTabPage1";
             // 
             // ButtonAddPolling
             // 
             this.ButtonAddPolling.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.ButtonAddPolling.Grid = null;
-            this.ButtonAddPolling.Location = new System.Drawing.Point(885, 428);
+            this.ButtonAddPolling.Location = new System.Drawing.Point(885, 552);
             this.ButtonAddPolling.Name = "ButtonAddPolling";
             this.ButtonAddPolling.Size = new System.Drawing.Size(64, 23);
             this.ButtonAddPolling.TabIndex = 9;
@@ -1667,7 +1674,7 @@ namespace UAS_PLCDataReader
             // 
             this.ButtonDeletePolling.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.ButtonDeletePolling.Grid = null;
-            this.ButtonDeletePolling.Location = new System.Drawing.Point(814, 428);
+            this.ButtonDeletePolling.Location = new System.Drawing.Point(814, 552);
             this.ButtonDeletePolling.Name = "ButtonDeletePolling";
             this.ButtonDeletePolling.Size = new System.Drawing.Size(64, 23);
             this.ButtonDeletePolling.TabIndex = 8;
@@ -1678,7 +1685,7 @@ namespace UAS_PLCDataReader
             this.ButtonSavePolling.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.ButtonSavePolling.Grid = null;
             this.ButtonSavePolling.HandlerOtherFirst = false;
-            this.ButtonSavePolling.Location = new System.Drawing.Point(956, 428);
+            this.ButtonSavePolling.Location = new System.Drawing.Point(956, 552);
             this.ButtonSavePolling.Name = "ButtonSavePolling";
             this.ButtonSavePolling.Size = new System.Drawing.Size(64, 23);
             this.ButtonSavePolling.TabIndex = 7;
@@ -1700,7 +1707,7 @@ namespace UAS_PLCDataReader
             this.GridPolling.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
             this.dpc_enableCheckEdit});
             this.GridPolling.RowCount = 0;
-            this.GridPolling.Size = new System.Drawing.Size(1034, 426);
+            this.GridPolling.Size = new System.Drawing.Size(1034, 550);
             this.GridPolling.TabIndex = 0;
             this.GridPolling.TableName = null;
             this.GridPolling.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -1793,7 +1800,7 @@ namespace UAS_PLCDataReader
             this.PageDeviceStatus.Controls.Add(this.PanelDeviceStatus);
             this.PageDeviceStatus.Name = "PageDeviceStatus";
             this.PageDeviceStatus.PageVisible = false;
-            this.PageDeviceStatus.Size = new System.Drawing.Size(1034, 454);
+            this.PageDeviceStatus.Size = new System.Drawing.Size(1034, 578);
             this.PageDeviceStatus.Text = "设备状态查看";
             this.PageDeviceStatus.VisibleChanged += new System.EventHandler(this.PageDeviceStatus_VisibleChanged);
             // 
@@ -1908,7 +1915,7 @@ namespace UAS_PLCDataReader
             | System.Windows.Forms.AnchorStyles.Right)));
             this.PanelDeviceStatus.Location = new System.Drawing.Point(0, 35);
             this.PanelDeviceStatus.Name = "PanelDeviceStatus";
-            this.PanelDeviceStatus.Size = new System.Drawing.Size(1034, 419);
+            this.PanelDeviceStatus.Size = new System.Drawing.Size(1034, 543);
             this.PanelDeviceStatus.TabIndex = 0;
             // 
             // PageWorkCenterStatus
@@ -1916,7 +1923,7 @@ namespace UAS_PLCDataReader
             this.PageWorkCenterStatus.Controls.Add(this.GridWorkCenterStatus);
             this.PageWorkCenterStatus.Name = "PageWorkCenterStatus";
             this.PageWorkCenterStatus.PageVisible = false;
-            this.PageWorkCenterStatus.Size = new System.Drawing.Size(1034, 454);
+            this.PageWorkCenterStatus.Size = new System.Drawing.Size(1034, 578);
             this.PageWorkCenterStatus.Text = "设备工作中心";
             // 
             // GridWorkCenterStatus
@@ -1933,7 +1940,7 @@ namespace UAS_PLCDataReader
             this.GridWorkCenterStatus.MenuManager = this.RibbonNav;
             this.GridWorkCenterStatus.Name = "GridWorkCenterStatus";
             this.GridWorkCenterStatus.RowCount = 0;
-            this.GridWorkCenterStatus.Size = new System.Drawing.Size(1031, 451);
+            this.GridWorkCenterStatus.Size = new System.Drawing.Size(1031, 575);
             this.GridWorkCenterStatus.TabIndex = 0;
             this.GridWorkCenterStatus.TableName = null;
             this.GridWorkCenterStatus.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -1954,7 +1961,7 @@ namespace UAS_PLCDataReader
             this.PageDeviceRunLog.Controls.Add(this.GridDeviceRunLog);
             this.PageDeviceRunLog.Name = "PageDeviceRunLog";
             this.PageDeviceRunLog.PageVisible = false;
-            this.PageDeviceRunLog.Size = new System.Drawing.Size(1034, 454);
+            this.PageDeviceRunLog.Size = new System.Drawing.Size(1034, 578);
             this.PageDeviceRunLog.Text = "设备运行日志";
             // 
             // ButtonSearchDeviceRunLog
@@ -1997,7 +2004,7 @@ namespace UAS_PLCDataReader
             this.GridDeviceRunLog.MenuManager = this.RibbonNav;
             this.GridDeviceRunLog.Name = "GridDeviceRunLog";
             this.GridDeviceRunLog.RowCount = 0;
-            this.GridDeviceRunLog.Size = new System.Drawing.Size(1035, 430);
+            this.GridDeviceRunLog.Size = new System.Drawing.Size(1035, 554);
             this.GridDeviceRunLog.TabIndex = 0;
             this.GridDeviceRunLog.TableName = null;
             this.GridDeviceRunLog.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -2098,18 +2105,59 @@ namespace UAS_PLCDataReader
             // 
             // PageClientParam
             // 
+            this.PageClientParam.Controls.Add(this.label2);
+            this.PageClientParam.Controls.Add(this.CheckOUTQTY);
+            this.PageClientParam.Controls.Add(this.CheckPARAM);
+            this.PageClientParam.Controls.Add(this.CheckINQTY);
             this.PageClientParam.Controls.Add(this.ButtonSaveClientParam);
             this.PageClientParam.Controls.Add(this.UpdateTimeSpan);
             this.PageClientParam.Controls.Add(this.label1);
             this.PageClientParam.Name = "PageClientParam";
             this.PageClientParam.PageVisible = false;
-            this.PageClientParam.Size = new System.Drawing.Size(1034, 454);
+            this.PageClientParam.Size = new System.Drawing.Size(1034, 578);
             this.PageClientParam.Text = "客户端参数设置";
             this.PageClientParam.VisibleChanged += new System.EventHandler(this.PageClientParam_VisibleChanged);
             // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label2.Location = new System.Drawing.Point(28, 78);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(106, 21);
+            this.label2.TabIndex = 6;
+            this.label2.Text = "立即更新参数";
+            // 
+            // CheckOUTQTY
+            // 
+            this.CheckOUTQTY.Location = new System.Drawing.Point(221, 80);
+            this.CheckOUTQTY.MenuManager = this.RibbonNav;
+            this.CheckOUTQTY.Name = "CheckOUTQTY";
+            this.CheckOUTQTY.Properties.Caption = "产出";
+            this.CheckOUTQTY.Size = new System.Drawing.Size(75, 19);
+            this.CheckOUTQTY.TabIndex = 5;
+            // 
+            // CheckPARAM
+            // 
+            this.CheckPARAM.Location = new System.Drawing.Point(302, 80);
+            this.CheckPARAM.MenuManager = this.RibbonNav;
+            this.CheckPARAM.Name = "CheckPARAM";
+            this.CheckPARAM.Properties.Caption = "其他参数";
+            this.CheckPARAM.Size = new System.Drawing.Size(75, 19);
+            this.CheckPARAM.TabIndex = 4;
+            // 
+            // CheckINQTY
+            // 
+            this.CheckINQTY.Location = new System.Drawing.Point(140, 80);
+            this.CheckINQTY.MenuManager = this.RibbonNav;
+            this.CheckINQTY.Name = "CheckINQTY";
+            this.CheckINQTY.Properties.Caption = "投入";
+            this.CheckINQTY.Size = new System.Drawing.Size(75, 19);
+            this.CheckINQTY.TabIndex = 3;
+            // 
             // ButtonSaveClientParam
             // 
-            this.ButtonSaveClientParam.Location = new System.Drawing.Point(140, 122);
+            this.ButtonSaveClientParam.Location = new System.Drawing.Point(140, 129);
             this.ButtonSaveClientParam.Name = "ButtonSaveClientParam";
             this.ButtonSaveClientParam.Size = new System.Drawing.Size(64, 23);
             this.ButtonSaveClientParam.TabIndex = 2;
@@ -2139,7 +2187,7 @@ namespace UAS_PLCDataReader
             this.PageDeviceData.Controls.Add(this.GridDeviceData);
             this.PageDeviceData.Name = "PageDeviceData";
             this.PageDeviceData.PageVisible = false;
-            this.PageDeviceData.Size = new System.Drawing.Size(1034, 454);
+            this.PageDeviceData.Size = new System.Drawing.Size(1034, 578);
             this.PageDeviceData.Text = "设备运行数据";
             // 
             // ButtonRefreshDeviceData
@@ -2167,7 +2215,7 @@ namespace UAS_PLCDataReader
             this.GridDeviceData.MenuManager = this.RibbonNav;
             this.GridDeviceData.Name = "GridDeviceData";
             this.GridDeviceData.RowCount = 0;
-            this.GridDeviceData.Size = new System.Drawing.Size(1034, 422);
+            this.GridDeviceData.Size = new System.Drawing.Size(1034, 546);
             this.GridDeviceData.TabIndex = 0;
             this.GridDeviceData.TableName = null;
             this.GridDeviceData.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -2412,6 +2460,9 @@ namespace UAS_PLCDataReader
             ((System.ComponentModel.ISupportInitialize)(this.GirdViewDeviceRunLog)).EndInit();
             this.PageClientParam.ResumeLayout(false);
             this.PageClientParam.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.CheckOUTQTY.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.CheckPARAM.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.CheckINQTY.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.UpdateTimeSpan)).EndInit();
             this.PageDeviceData.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.GridDeviceData)).EndInit();
@@ -2623,5 +2674,9 @@ namespace UAS_PLCDataReader
         private DevExpress.XtraGrid.Columns.GridColumn dr_value9;
         private DevExpress.XtraGrid.Columns.GridColumn dr_value10;
         private CustomerControl.Button.ButtonDeleteRow ButtonRefreshDeviceData;
+        private System.Windows.Forms.Label label2;
+        private CheckEdit CheckOUTQTY;
+        private CheckEdit CheckPARAM;
+        private CheckEdit CheckINQTY;
     }
 }

+ 24 - 0
PLCDataReader/Main.cs

@@ -161,6 +161,12 @@ namespace UAS_PLCDataReader
             e.Handled = true;
         }
 
+        public static string inqty = BaseUtil.GetCacheData("INQTY").ToString();
+
+        public static string outqty = BaseUtil.GetCacheData("OUTQTY").ToString();
+
+        public static string param = BaseUtil.GetCacheData("PARAM").ToString();
+
         private void Main_Load(object sender, EventArgs e)
         {
             //设备列表
@@ -991,6 +997,21 @@ namespace UAS_PLCDataReader
         private void ButtonSaveClientParam_Click(object sender, EventArgs e)
         {
             BaseUtil.SetCacheData("UpdateTime", UpdateTimeSpan.Value);
+            if (CheckINQTY.Checked)
+            {
+                BaseUtil.SetCacheData("INQTY", -1); inqty = "-1";
+            }
+            else { BaseUtil.SetCacheData("INQTY", 0); inqty = "0"; }
+            if (CheckOUTQTY.Checked)
+            {
+                BaseUtil.SetCacheData("OUTQTY", -1); outqty = "-1";
+            }
+            else { BaseUtil.SetCacheData("OUTQTY", 0); outqty = "0"; }
+            if (CheckPARAM.Checked)
+            {
+                BaseUtil.SetCacheData("PARAM", -1); param = "-1";
+            }
+            else { BaseUtil.SetCacheData("PARAM", 0); param = "0"; }
             XtraMessageBox.Show("保存成功!");
         }
 
@@ -998,6 +1019,9 @@ namespace UAS_PLCDataReader
         {
             if (PageClientParam.PageVisible)
             {
+                if (inqty == "-1") { CheckINQTY.Checked = true; }
+                if (outqty == "-1") { CheckOUTQTY.Checked = true; }
+                if (param == "-1") { CheckPARAM.Checked = true; }
                 decimal time = 0;
                 if (decimal.TryParse(BaseUtil.GetCacheData("UpdateTime").ToString(), out time))
                 {

+ 2 - 0
PLCDataReader/Program.cs

@@ -42,6 +42,8 @@ namespace UAS_PLCDataReader
                 FileStream fs = new FileStream(LogManager.LogAddress + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
                 fs.Close();
                 DevExpress.Skins.SkinManager.EnableFormSkins();
+                if (!Directory.Exists(SystemInf.CacheFolder))
+                    Directory.CreateDirectory(SystemInf.CacheFolder);
                 FileStream fcaches = new FileStream(SystemInf.CacheFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite);
                 fcaches.Close();
                 //判断是否xml文件大小为0

+ 1 - 1
PLCDataReader/PublicMethod/BaseUtil.cs

@@ -223,7 +223,7 @@ namespace UAS_PLCDataReader.PublicMethod
             foreach (var item in B)
             {
                 //不对比产量和产出
-                if (A.ContainsKey(item.Key) && item.Key != "INQTY" && item.Key != "OUTQTY")
+                if (A.ContainsKey(item.Key) && (Main.inqty == "-1" || Main.outqty == "-1" || Main.param == "-1"))
                 {
                     if (A[item.Key] != item.Value)
                     {

+ 1 - 1
PLCDataReader/PublicMethod/LogicHandler.cs

@@ -273,7 +273,7 @@ namespace UAS_PLCDataReader.PublicMethod
             {
                 sql.Clear();
                 sql.Append("insert into DeviceRunRecord(drr_id,drr_decode,drr_dename,drr_date,drr_doman,drr_remark,drr_logstatus,drr_type)");
-                sql.Append("values(DeviceRunRecord_seq.nextval,'" + iDecode + "','" + iDename + "',sysdate,'" + User.UserName + "','" + iErrMessage + "','" + iDestatus + "'," + iType + ")");
+                sql.Append("values(DeviceRunRecord_seq.nextval,'" + iDecode + "','" + iDename + "',sysdate,'" + User.UserName + "','" + iErrMessage.Replace("'", "") + "','" + iDestatus + "'," + iType + ")");
                 Main.QueueUpdateDevice.Enqueue(sql.ToString());
             }
         }