lu
2025-08-09 878aad490fc15b11d63fb4fa7ab7ada260f66310
DevApp/Gs.DevApp/DevFrm/Work/Frm_Work09.cs
@@ -15,8 +15,8 @@
{
    public partial class Frm_Work09 : DevExpress.XtraEditors.XtraForm
    {
        string _strType = "";
        string _webServiceName = "WorkWeight/";
        string value = string.Empty;
        /// <summary>
        /// 串口类
        /// </summary>
@@ -25,9 +25,11 @@
        /// gridview定时刷新
        /// </summary>
        System.Timers.Timer timer = new System.Timers.Timer(10000);
        public Frm_Work09()
        public Frm_Work09(string strType)
        {
            InitializeComponent();
            this._strType = strType;
            this.Text = _strType + ":" + this.Text;
            this.FormClosing += (s, e) =>
            {
                if (Sp.IsOpen)
@@ -39,7 +41,10 @@
                }
            };
            GetComList();
            if (this._strType == QcSeason.产线称重.ToString())
            {
            this.comLine.getSuppler("");
            }
            gvMx1.OptionsFind.ShowSearchNavButtons = false;
            gvMx1.OptionsView.ShowAutoFilterRow = false;
            gvMx1.OptionsView.ShowGroupPanel = false;
@@ -87,17 +92,20 @@
        private void btnStart_Click(object sender, EventArgs e)
        {
            Sp.DataReceived -= new SerialDataReceivedEventHandler(Sp_DataReceived);
            string _comLine = comLine.GetId();
            string _cmbSerialPortNum = cmbSerialPortNum.Text.Trim();
            string _cmbBaudRate = cmbBaudRate.Text.Trim();
            string _comSjw = comSjw.Text.Trim();
            string _comStopBits = comStopBits.Text.Trim();
            string _comParity = comParity.Text.Trim();
            if (this._strType == QcSeason.产线称重.ToString())
            {
                string _comLine = comLine.GetId();
            if (string.IsNullOrEmpty(_comLine))
            {
                Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择线体");
                this.comLine.Focus();
                return;
                }
            }
            if (cmbSerialPortNum.SelectedIndex < 0)
            {
@@ -242,7 +250,13 @@
        /// <param name="_realWeightTxt">原子串</param>
        private void addModel(string _realWeight, string _realWeightTxt)
        {
            string _lineId = comLine.GetId();
            string _lineId = "";
            if (this._strType == QcSeason.产线称重.ToString())
            {
                _lineId = comLine.GetId();
            }
            else
                _lineId = "0";
            var _obj = new
            {
                lineId = _lineId,
@@ -272,13 +286,14 @@
        /// <param name="e"></param>
        private void OnTimedEvent(Object source, ElapsedEventArgs e)
        {
            if (this._strType == QcSeason.iqc称重.ToString())
                return;
            var _obj = new
            {
                lineId = comLine.GetId(),
            };
            try
            {
                var lst = new List<string>();
                var strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetModelList", JsonConvert.SerializeObject(_obj), false);
                var dd = UtilityHelper.ReturnToList(strReturn);
                var dt = dd.rtnData;