Commit 9503216c by 任天宇

优化

parent 1d63e746
......@@ -7,3 +7,4 @@
/packages
/.vs
/Src/bin/Debug
/Src/obj/Release
......@@ -58,6 +58,7 @@
this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.gbRightToolBar = new System.Windows.Forms.GroupBox();
this.ckbAutoPackage = new System.Windows.Forms.CheckBox();
this.btnSampleAssign = new System.Windows.Forms.Button();
this.lbTips = new System.Windows.Forms.Label();
this.lbScanSample = new System.Windows.Forms.Label();
......@@ -78,7 +79,14 @@
this.btnClearCurrentPackage = new System.Windows.Forms.Button();
this.lbSetPackage = new System.Windows.Forms.Label();
this.tbSetCurrentPackage = new System.Windows.Forms.TextBox();
this.ckbAutoPackage = new System.Windows.Forms.CheckBox();
this.lbPackageSamples = new System.Windows.Forms.Label();
this.lbPackageSampleMiss = new System.Windows.Forms.Label();
this.lbScanSamples = new System.Windows.Forms.Label();
this.lbScanSampleMore = new System.Windows.Forms.Label();
this.lbPackageSamplesCount = new System.Windows.Forms.Label();
this.lbPackageSampleMissCount = new System.Windows.Forms.Label();
this.lbScanSamplesCount = new System.Windows.Forms.Label();
this.lbScanSampleMoreCount = new System.Windows.Forms.Label();
this.plLeft.SuspendLayout();
this.gbInfo.SuspendLayout();
this.gbLogin.SuspendLayout();
......@@ -99,7 +107,7 @@
this.plLeft.Dock = System.Windows.Forms.DockStyle.Left;
this.plLeft.Location = new System.Drawing.Point(0, 0);
this.plLeft.Name = "plLeft";
this.plLeft.Size = new System.Drawing.Size(252, 659);
this.plLeft.Size = new System.Drawing.Size(252, 648);
this.plLeft.TabIndex = 0;
//
// gbInfo
......@@ -108,7 +116,7 @@
this.gbInfo.Dock = System.Windows.Forms.DockStyle.Fill;
this.gbInfo.Location = new System.Drawing.Point(0, 447);
this.gbInfo.Name = "gbInfo";
this.gbInfo.Size = new System.Drawing.Size(252, 212);
this.gbInfo.Size = new System.Drawing.Size(252, 201);
this.gbInfo.TabIndex = 2;
this.gbInfo.TabStop = false;
this.gbInfo.Text = "信息";
......@@ -118,7 +126,7 @@
this.rtbMessage.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtbMessage.Location = new System.Drawing.Point(3, 17);
this.rtbMessage.Name = "rtbMessage";
this.rtbMessage.Size = new System.Drawing.Size(246, 192);
this.rtbMessage.Size = new System.Drawing.Size(246, 181);
this.rtbMessage.TabIndex = 0;
this.rtbMessage.Text = "";
//
......@@ -173,7 +181,7 @@
this.lbCurrentPackage.Font = new System.Drawing.Font("宋体", 12F);
this.lbCurrentPackage.Location = new System.Drawing.Point(9, 313);
this.lbCurrentPackage.Name = "lbCurrentPackage";
this.lbCurrentPackage.Size = new System.Drawing.Size(79, 16);
this.lbCurrentPackage.Size = new System.Drawing.Size(80, 16);
this.lbCurrentPackage.TabIndex = 6;
this.lbCurrentPackage.Text = "当前箱号:";
//
......@@ -196,7 +204,7 @@
this.lbCurrentLocation.Font = new System.Drawing.Font("宋体", 12F);
this.lbCurrentLocation.Location = new System.Drawing.Point(12, 256);
this.lbCurrentLocation.Name = "lbCurrentLocation";
this.lbCurrentLocation.Size = new System.Drawing.Size(79, 16);
this.lbCurrentLocation.Size = new System.Drawing.Size(80, 16);
this.lbCurrentLocation.TabIndex = 5;
this.lbCurrentLocation.Text = "当前位置:";
//
......@@ -219,7 +227,7 @@
this.lbPackageDepartment.Font = new System.Drawing.Font("宋体", 12F);
this.lbPackageDepartment.Location = new System.Drawing.Point(9, 370);
this.lbPackageDepartment.Name = "lbPackageDepartment";
this.lbPackageDepartment.Size = new System.Drawing.Size(111, 16);
this.lbPackageDepartment.Size = new System.Drawing.Size(112, 16);
this.lbPackageDepartment.TabIndex = 4;
this.lbPackageDepartment.Text = "样品所属部门:";
//
......@@ -295,9 +303,9 @@
this.plRight.Controls.Add(this.gbRfid);
this.plRight.Controls.Add(this.gbRightToolBar);
this.plRight.Dock = System.Windows.Forms.DockStyle.Right;
this.plRight.Location = new System.Drawing.Point(635, 0);
this.plRight.Location = new System.Drawing.Point(640, 0);
this.plRight.Name = "plRight";
this.plRight.Size = new System.Drawing.Size(450, 659);
this.plRight.Size = new System.Drawing.Size(532, 648);
this.plRight.TabIndex = 1;
//
// gbRfid
......@@ -306,7 +314,7 @@
this.gbRfid.Dock = System.Windows.Forms.DockStyle.Fill;
this.gbRfid.Location = new System.Drawing.Point(0, 125);
this.gbRfid.Name = "gbRfid";
this.gbRfid.Size = new System.Drawing.Size(450, 534);
this.gbRfid.Size = new System.Drawing.Size(532, 523);
this.gbRfid.TabIndex = 2;
this.gbRfid.TabStop = false;
this.gbRfid.Text = "Rfid扫描结果";
......@@ -329,7 +337,7 @@
this.dgvRfidSamples.Name = "dgvRfidSamples";
this.dgvRfidSamples.ReadOnly = true;
this.dgvRfidSamples.RowTemplate.Height = 23;
this.dgvRfidSamples.Size = new System.Drawing.Size(444, 514);
this.dgvRfidSamples.Size = new System.Drawing.Size(526, 503);
this.dgvRfidSamples.TabIndex = 0;
this.dgvRfidSamples.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dgvRfidSamples_RowPostPaint);
this.dgvRfidSamples.RowStateChanged += new System.Windows.Forms.DataGridViewRowStateChangedEventHandler(this.dgvRfidSamples_RowStateChanged);
......@@ -396,6 +404,10 @@
//
// gbRightToolBar
//
this.gbRightToolBar.Controls.Add(this.lbScanSampleMoreCount);
this.gbRightToolBar.Controls.Add(this.lbScanSamplesCount);
this.gbRightToolBar.Controls.Add(this.lbScanSampleMore);
this.gbRightToolBar.Controls.Add(this.lbScanSamples);
this.gbRightToolBar.Controls.Add(this.ckbAutoPackage);
this.gbRightToolBar.Controls.Add(this.btnSampleAssign);
this.gbRightToolBar.Controls.Add(this.lbTips);
......@@ -405,18 +417,28 @@
this.gbRightToolBar.Dock = System.Windows.Forms.DockStyle.Top;
this.gbRightToolBar.Location = new System.Drawing.Point(0, 0);
this.gbRightToolBar.Name = "gbRightToolBar";
this.gbRightToolBar.Size = new System.Drawing.Size(450, 125);
this.gbRightToolBar.Size = new System.Drawing.Size(532, 125);
this.gbRightToolBar.TabIndex = 1;
this.gbRightToolBar.TabStop = false;
this.gbRightToolBar.Text = "操作台";
//
// ckbAutoPackage
//
this.ckbAutoPackage.AutoSize = true;
this.ckbAutoPackage.Location = new System.Drawing.Point(237, 25);
this.ckbAutoPackage.Name = "ckbAutoPackage";
this.ckbAutoPackage.Size = new System.Drawing.Size(72, 16);
this.ckbAutoPackage.TabIndex = 85;
this.ckbAutoPackage.Text = "自动入箱";
this.ckbAutoPackage.UseVisualStyleBackColor = true;
//
// btnSampleAssign
//
this.btnSampleAssign.BackColor = System.Drawing.Color.LightSteelBlue;
this.btnSampleAssign.Dock = System.Windows.Forms.DockStyle.Right;
this.btnSampleAssign.Font = new System.Drawing.Font("宋体", 29F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))));
this.btnSampleAssign.ForeColor = System.Drawing.Color.DarkBlue;
this.btnSampleAssign.Location = new System.Drawing.Point(334, 17);
this.btnSampleAssign.Location = new System.Drawing.Point(416, 17);
this.btnSampleAssign.Name = "btnSampleAssign";
this.btnSampleAssign.Size = new System.Drawing.Size(113, 105);
this.btnSampleAssign.TabIndex = 84;
......@@ -475,7 +497,7 @@
this.plMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.plMain.Location = new System.Drawing.Point(252, 0);
this.plMain.Name = "plMain";
this.plMain.Size = new System.Drawing.Size(383, 659);
this.plMain.Size = new System.Drawing.Size(388, 648);
this.plMain.TabIndex = 2;
//
// gbMain
......@@ -484,7 +506,7 @@
this.gbMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.gbMain.Location = new System.Drawing.Point(0, 125);
this.gbMain.Name = "gbMain";
this.gbMain.Size = new System.Drawing.Size(383, 534);
this.gbMain.Size = new System.Drawing.Size(388, 523);
this.gbMain.TabIndex = 1;
this.gbMain.TabStop = false;
this.gbMain.Text = "箱内样品";
......@@ -507,7 +529,7 @@
this.dgvSamples.Name = "dgvSamples";
this.dgvSamples.ReadOnly = true;
this.dgvSamples.RowTemplate.Height = 23;
this.dgvSamples.Size = new System.Drawing.Size(377, 514);
this.dgvSamples.Size = new System.Drawing.Size(382, 503);
this.dgvSamples.TabIndex = 0;
this.dgvSamples.DataBindingComplete += new System.Windows.Forms.DataGridViewBindingCompleteEventHandler(this.dgvSamples_DataBindingComplete);
this.dgvSamples.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dgvSamples_RowPostPaint);
......@@ -575,6 +597,10 @@
//
// gbMainToolBar
//
this.gbMainToolBar.Controls.Add(this.lbPackageSampleMissCount);
this.gbMainToolBar.Controls.Add(this.lbPackageSamplesCount);
this.gbMainToolBar.Controls.Add(this.lbPackageSampleMiss);
this.gbMainToolBar.Controls.Add(this.lbPackageSamples);
this.gbMainToolBar.Controls.Add(this.lbCurrentPackageStatus);
this.gbMainToolBar.Controls.Add(this.btnClearCurrentPackage);
this.gbMainToolBar.Controls.Add(this.lbSetPackage);
......@@ -582,7 +608,7 @@
this.gbMainToolBar.Dock = System.Windows.Forms.DockStyle.Top;
this.gbMainToolBar.Location = new System.Drawing.Point(0, 0);
this.gbMainToolBar.Name = "gbMainToolBar";
this.gbMainToolBar.Size = new System.Drawing.Size(383, 125);
this.gbMainToolBar.Size = new System.Drawing.Size(388, 125);
this.gbMainToolBar.TabIndex = 0;
this.gbMainToolBar.TabStop = false;
this.gbMainToolBar.Text = "操作台";
......@@ -627,21 +653,91 @@
this.tbSetCurrentPackage.TabIndex = 78;
this.tbSetCurrentPackage.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tbSetCurrentPackage_KeyDown);
//
// ckbAutoPackage
//
this.ckbAutoPackage.AutoSize = true;
this.ckbAutoPackage.Location = new System.Drawing.Point(237, 103);
this.ckbAutoPackage.Name = "ckbAutoPackage";
this.ckbAutoPackage.Size = new System.Drawing.Size(72, 16);
this.ckbAutoPackage.TabIndex = 85;
this.ckbAutoPackage.Text = "自动入箱";
this.ckbAutoPackage.UseVisualStyleBackColor = true;
// lbPackageSamples
//
this.lbPackageSamples.AutoSize = true;
this.lbPackageSamples.Font = new System.Drawing.Font("宋体", 14F);
this.lbPackageSamples.Location = new System.Drawing.Point(6, 98);
this.lbPackageSamples.Name = "lbPackageSamples";
this.lbPackageSamples.Size = new System.Drawing.Size(66, 19);
this.lbPackageSamples.TabIndex = 82;
this.lbPackageSamples.Text = "总数:";
//
// lbPackageSampleMiss
//
this.lbPackageSampleMiss.AutoSize = true;
this.lbPackageSampleMiss.Font = new System.Drawing.Font("宋体", 14F);
this.lbPackageSampleMiss.Location = new System.Drawing.Point(188, 98);
this.lbPackageSampleMiss.Name = "lbPackageSampleMiss";
this.lbPackageSampleMiss.Size = new System.Drawing.Size(85, 19);
this.lbPackageSampleMiss.TabIndex = 83;
this.lbPackageSampleMiss.Text = "缺失数:";
//
// lbScanSamples
//
this.lbScanSamples.AutoSize = true;
this.lbScanSamples.Font = new System.Drawing.Font("宋体", 14F);
this.lbScanSamples.Location = new System.Drawing.Point(237, 58);
this.lbScanSamples.Name = "lbScanSamples";
this.lbScanSamples.Size = new System.Drawing.Size(85, 19);
this.lbScanSamples.TabIndex = 86;
this.lbScanSamples.Text = "扫描数:";
//
// lbScanSampleMore
//
this.lbScanSampleMore.AutoSize = true;
this.lbScanSampleMore.Font = new System.Drawing.Font("宋体", 14F);
this.lbScanSampleMore.Location = new System.Drawing.Point(237, 98);
this.lbScanSampleMore.Name = "lbScanSampleMore";
this.lbScanSampleMore.Size = new System.Drawing.Size(85, 19);
this.lbScanSampleMore.TabIndex = 87;
this.lbScanSampleMore.Text = "多余数:";
//
// lbPackageSamplesCount
//
this.lbPackageSamplesCount.AutoSize = true;
this.lbPackageSamplesCount.Font = new System.Drawing.Font("宋体", 18F);
this.lbPackageSamplesCount.Location = new System.Drawing.Point(78, 93);
this.lbPackageSamplesCount.Name = "lbPackageSamplesCount";
this.lbPackageSamplesCount.Size = new System.Drawing.Size(22, 24);
this.lbPackageSamplesCount.TabIndex = 84;
this.lbPackageSamplesCount.Text = "0";
//
// lbPackageSampleMissCount
//
this.lbPackageSampleMissCount.AutoSize = true;
this.lbPackageSampleMissCount.Font = new System.Drawing.Font("宋体", 18F);
this.lbPackageSampleMissCount.Location = new System.Drawing.Point(279, 93);
this.lbPackageSampleMissCount.Name = "lbPackageSampleMissCount";
this.lbPackageSampleMissCount.Size = new System.Drawing.Size(22, 24);
this.lbPackageSampleMissCount.TabIndex = 85;
this.lbPackageSampleMissCount.Text = "0";
//
// lbScanSamplesCount
//
this.lbScanSamplesCount.AutoSize = true;
this.lbScanSamplesCount.Font = new System.Drawing.Font("宋体", 18F);
this.lbScanSamplesCount.Location = new System.Drawing.Point(318, 53);
this.lbScanSamplesCount.Name = "lbScanSamplesCount";
this.lbScanSamplesCount.Size = new System.Drawing.Size(22, 24);
this.lbScanSamplesCount.TabIndex = 88;
this.lbScanSamplesCount.Text = "0";
//
// lbScanSampleMoreCount
//
this.lbScanSampleMoreCount.AutoSize = true;
this.lbScanSampleMoreCount.Font = new System.Drawing.Font("宋体", 18F);
this.lbScanSampleMoreCount.Location = new System.Drawing.Point(318, 93);
this.lbScanSampleMoreCount.Name = "lbScanSampleMoreCount";
this.lbScanSampleMoreCount.Size = new System.Drawing.Size(22, 24);
this.lbScanSampleMoreCount.TabIndex = 89;
this.lbScanSampleMoreCount.Text = "0";
//
// FrmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1085, 659);
this.ClientSize = new System.Drawing.Size(1172, 648);
this.Controls.Add(this.plMain);
this.Controls.Add(this.plRight);
this.Controls.Add(this.plLeft);
......@@ -719,6 +815,14 @@
private System.Windows.Forms.Label lbCurrentPackageStatus;
private System.Windows.Forms.Button btnSampleAssign;
private System.Windows.Forms.CheckBox ckbAutoPackage;
private System.Windows.Forms.Label lbScanSampleMoreCount;
private System.Windows.Forms.Label lbScanSamplesCount;
private System.Windows.Forms.Label lbScanSampleMore;
private System.Windows.Forms.Label lbScanSamples;
private System.Windows.Forms.Label lbPackageSampleMissCount;
private System.Windows.Forms.Label lbPackageSamplesCount;
private System.Windows.Forms.Label lbPackageSampleMiss;
private System.Windows.Forms.Label lbPackageSamples;
}
}
......@@ -225,10 +225,6 @@ namespace Kivii.Client.SampleInbounds
_currentTotalEpcs.Add(epc);
samplePreAssigning(null, epc);
}
this.Invoke(new Action(delegate
{
outputMessage($"共扫描到:{_currentTotalEpcs.Count}个Rfid。");
}));
break;
case 0x74:
ReaderExtension.ProcessSetWorkAntenna(msgTran, reader, currentInventoryBuffer, currentSetting, m_bInventory);
......@@ -378,17 +374,17 @@ namespace Kivii.Client.SampleInbounds
btnClearCurrentPackage.Enabled = _currentPackage != null;
//cbSetCurrentPackageNode.Enabled = _currentPackage.Status == (int)PackageStatus.Empty || _currentPackage.Status == (int)PackageStatus.Full;
//btnScanRfid.Enabled = _currentPackage.Status == (int)PackageStatus.Full;
btnSampleAssign.Enabled = _currentPackage.Status == (int)PackageStatus.Full;
btnSampleAssign.Enabled = _currentPackage.Status != (int)PackageStatus.Inbound;
//tbScanSample.Enabled = _currentPackage.Status == (int)PackageStatus.Full;
//tbScanSample.Text = "";
if (_currentPackage.Status != (int)PackageStatus.Empty)
{
querySampleInPackaged();
}
if (_currentPackage.Status != (int)PackageStatus.Full)
if (_currentPackage.Status == (int)PackageStatus.Inbound)
{
lbCurrentPackageStatus.Text = _currentPackage.Status == (int)PackageStatus.Inbound ? "当前箱子已入库" : "当前箱子无样品";
outputMessage($"当前箱子为{(_currentPackage.Status == (int)PackageStatus.Inbound ? "已入库" : "空闲")}状态,无法继续操作!");
lbCurrentPackageStatus.Text = "当前箱子已入库";
outputMessage($"当前箱子为已入库状态,无法继续操作!");
return;
}
Thread.Sleep(200);
......@@ -456,6 +452,8 @@ namespace Kivii.Client.SampleInbounds
this.Invoke(new Action(delegate
{
dgvSamples.DataSource = null;
lbPackageSamplesCount.Text = "0";
lbPackageSampleMissCount.Text = "0";
}));
var request = new SampleQuery2();
request.PackageKvid = _currentPackage.Kvid;
......@@ -486,6 +484,8 @@ namespace Kivii.Client.SampleInbounds
{
if (index != -1) cbSetCurrentPackageOwner.SelectedIndex = index;
dgvSamples.DataSource = _currentPackageSamples;
lbPackageSamplesCount.Text = _currentPackageSamples.Count.ToString();
lbPackageSampleMissCount.Text = _currentPackageSamples.Where(o => !o.IsMatched).Count().ToString();
}));
outputMessage($"成功查询到箱号:{_currentPackage.Name}{_currentPackageSamples.Count}件样品!");
});
......@@ -530,6 +530,8 @@ namespace Kivii.Client.SampleInbounds
this.Invoke(new Action(delegate
{
dgvRfidSamples.DataSource = null;
lbScanSamplesCount.Text = "0";
lbScanSampleMoreCount.Text = "0";
}));
if (_currentScanSamples == null) _currentScanSamples = new List<Sample>();
if (!_currentPackageSamples.IsNullOrEmpty())
......@@ -549,15 +551,20 @@ namespace Kivii.Client.SampleInbounds
this.Invoke(new Action(delegate
{
dgvSamples.DataSource = _currentPackageSamples;
lbPackageSamplesCount.Text = _currentPackageSamples.Count.ToString();
lbPackageSampleMissCount.Text = _currentPackageSamples.Where(o => !o.IsMatched).Count().ToString();
}));
}
if (!_currentScanSamples.Exists(o => o.Kvid == record.Kvid))
{
_currentScanSamples.Add(record);
outputMessage($"扫描结果增加:报告号[{record.BizId}]");
}
this.Invoke(new Action(delegate
{
dgvRfidSamples.DataSource = _currentScanSamples;
lbScanSamplesCount.Text = _currentScanSamples.Count.ToString();
lbScanSampleMoreCount.Text = _currentScanSamples.Where(o => !o.IsMatched).Count().ToString();
}));
//sampleAssigning(record);
}
......@@ -793,6 +800,10 @@ namespace Kivii.Client.SampleInbounds
btnClearCurrentPackage.Enabled = false;
//btnScanRfid.Enabled = false;
btnSampleAssign.Enabled = false;
lbPackageSamplesCount.Text = "0";
lbPackageSampleMissCount.Text = "0";
lbScanSamplesCount.Text = "0";
lbScanSampleMoreCount.Text = "0";
//tbScanSample.Enabled = false;
//tbScanSample.Text = "";
lbCurrentPackageStatus.Text = "";
......@@ -824,17 +835,17 @@ namespace Kivii.Client.SampleInbounds
private void dgvRfidSamples_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
dgvSamples.TopLeftHeaderCell.Value = "序号";
dgvRfidSamples.TopLeftHeaderCell.Value = "序号";
//自动编号,与数据无关
Rectangle rectangle = new Rectangle(e.RowBounds.Location.X,
e.RowBounds.Location.Y,
dgvSamples.RowHeadersWidth - 4,
dgvRfidSamples.RowHeadersWidth - 4,
e.RowBounds.Height);
TextRenderer.DrawText(e.Graphics,
(e.RowIndex + 1).ToString(),
dgvSamples.RowHeadersDefaultCellStyle.Font,
dgvRfidSamples.RowHeadersDefaultCellStyle.Font,
rectangle,
dgvSamples.RowHeadersDefaultCellStyle.ForeColor,
dgvRfidSamples.RowHeadersDefaultCellStyle.ForeColor,
TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment