/// <summary> /// 获取小车是否到位标识 /// 对于100型其实是判断分户盒是否被扫到(100型可以认为是2个虚拟小车容器) /// 对于200型是小车到位 /// </summary> /// <returns></returns> public bool GetCubeReady() { SortingTaskArrive sortingTaskArrive = SortingTaskArrive.GetSortingTaskArrive("0"); //后期要改成判断PLC队尾的订单序号 //如果PLC序号大于我队尾的序号表示小车已经移动到位 if (sortingTaskArrive.Value == "1") { sortingTaskArrive.Value = "0"; sortingTaskArrive.Save(); return(true); } else { return(false); } }
/// <summary> /// 保存混仓卷烟在皮带上的数量 /// </summary> private static void SaveDynamicBoxPutNum() { try { OperateOpcAndSoft operateOpcAndSoft = new OperateOpcAndSoft(); Dictionary <int, int> putoutnums = operateOpcAndSoft.GetDynamicBoxPutNum(); SortingTaskArrive sortingtaskarrive = SortingTaskArrive.GetSortingTaskArrive("0"); if (Convert.ToInt32(sortingtaskarrive.Value) != putoutnums[73]) { sortingtaskarrive.ADDRESSCODE = "73"; sortingtaskarrive.Value = putoutnums[73].ToString(); sortingtaskarrive.Save(); } } catch { } }
private void btnissued_Click(object sender, EventArgs e) { //CSortingTask_OnTaskMoved(null, null); //SortingLineTaskQueue.GetInstance().Move(); ////当前AB区的任务已完成 //SortingTaskIssued sortingTaskIssued = SortingTaskIssued.GetSortingTaskIssued("0"); //sortingTaskIssued.PLCFLAG = 0; //sortingTaskIssued.Save(); //SoundPlayer player = new SoundPlayer(); //player.SoundLocation = Application.StartupPath + "\\Sound\\订单完成.wav"; //player.Load(); //player.Play(); //修改到达信息,分户完成 SortingTaskArrive sortingTaskArrive = SortingTaskArrive.GetSortingTaskArrive("0"); sortingTaskArrive.Value = "1"; sortingTaskArrive.Save(); }
private void SetFinDynamicBox() { try { if (this.InvokeRequired) { this.Invoke(new Action(SetFinDynamicBox)); } int indexno = 0; int rowindexno = 0; //获取混合仓中已分拣完成的卷烟列表 SortingLineTaskList sortingLineTaskList = SortingLineTaskList.GetFinSortingLineTaskList(new QueryCondition("2", true, AppUtility.AppUtil._SortingLineId, "desc")); //得到最新完成的流水号 if (sortingLineTaskList.Count > 0) { indexno = sortingLineTaskList[0].INDEXNO; } //重置列表 foreach (DataGridViewRow row in dgvybDynamicBox.Rows) { row.DefaultCellStyle.BackColor = Color.White; row.Cells["outputnum"].Value = ""; } //将混仓显示列表中的已完成卷烟背景色显示为灰色 for (int i = dgvybDynamicBox.Rows.Count - 1; i >= 0; i--) { if (Convert.ToInt16(dgvybDynamicBox.Rows[i].Cells[0].Value) <= indexno) { dgvybDynamicBox.Rows[i].DefaultCellStyle.BackColor = Color.DarkGray; //row.Cells["outputnum"].Value = ""; } else { //控制滚动条的显示位置 if (dgvybDynamicBox.Rows[i].Index - 10 >= 0) { dgvybDynamicBox.FirstDisplayedScrollingRowIndex = dgvybDynamicBox.Rows[i].Index - 10; } else { dgvybDynamicBox.FirstDisplayedScrollingRowIndex = 0; } //获取表格中已分拣完成混仓烟位置 rowindexno = dgvybDynamicBox.Rows[i].Index; break; } } //将混仓显示列表中的已完成卷烟背景色显示为灰色 //foreach (DataGridViewRow row in dgvybDynamicBox.Rows) //{ // if (Convert.ToInt16(row.Cells[0].Value) <= indexno) // { // row.DefaultCellStyle.BackColor = Color.DarkGray; // //row.Cells["outputnum"].Value = ""; // } // else // { // //控制滚动条的显示位置 // if (row.Index >= 6) // { // dgvybDynamicBox.FirstDisplayedScrollingRowIndex = row.Index - 6 ; // } // else // { // dgvybDynamicBox.FirstDisplayedScrollingRowIndex = row.Index - row.Index; // } // //获取表格中已分拣完成混仓烟位置 // rowindexno = row.Index; // break; // } //} //在皮带上的混仓卷烟数量 sortingtaskarrive = SortingTaskArrive.GetSortingTaskArrive("0"); int outputnum = Convert.ToInt32(sortingtaskarrive.Value); //数量大于0表示皮带上有混仓烟 if (outputnum > 0) { if (rowindexno - 1 > 0) { //对列表上的卷烟进行已分拣出的标记 for (int i = rowindexno; i > 0; i--) { if (outputnum > 0) { //当前行的数量小于皮带上的数量,在已打出显示当前数量 if (Convert.ToInt32(dgvybDynamicBox.Rows[i].Cells["InQty"].Value) <= outputnum) { //将已打出的混仓烟标记为蓝色背景 dgvybDynamicBox.Rows[i].DefaultCellStyle.BackColor = Color.Blue; dgvybDynamicBox.Rows[i].Cells["outputnum"].Value = dgvybDynamicBox.Rows[i].Cells["InQty"].Value; } else { //将已打出的混仓烟标记为蓝色背景 dgvybDynamicBox.Rows[i].DefaultCellStyle.BackColor = Color.Blue; //当前行的数量大于皮带上的剩余数量,显示剩余数量 dgvybDynamicBox.Rows[i].Cells["outputnum"].Value = outputnum; break; } //减去当前行的数量,得到剩余数量进行下一次循环 outputnum = outputnum - Convert.ToInt32(dgvybDynamicBox.Rows[i].Cells["InQty"].Value); } else { break; } } } } } catch (Exception ex) { } }