Ejemplo n.º 1
0
        public EDCDetailsViewContent(EdcGatherData edcData)
            : base()
        {
            if (null != edcData)
            {
                this.TitleName = StringParser.Parse("${res:SolarViewer.Hemera.Addins.EAP.EDCDetailsViewContent}");
            }
            else
            {
                this.TitleName = StringParser.Parse("${res:SolarViewer.Hemera.Addins.EAP.EDCDetailsViewContent}");
            }

            Panel panel = new Panel();

            //set panel dock style
            panel.Dock = DockStyle.Fill;
            //set panel BorderStyle
            panel.BorderStyle = BorderStyle.FixedSingle;

            edcDetailsCtrl = new EDCDetailsCtrl(edcData);

            edcDetailsCtrl.Dock = DockStyle.Fill;

            //add control to panle
            panel.Controls.Add(edcDetailsCtrl);
            //set panel to view content
            this.control = panel;
        }
Ejemplo n.º 2
0
        public EDCData04R(EdcGatherData edcData)
        {
            InitializeComponent();
            btWData.Enabled = false;
            allowInput      = computerEntity.GetComputerInfoOfInput("R");
            _edcData        = edcData;

            DataSet dsLotInfo = new DataSet();

            dsLotInfo = _edcData.GetLotInfo();

            #region BindBaseLotInfo
            LotBaseInfoCtrl lotInfoCtrl = new LotBaseInfoCtrl();
            lotInfoCtrl.SetValueToControl(dsLotInfo);
            lotInfoCtrl.Dock      = DockStyle.Fill;
            lotInfoCtrl.BackColor = Color.FromArgb(203, 219, 234);
            this.gcLotInfo.Controls.Add(lotInfoCtrl);
            #endregion

            #region BindParamInfo
            if (dsLotInfo.Tables.Count > 0 && dsLotInfo.Tables[0].Rows.Count > 0)
            {
                edcInsKey = dsLotInfo.Tables[0].Rows[0][POR_LOT_FIELDS.FIELD_EDC_INS_KEY].ToString();
                lotKey    = dsLotInfo.Tables[0].Rows[0][POR_LOT_FIELDS.FIELD_LOT_KEY].ToString();
            }
            #endregion

            dsParam = _edcData.GetPointParams(edcInsKey);
            if (_edcData.ErrorMsg == string.Empty)
            {
                this.gcParam.MainView = gvParam;
                if (dsParam != null && dsParam.Tables.Count > 0)
                {
                    gcParam.DataSource = dsParam.Tables[0];
                    DataRow[] dataRow = dsParam.Tables[0].Select("DEVICE_TYPE='W'");
                    if (dataRow.Length > 0)
                    {
                        btWData.Enabled = true;
                    }
                }
            }
            else
            {
                MessageService.ShowError("查询参数出错" + _edcData.ErrorMsg);
            }

            if (InitializeUI())
            {
                #region BindInitialData
                BindInitialData();
                #endregion
            }
            else
            {
                this.btSubmit.Enabled = false;
                btDeleteData.Enabled  = false;
            }
            //Thread thr = new Thread(new ThreadStart(this.GetData));
            //thr.Start();
        }
Ejemplo n.º 3
0
        public EDCBaseInfoCtrl(EdcGatherData data)
        {
            InitializeComponent();
            this.lblFactoryRoomName.Text = data.FactoryRoomName;
            this.lblOperationName.Text   = data.OperationName;
            this.lblLotNumber.Text       = data.LotNumber;
            this.lblMaterialLot.Text     = data.MaterialLot;
            this.lblPartNumber.Text      = data.PartNumber;
            this.lblPartType.Text        = data.PartType;
            this.lblEquipmentName.Text   = data.EquipmentName;

            this.lblOperator.Text = data.Operator;
        }
