Prechádzať zdrojové kódy

AGV禁用启用产线

xu.lu 3 rokov pred
rodič
commit
7a9ed0c572

+ 1 - 0
WCS_Client/Frm/FrmMain.cs

@@ -132,6 +132,7 @@ namespace WCS_Client
                 AddMenu("MBtn_Sys", "MBtn_Interface_OPOrder", "日志管理", typeof(Frm.FrmLog), Btn_Click);
                 //AddMenu("MBtn_Sys", "MBtn_Interface_OPUP", "系统设置", typeof(Frm.MBtn_Sys.FormSet), Btn_Click);
                 AddMenu("MBtn_Sys", "MBtn_Interface_SrmInfoSet", "系统设置", typeof(Frm.FrmSrmInfoSet), Btn_Click);
+                AddMenu("MBtn_Sys", "MBtn_Interface_FrmAGVSet", "AGV设置(车间设置)", typeof(Frm.FrmAGVSet), Btn_Click);
             }
             catch (Exception ex)
             {

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 430 - 431
WCS_Client/Frm/MBtn_Monitor/Frm_YongGuanMontior.Designer.cs


+ 99 - 99
WCS_Client/Frm/MBtn_Monitor/Frm_YongGuanMontior.cs

@@ -140,8 +140,8 @@ namespace WCS_Client.Frm
             {
                 try
                 {
-                    Current.RefreshData(true);
-                    var listDDJ = BaseWorkflow.QueryStackerdDataDDJ(_plcnameSet);
+                    //Current.RefreshData(true);
+                    //var listDDJ = BaseWorkflow.QueryStackerdDataDDJ(_plcnameSet);
                     ShowData();
                 }
                 catch (Exception ex)
@@ -418,54 +418,102 @@ namespace WCS_Client.Frm
                             //}
                         }
                         #region condition
-                        //else if (control is Conveyor_L)
-                        //{
-                        //    var con = (Conveyor_L)control;
-                        //    con.button1.Text = item.Code.ToString();
-                        //    if (item.D523Alarm != 0) con.BackColor = Color.Red;
-                        //    else if (item.D523.Status == 0) con.BackColor = Color.Yellow;
-                        //    else con.BackColor = Color.FromArgb(0, 144, 154);
-                        //    if (item.D521.PH_STATUS == true)
-                        //    {
-                        //        if (con.button1.Tag.ToString() != "pall")
-                        //        {
-                        //            con.button1.BackgroundImage = Image.FromFile("Resources/Conveyor_L.png");//1009L11.png
-                        //            con.button1.Tag = "pall";
-                        //        }
-                        //    }
-                        //    else
-                        //    {
-                        //        if (con.button1.Tag.ToString() != "empty")
-                        //        {
-                        //            con.button1.BackgroundImage = Image.FromFile("Resources/1009L11.png");//1009L11.png
-                        //            con.button1.Tag = "empty";
-                        //        }
-                        //    }
-                        //}
-                        //else if (control is Conveyor_R)
-                        //{
-                        //    var con = (Conveyor_R)control;
-                        //    con.button1.Text = item.Code.ToString();
-                        //    if (item.D523.Fault != 0) con.BackColor = Color.Red;
-                        //    else if (item.D523.Status == 0) con.BackColor = Color.Yellow;
-                        //    else con.BackColor = Color.FromArgb(0, 144, 154);
-                        //    if (item.D521.PH_STATUS == true)
-                        //    {
-                        //        if (con.button1.Tag.ToString() != "pall")
-                        //        {
-                        //            con.button1.BackgroundImage = Image.FromFile("Resources/Conveyor_R.png");//1009L1.png
-                        //            con.button1.Tag = "pall";
-                        //        }
-                        //    }
-                        //    else
-                        //    {
-                        //        if (con.button1.Tag.ToString() != "empty")
-                        //        {
-                        //            con.button1.BackgroundImage = Image.FromFile("Resources/1009L1.png");//1009L1.png
-                        //            con.button1.Tag = "empty";
-                        //        }
-                        //    }
-                        //}
+                        else if (control is Conveyor_L)
+                        {
+                            var con = (Conveyor_L)control;
+                            con.button1.Text = item.Code.ToString();
+                            if (item.D523.Alarm != 0) con.BackColor = Color.Red;
+                            //else if (item.D523.Status == 0) con.BackColor = Color.Yellow;
+                            //else con.BackColor = Color.FromArgb(0, 144, 154);
+                            //if (item.D521.PH_STATUS == true)
+                            //{
+                            //    if (con.button1.Tag.ToString() != "pall")
+                            //    {
+                            //        con.button1.BackgroundImage = Image.FromFile("Resources/Conveyor_L.png");//1009L11.png
+                            //        con.button1.Tag = "pall";
+                            //    }
+                            //}
+                            else
+                            {
+                                if (con.button1.Tag.ToString() != "empty")
+                                {
+                                    con.button1.BackgroundImage = Image.FromFile("Resources/1009L11.png");//1009L11.png
+                                    con.button1.Tag = "empty";
+                                }
+                            }
+                        }
+                        else if (control is Conveyor_R)
+                        {
+                            var con = (Conveyor_R)control;
+                            con.button1.Text = item.Code.ToString();
+                            if (item.D523.Alarm != 0) con.BackColor = Color.Red;
+                            //else if (item.D523.Status == 0) con.BackColor = Color.Yellow;
+                            //else con.BackColor = Color.FromArgb(0, 144, 154);
+                            //if (item.D521.PH_STATUS == true)
+                            //{
+                            //    if (con.button1.Tag.ToString() != "pall")
+                            //    {
+                            //        con.button1.BackgroundImage = Image.FromFile("Resources/Conveyor_R.png");//1009L1.png
+                            //        con.button1.Tag = "pall";
+                            //    }
+                            //}
+                            else
+                            {
+                                if (con.button1.Tag.ToString() != "empty")
+                                {
+                                    con.button1.BackgroundImage = Image.FromFile("Resources/1009L1.png");//1009L1.png
+                                    con.button1.Tag = "empty";
+                                }
+                            }
+                        }
+                        else if (control is Conveyor3_A)
+                        {
+                            var con = (Conveyor3_A)control;
+                            con.button1.Text = item.Code.ToString();
+                            if (item.D523.Alarm != 0) con.BackColor = Color.Red;
+                            //else if (item.D523.Status == 0) con.BackColor = Color.Yellow;
+                            //else con.BackColor = Color.FromArgb(0, 144, 154);
+                            //if (item.D521.PH_STATUS == true)
+                            //{
+                            //    if (con.button1.Tag.ToString() != "pall")
+                            //    {
+                            //        con.button1.BackgroundImage = Image.FromFile("Resources/Conveyor3_A_Box.png");//Conveyor3_A_Box.png
+                            //        con.button1.Tag = "pall";
+                            //    }
+                            //}
+                            else
+                            {
+                                if (con.button1.Tag.ToString() != "empty")
+                                {
+                                    con.button1.BackgroundImage = Image.FromFile("Resources/1009_A.png");//1009_A.png
+                                    con.button1.Tag = "empty";
+                                }
+                            }
+                        }
+                        else if (control is Conveyor3_B)
+                        {
+                            var con = (Conveyor3_B)control;
+                            con.button1.Text = item.Code.ToString();
+                            if (item.D523.Alarm != 0) con.BackColor = Color.Red;
+                            //else if (item.D523.Status == 0) con.BackColor = Color.Yellow;
+                            //else con.BackColor = Color.FromArgb(0, 144, 154);
+                            //if (item.D521.PH_STATUS == true)
+                            //{
+                            //    if (con.button1.Tag.ToString() != "pall")
+                            //    {
+                            //        con.button1.BackgroundImage = Image.FromFile("Resources/1009R1_B.png");//1009R1_A.png
+                            //        con.button1.Tag = "pall";
+                            //    }
+                            //}
+                            else
+                            {
+                                if (con.button1.Tag.ToString() != "empty")
+                                {
+                                    con.button1.BackgroundImage = Image.FromFile("Resources/1009R1.png");//1009R1.png
+                                    con.button1.Tag = "empty";
+                                }
+                            }
+                        }
                         //else if (control is Conveyor4_L_R)
                         //{
                         //    var con = (Conveyor4_L_R)control;
@@ -513,55 +561,7 @@ namespace WCS_Client.Frm
                         //            con.button1.Tag = "empty";
                         //        }
                         //    }
-                        //}
-                        //else if (control is Conveyor3_A)
-                        //{
-                        //    var con = (Conveyor3_A)control;
-                        //    con.button1.Text = item.Code.ToString();
-                        //    if (item.D523.Fault != 0) con.BackColor = Color.Red;
-                        //    else if (item.D523.Status == 0) con.BackColor = Color.Yellow;
-                        //    else con.BackColor = Color.FromArgb(0, 144, 154);
-                        //    if (item.D521.PH_STATUS == true)
-                        //    {
-                        //        if (con.button1.Tag.ToString() != "pall")
-                        //        {
-                        //            con.button1.BackgroundImage = Image.FromFile("Resources/Conveyor3_A_Box.png");//Conveyor3_A_Box.png
-                        //            con.button1.Tag = "pall";
-                        //        }
-                        //    }
-                        //    else
-                        //    {
-                        //        if (con.button1.Tag.ToString() != "empty")
-                        //        {
-                        //            con.button1.BackgroundImage = Image.FromFile("Resources/1009_A.png");//1009_A.png
-                        //            con.button1.Tag = "empty";
-                        //        }
-                        //    }
-                        //}
-                        //else if (control is Conveyor3_B)
-                        //{
-                        //    var con = (Conveyor3_B)control;
-                        //    con.button1.Text = item.Code.ToString();
-                        //    if (item.D523.Fault != 0) con.BackColor = Color.Red;
-                        //    else if (item.D523.Status == 0) con.BackColor = Color.Yellow;
-                        //    else con.BackColor = Color.FromArgb(0, 144, 154);
-                        //    if (item.D521.PH_STATUS == true)
-                        //    {
-                        //        if (con.button1.Tag.ToString() != "pall")
-                        //        {
-                        //            con.button1.BackgroundImage = Image.FromFile("Resources/1009R1_B.png");//1009R1_A.png
-                        //            con.button1.Tag = "pall";
-                        //        }
-                        //    }
-                        //    else
-                        //    {
-                        //        if (con.button1.Tag.ToString() != "empty")
-                        //        {
-                        //            con.button1.BackgroundImage = Image.FromFile("Resources/1009R1.png");//1009R1.png
-                        //            con.button1.Tag = "empty";
-                        //        }
-                        //    }
-                        //}
+                        //}                       
                         //else if (control is Conveyor4_left)
                         //{
                         //    var con = (Conveyor4_left)control;

+ 59 - 0
WCS_Client/Frm/MBtn_Sys/FrmAGVSet.Designer.cs

@@ -0,0 +1,59 @@
+namespace WCS_Client.Frm
+{
+    partial class FrmAGVSet
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.uC_QueryPage1 = new WCS_Client.UC.UC_QueryPage();
+            this.SuspendLayout();
+            // 
+            // uC_QueryPage1
+            // 
+            this.uC_QueryPage1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.uC_QueryPage1.Location = new System.Drawing.Point(0, 0);
+            this.uC_QueryPage1.Margin = new System.Windows.Forms.Padding(0);
+            this.uC_QueryPage1.Name = "uC_QueryPage1";
+            this.uC_QueryPage1.Size = new System.Drawing.Size(1477, 841);
+            this.uC_QueryPage1.TabIndex = 0;
+            // 
+            // FrmAGVSet
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1477, 841);
+            this.Controls.Add(this.uC_QueryPage1);
+            this.Name = "FrmAGVSet";
+            this.Text = "FrmAGVSet";
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private UC.UC_QueryPage uC_QueryPage1;
+    }
+}

+ 160 - 0
WCS_Client/Frm/MBtn_Sys/FrmAGVSet.cs

@@ -0,0 +1,160 @@
+using DevComponents.DotNetBar.Layout;
+using DevComponents.DotNetBar.SuperGrid;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using WCS_Client.UC;
+using WCS_Client.Utility;
+using WCS_Client.Workflow;
+
+namespace WCS_Client.Frm
+{
+    public partial class FrmAGVSet : Form
+    {
+        public FrmAGVSet()
+        {
+            InitializeComponent();
+            InitFrm();
+        }
+
+        private void InitFrm()
+        {
+            List<GridColumn> GCList = new List<GridColumn>()
+            {
+                SuperGridUtil.Get_GridColumn("WORKSHOP", "车间", 120),
+                SuperGridUtil.Get_GridColumn("POSITION", "产线", 120),
+                SuperGridUtil.Get_CheckBoxX_GridColumn("INENABLE", "入库启用", 100),
+                SuperGridUtil.Get_CheckBoxX_GridColumn("OUTENABLE", "出库启用", 120),
+            };
+            List<LayoutControlItem> LCIList = new List<LayoutControlItem>();
+            LCIList.Add(LCItemUtil.Add_TextboxX("WORKSHOP", "车间:", 20, SubmitMethods, null));
+            LCIList[LCIList.Count - 1].Tag = new LCWhereInfo() { QWhereText = "WORKSHOP like '%{0}%'" };
+
+            LCIList.Add(LCItemUtil.Add_ButtonX("btn_QDB", "查询", 80, 30, SubmitMethods));
+            LCIList.Add(LCItemUtil.Add_ButtonX("btn_QClear", "重置", 80, 30, SubmitMethods));
+            if (CurrentHelper.User.Use_RoleId == 1)
+            {
+                LCIList.Add(LCItemUtil.Add_Button("btn_InEnable", "入库启用", 80, 30, DevComponents.DotNetBar.eButtonColor.BlueWithBackground, SubmitMethods));
+                LCIList.Add(LCItemUtil.Add_Button("btn_OutEnable", "出库启用", 80, 30, DevComponents.DotNetBar.eButtonColor.BlueWithBackground, SubmitMethods));
+                LCIList.Add(LCItemUtil.Add_Button("btn_InStop", "入库停用", 80, 30, DevComponents.DotNetBar.eButtonColor.MagentaWithBackground, SubmitMethods));
+                LCIList.Add(LCItemUtil.Add_Button("btn_OutStop", "出库停用", 80, 30, DevComponents.DotNetBar.eButtonColor.MagentaWithBackground, SubmitMethods));
+            }
+            uC_QueryPage1.Init_QueryPage(30, true, true, "", GCList, LCIList, QueryPageDataMethods, RefreshRoleMethods, DoubleClikMethod, null, null);
+            uC_QueryPage1.ClearLCItemValue();
+            CommonShow.ShowProcessing("正在处理中,请稍候...", this, (obj) =>
+            {
+                uC_QueryPage1.RefreshData(1, 0);
+            }, null);
+        }
+        private PageData QueryPageDataMethods(int PageIndex, int PageSize)
+        {
+            string _SQLText = @"SELECT * FROM [WCS_OPP].[dbo].[WCS_AGV_Config]  where 1=1 ";
+            string _Orderby = "WORKSHOP asc";
+
+            PageData pd = BaseWorkflow.QueryPageData(_SQLText, _Orderby, uC_QueryPage1.GetQueryWhere(), PageIndex, PageSize);
+            return pd;
+        }
+        private void RefreshRoleMethods(bool ChkValue)
+        {
+
+        }
+        private void DoubleClikMethod(DataRow dr)
+        {
+            //wcs_task_no = Convert.ToInt32(dr["TASK_NO"].ToString());
+            //FrmWCS_TaskDIS_DTL Frm = new FrmWCS_TaskDIS_DTL(wcs_task_no);
+            //Frm.Show();
+        }
+        private void SubmitMethods(string LCName)
+        {
+            if (LCName == "btn_QDB")
+            {
+                uC_QueryPage1.RefreshData();
+            }
+            else if (LCName == "btn_QClear")
+            {
+                uC_QueryPage1.ShowOpaqueLayer();
+                uC_QueryPage1.ClearLCItemValue();
+                uC_QueryPage1.RefreshData(1, 0);
+                uC_QueryPage1.HideOpaqueLayer();
+            }
+            else if (LCName == "btn_InEnable")
+            {
+                DataTable dt = this.uC_QueryPage1.SCGrid_GetChkRows();
+                if (dt == null || dt.Rows.Count == 0)
+                {
+                    MessageUtil.ShowTips("请选择配置信息。");
+                    return;
+                }
+                string proLine = dt.Rows[0]["POSITION"].ToString();
+                int convNo1 = (int)dt.Rows[0]["ID"];
+                var result = MessageUtil.ShowYesNoAndWarning(string.Format("[{0}]产线确定要启用入库功能吗?", proLine));
+                if (result == DialogResult.Yes)
+                {
+                    string msg = SystemConfigWorkflow.AgvSet(proLine, true, LCName);
+                    MessageUtil.ShowTips(msg);
+                    uC_QueryPage1.RefreshData(1, 0);
+                }
+            }
+            else if (LCName == "btn_InStop")
+            {
+                DataTable dt = this.uC_QueryPage1.SCGrid_GetChkRows();
+                if (dt == null || dt.Rows.Count == 0)
+                {
+                    MessageUtil.ShowTips("请选择配置信息。");
+                    return;
+                }
+                //int convNo = (int)dt.Rows[0]["WORKSHOP"];
+                string proLine = dt.Rows[0]["POSITION"].ToString();
+                var result = MessageUtil.ShowYesNoAndWarning(string.Format("[{0}]产线确定要禁用入库功能吗?", proLine));
+                if (result == DialogResult.Yes)
+                {
+                    string msg = SystemConfigWorkflow.AgvSet(proLine, false, LCName);
+                    MessageUtil.ShowTips(msg);
+                    uC_QueryPage1.RefreshData(1, 0);
+                }
+            }
+            else if (LCName == "btn_OutEnable")
+            {
+                DataTable dt = this.uC_QueryPage1.SCGrid_GetChkRows();
+                if (dt == null || dt.Rows.Count == 0)
+                {
+                    MessageUtil.ShowTips("请选择配置信息。");
+                    return;
+                }
+                //int convNo = (int)dt.Rows[0]["WORKSHOP"];
+                string proLine = dt.Rows[0]["POSITION"].ToString();
+                var result = MessageUtil.ShowYesNoAndWarning(string.Format("[{0}]号车间确定要启用出库功能吗?", proLine));
+                if (result == DialogResult.Yes)
+                {
+                    string msg = SystemConfigWorkflow.AgvSet(proLine, true, LCName);
+                    MessageUtil.ShowTips(msg);
+                    uC_QueryPage1.RefreshData(1, 0);
+                }
+            }
+            else if (LCName == "btn_OutStop")
+            {
+                DataTable dt = this.uC_QueryPage1.SCGrid_GetChkRows();
+                if (dt == null || dt.Rows.Count == 0)
+                {
+                    MessageUtil.ShowTips("请选择配置信息。");
+                    return;
+                }
+                //int convNo = (int)dt.Rows[0]["WORKSHOP"];
+                string proLine = dt.Rows[0]["POSITION"].ToString();
+                var result = MessageUtil.ShowYesNoAndWarning(string.Format("[{0}]产线确定要禁用出库功能吗?", proLine));
+                if (result == DialogResult.Yes)
+                {
+                    string msg = SystemConfigWorkflow.AgvSet(proLine, false, LCName);
+                    MessageUtil.ShowTips(msg);
+                    uC_QueryPage1.RefreshData(1, 0);
+                }
+            }
+        }
+    }
+}