Ejemplo n.º 4
0
        public EDCDetailsCtrl(EdcGatherData edcData)
        {
            this._edcData = edcData;

            InitializeComponent();
            InitializeTablePanel();
            MapSHRDataToControls();

            LotBaseInfoCtrl lotInfoCtrl = new LotBaseInfoCtrl();

            lotInfoCtrl.SetValueToControl(_edcData.GetLotInfo());
            lotInfoCtrl.Dock      = DockStyle.Fill;
            lotInfoCtrl.BackColor = Color.FromArgb(203, 219, 234);
            Panel011.Controls.Add(lotInfoCtrl);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 双击采集的数据行。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gvResults_DoubleClick(object sender, EventArgs e)
        {
            int rowHandle = this.gvResults.FocusedRowHandle;

            if (rowHandle < 0)
            {
                return;
            }
            DataRow dr = this.gvResults.GetFocusedDataRow();
            //获取当前班别名称。
            Shift  _shift       = new Shift();
            string defaultShift = _shift.GetCurrShiftName();

            _edcData                 = new EdcGatherData();
            _edcData.Operator        = PropertyService.Get(PROPERTY_FIELDS.USER_NAME);
            _edcData.LotNumber       = Convert.ToString(dr[EDC_MAIN_INS_FIELDS.FIELD_LOT_NUMBER]);
            _edcData.EDCKey          = Convert.ToString(dr[EDC_MAIN_INS_FIELDS.FIELD_EDC_KEY]);
            _edcData.LineName        = string.Empty;
            _edcData.OperationName   = Convert.ToString(dr[EDC_MAIN_INS_FIELDS.FIELD_STEP_NAME]);
            _edcData.EquipmentKey    = Convert.ToString(dr[EDC_MAIN_INS_FIELDS.FIELD_EQUIPMENT_KEY]);
            _edcData.MaterialLot     = Convert.ToString(dr[EDC_MAIN_INS_FIELDS.FIELD_MATERIAL_LOT]);
            _edcData.OrderNumber     = Convert.ToString(dr[POR_WORK_ORDER_FIELDS.FIELD_ORDER_NUMBER]);
            _edcData.PartNumber      = Convert.ToString(dr[EDC_MAIN_INS_FIELDS.FIELD_PART_NO]);
            _edcData.SupplierName    = Convert.ToString(dr[EDC_MAIN_INS_FIELDS.FIELD_SUPPLIER]);
            _edcData.ShiftName       = defaultShift;
            _edcData.EquipmentName   = Convert.ToString(dr[EMS_EQUIPMENTS_FIELDS.FIELD_EQUIPMENT_NAME]);
            _edcData.EDCName         = Convert.ToString(dr[EDC_MAIN_INS_FIELDS.FIELD_EDC_NAME]);
            _edcData.FactoryRoomName = Convert.ToString(dr[FMM_LOCATION_FIELDS.FIELD_LOCATION_NAME]);
            _edcData.FactoryRoomKey  = Convert.ToString(dr[EDC_MAIN_INS_FIELDS.FIELD_LOCATION_KEY]);
            _edcData.EDCActionName   = Convert.ToString(dr[EDC_POINT_FIELDS.FIELD_ACTION_NAME]);
            _edcData.EDCPointKey     = Convert.ToString(dr[EDC_MAIN_INS_FIELDS.FIELD_EDC_POINT_KEY]);
            _edcData.EDCSPKey        = Convert.ToString(dr[EDC_MAIN_INS_FIELDS.FIELD_EDC_SP_KEY]);
            _edcData.PartType        = Convert.ToString(dr[EDC_MAIN_INS_FIELDS.FIELD_PART_TYPE]);
            _edcData.EDCMainInsKey   = Convert.ToString(dr[EDC_MAIN_INS_FIELDS.FIELD_EDC_INS_KEY]);
            //遍历工作台中的视图对象。
            foreach (IViewContent viewContent in WorkbenchSingleton.Workbench.ViewContentCollection)
            {
                if (viewContent.TitleName == "数据采集明细")
                {
                    viewContent.WorkbenchWindow.CloseWindow(true);
                    break;
                }
            }
            //创建新的视图对象并显示。
            EDCData04WViewContent view = new EDCData04WViewContent(_edcData);

            WorkbenchSingleton.Workbench.ShowView(view);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="edcData">表示设备数据采集的数据对象。</param>
        public EDCData04WViewContent(EdcGatherData edcData)
            : base()
        {
            this.TitleName = "数据采集明细";

            Panel panel = new Panel();

            //set panel dock style
            panel.Dock = DockStyle.Fill;
            //set panel BorderStyle
            panel.BorderStyle = BorderStyle.FixedSingle;
            //创建新的设备数据控件对象。
            edc04WCtrl      = new EDCData04W(edcData);
            edc04WCtrl.Dock = DockStyle.Fill;
            //将设备数据采集的控件对象加入到Panel中。
            //设置Panel为该视图对象的控件对象,用于返回该平台显示设备数据采集的界面。
            panel.Controls.Add(edc04WCtrl);
            this.control = panel;
        }
Ejemplo n.º 7
0
        private void btWData_Click(object sender, EventArgs e)
        {
            EdcGatherData edcGatherData = new EdcGatherData();

            edcGatherData.StaffNumber  = _edcData.StaffNumber;
            edcGatherData.SerialNumber = _edcData.SerialNumber;
            edcGatherData.DataType     = "W";

            foreach (IViewContent viewContent in WorkbenchSingleton.Workbench.ViewContentCollection)
            {
                if (viewContent.TitleName == "称重")
                {
                    viewContent.WorkbenchWindow.CloseWindow(true);
                    break;
                }
            }
            WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.CloseWindow(false);
            EDCData04WViewContent view = new EDCData04WViewContent(edcGatherData);

            WorkbenchSingleton.Workbench.ShowView(view);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 数据采集按钮Click事件处理方法。
        /// </summary>
        /// <param name="sender">触发事件的对象。</param>
        /// <param name="e">事件参数。</param>
        /// comment by peter 2012-2-23
        private void btnMTData_Click(object sender, EventArgs e)
        {
            //车间是否输入?
            if (lueFactoryRoom.Text == string.Empty)
            {
                MessageService.ShowMessage("车间不能为空");
                this.lueFactoryRoom.Focus();
                return;
            }
            //工序是否输入?
            if (cbOperation.Text == string.Empty)
            {
                MessageService.ShowMessage("工序不能为空");
                this.cbOperation.Focus();
                return;
            }
            //采集项目不能为空
            if (string.IsNullOrEmpty(this.lueEDCItem.Text))
            {
                MessageService.ShowMessage("采集项目不能为空。");
                this.lueEDCItem.Focus();
                return;
            }
            string selectedEquipmentKey = Convert.ToString(this.lueEquipment.EditValue);

            //设备不能为空
            if (string.IsNullOrEmpty(selectedEquipmentKey))
            {
                MessageService.ShowMessage("设备不能为空。");
                this.lueEquipment.Focus();
                return;
            }
            string actionName    = this.lueEDCItem.GetColumnValue("ACTION_NAME").ToString();                                  //数据采集项目触发时的动作。
            string equipmentKey  = this.lueEDCItem.GetColumnValue("EQUIPMENT_KEY").ToString();                                //数据采集项目指定的设备主键。
            string operationName = this.lueEDCItem.GetColumnValue("OPERATION_NAME").ToString();                               //数据采集项目指定的工序名称。
            string sField        = Convert.ToString(this.lueEDCItem.GetColumnValue(EDC_POINT_FIELDS.FIELD_MUST_INPUT_FIELD)); //数据采集项目必须输入的栏位。
            int    field         = 0;

            if (!int.TryParse(sField, out field))
            {
                field = 0;
            }
            bool   bMustInputLotNo = ((EDCPointMustInputField)field & EDCPointMustInputField.LotNo) == EDCPointMustInputField.LotNo;
            string edckey          = this.lueEDCItem.GetColumnValue("EDC_KEY").ToString();
            string spkey           = this.lueEDCItem.GetColumnValue("SP_KEY").ToString();

            if (!string.IsNullOrEmpty(equipmentKey) && equipmentKey != selectedEquipmentKey)
            {
                MessageService.ShowMessage("采集项目指定的设备和当前选中设备不一致。");
                this.lueEquipment.Focus();
                return;
            }
            if (operationName != cbOperation.Text)
            {
                MessageService.ShowMessage("采集项目指定的工序和当前选中工序不一致。");
                this.lueEquipment.Focus();
                return;
            }
            if (actionName != "NONE")
            {
                //批次号是否输入?
                if (this.txtLotNo.Text == string.Empty)
                {
                    MessageService.ShowMessage("在线采集项目,批号必须输入。", "提示");
                    this.txtLotNo.Focus();
                    return;
                }
                //检查是否对该批次号具有权限。
                if (!CheckLotNo(txtLotNo.Text.Trim(), ACTIVITY_FIELD_VALUES.FIELD_ACTIVITY_TRACKOUT))
                {
                    return;
                }
            }
            else if (bMustInputLotNo)//离线采集项目且必须输入批次号。
            {
                if (string.IsNullOrEmpty(this.txtLotNo.Text.Trim()))
                {
                    MessageService.ShowMessage("指定的数据采集项目,批号必须输入。", "提示");
                    this.txtLotNo.Focus();
                    return;
                }
                //检查是否对该批次号具有权限。
                if (!CheckLotNo(txtLotNo.Text.Trim(), ACTIVITY_FIELD_VALUES.FIELD_ACTIVITY_NONE))
                {
                    return;
                }
            }
            //如果有输入批次,则获取批次信息。
            if (!string.IsNullOrEmpty(this.txtLotNo.Text))
            {
                //如果没有成功获取到批次信息。
                if (GetLotInfomation() == false)
                {
                    return;
                }
            }
            //获取当前班别名称。
            Shift  _shift       = new Shift();
            string defaultShift = _shift.GetCurrShiftName();

            _edcData                 = new EdcGatherData();
            _edcData.Operator        = PropertyService.Get(PROPERTY_FIELDS.USER_NAME);
            _edcData.LotNumber       = this.txtLotNo.Text.ToUpper();
            _edcData.EDCKey          = edckey;
            _edcData.LineName        = this.lueLine.Text;
            _edcData.OperationName   = operationName;
            _edcData.EquipmentKey    = selectedEquipmentKey;
            _edcData.MaterialLot     = this.txtMaterialLot.Text;
            _edcData.OrderNumber     = this.txtWorkOrder.Text;
            _edcData.PartNumber      = this.txtPartNumber.Text;
            _edcData.SupplierName    = this.txtSupplier.Text;
            _edcData.ShiftName       = defaultShift;
            _edcData.EquipmentName   = this.lueEquipment.Text;
            _edcData.EDCName         = this.lueEDCItem.Text;
            _edcData.FactoryRoomName = this.lueFactoryRoom.Text;
            _edcData.FactoryRoomKey  = this.lueFactoryRoom.EditValue.ToString();
            _edcData.EDCActionName   = actionName;
            _edcData.EDCPointKey     = this.lueEDCItem.EditValue.ToString();
            _edcData.EDCSPKey        = spkey;
            _edcData.PartType        = Convert.ToString(this.luePartType.EditValue);
            //遍历工作台中的视图对象。
            foreach (IViewContent viewContent in WorkbenchSingleton.Workbench.ViewContentCollection)
            {
                if (viewContent is EDCData04WViewContent)
                {
                    viewContent.WorkbenchWindow.CloseWindow(true);
                    break;
                }
            }
            //创建新的视图对象并显示。
            EDCData04WViewContent view = new EDCData04WViewContent(_edcData);

            WorkbenchSingleton.Workbench.ShowView(view);
        }