+ 120 - 0
WCS_Client/Frm/MBtn_Sys/FrmAGVSet.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 34 - 0
WCS_Client/Models/WCS_AGV_Config.cs

@@ -0,0 +1,34 @@
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WCS_Client.Models
+{
+    public class WCS_AGV_Config
+    {
+        /// <summary>
+        /// 任务号
+        /// </summary>
+        [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
+        public string ID { get; set; }
+        /// <summary>
+        /// 车间号
+        /// </summary>
+        public int WORKSHOP { get; set; }
+        /// <summary>
+        /// 产线
+        /// </summary>
+        public string POSITION { get; set; }
+        /// <summary>
+        /// 入库启用
+        /// </summary>
+        public bool INENABLE { get; set; }
+        /// <summary>
+        /// 出库启用
+        /// </summary>
+        public bool OUTENABLE { get; set; }
+    }
+}

+ 15 - 0
WCS_Client/UC/Util/LCItemUtil.cs

@@ -137,6 +137,21 @@ namespace WCS_Client.UC
             return LCItem;
         }
 
+        public static LayoutControlItem Add_Button(string LCName, string BtnText, int WidthItem, int HeightItem, eButtonColor color, SubmitHandler SubmitMethods)
+        {
+            ButtonX ControlItem = new ButtonX();
+            ControlItem.Text = BtnText;
+            ControlItem.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
+            ControlItem.ColorTable = color;
+            ControlItem.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
+            LayoutControlItem LCItem = Add_Common(LCName, ControlItem, "", WidthItem, eLayoutSizeType.Absolute, HeightItem, SubmitMethods);
+            if (SubmitMethods != null)
+            {
+                ControlItem.Click += new EventHandler(delegate (object sender, EventArgs e) { SubmitMethods(LCItem.Name); });
+            }
+            return LCItem;
+        }
+
         public static LayoutControlItem Add_ComboBoxEx(string LCName, string LblText, int WidthItem, SubmitHandler SubmitMethods, DataChangeHandler DataChangeMethods)
         {
             ComboBoxEx ControlItem = new ComboBoxEx();

+ 10 - 0
WCS_Client/WCS_Client.csproj

@@ -330,6 +330,12 @@
     <Compile Include="Frm\MBtn_Sys\FrmAddPalletizing.Designer.cs">
       <DependentUpon>FrmAddPalletizing.cs</DependentUpon>
     </Compile>
+    <Compile Include="Frm\MBtn_Sys\FrmAGVSet.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Frm\MBtn_Sys\FrmAGVSet.Designer.cs">
+      <DependentUpon>FrmAGVSet.cs</DependentUpon>
+    </Compile>
     <Compile Include="Frm\MBtn_Sys\FrmPalletizingCode.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -561,6 +567,7 @@
     </Compile>
     <Compile Include="Extensions\DataTableExtensions.cs" />
     <Compile Include="Models\Enums.cs" />
+    <Compile Include="Models\WCS_AGV_Config.cs" />
     <Compile Include="Models\WCS_EQUIPMENTINFO.cs" />
     <Compile Include="Models\WCS_EQUIPMENTLOCK.cs" />
     <Compile Include="Models\WCS_PalletizingCode.cs" />
@@ -834,6 +841,9 @@
     <EmbeddedResource Include="Frm\MBtn_Sys\FrmAddPalletizing.resx">
       <DependentUpon>FrmAddPalletizing.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Frm\MBtn_Sys\FrmAGVSet.resx">
+      <DependentUpon>FrmAGVSet.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Frm\MBtn_Sys\FrmPalletizingCode.resx">
       <DependentUpon>FrmPalletizingCode.cs</DependentUpon>
     </EmbeddedResource>

+ 64 - 0
WCS_Client/Workflow/SystemConfigWorkflow.cs

@@ -39,5 +39,69 @@ namespace WCS_Client.Workflow
             });
             return result;
         }
+
+        public static string AgvSet(string convNo, bool enable, string LCName)
+        {
+            string result = TryCachHelper.TryExecute((db) =>
+            {
+                var srmoutinInfo = db.Queryable<WCS_AGV_Config>().First(v => v.POSITION == convNo);
+                if (srmoutinInfo == null)
+                {
+                    throw new Exception(string.Format("未查询到产线[{0}]信息", convNo));
+                }
+                else
+                {
+                    if (LCName == "btn_InEnable")
+                    {
+                        if (db.Updateable<WCS_AGV_Config>()
+                              .UpdateColumns(it => new WCS_AGV_Config
+                              {
+                                  INENABLE = enable
+                              })
+                              .Where(v => v.POSITION == convNo).ExecuteCommand() < 0)
+                        {
+                            throw new Exception(string.Format("产线[{0}]入库启用失败", convNo));
+                        }
+                    }
+                    else if (LCName == "btn_OutEnable")
+                    {
+                        if (db.Updateable<WCS_AGV_Config>()
+                              .UpdateColumns(it => new WCS_AGV_Config
+                              {
+                                  OUTENABLE = enable
+                              })
+                              .Where(v => v.POSITION == convNo).ExecuteCommand() < 0)
+                        {
+                            throw new Exception(string.Format("产线[{0}]出库启用失败", convNo));
+                        }
+                    }
+                    else if (LCName == "btn_InStop")
+                    {
+                        if (db.Updateable<WCS_AGV_Config>()
+                              .UpdateColumns(it => new WCS_AGV_Config
+                              {
+                                  INENABLE = enable
+                              })
+                              .Where(v => v.POSITION == convNo).ExecuteCommand() < 0)
+                        {
+                            throw new Exception(string.Format("产线[{0}]入库禁用失败", convNo));
+                        }
+                    }
+                    else if (LCName == "btn_OutStop")
+                    {
+                        if (db.Updateable<WCS_AGV_Config>()
+                              .UpdateColumns(it => new WCS_AGV_Config
+                              {
+                                  OUTENABLE = enable
+                              })
+                              .Where(v => v.POSITION == convNo).ExecuteCommand() < 0)
+                        {
+                            throw new Exception(string.Format("产线[{0}]出库禁用失败", convNo));
+                        }
+                    }
+                }
+            });
+            return result;
+        }
     }
 }

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov