Commit 79219ffa 刘韬

1

1 个父辈 2f5785f4
......@@ -157,6 +157,10 @@ namespace DeviceLibrary
if (reelLocation.isTower=="1")
{
MoveInfo.ReelParam.ReelDest = ReelDest.Tower;
if (ConfigHelper.Config.Get<bool>("ForceVTTower",false)) {
MoveInfo.log("强制转到VTTOWER");
MoveInfo.ReelParam.ReelDest = ReelDest.VT_Tower;
}
}
else if (reelLocation.isVTTower == "1")
{
......
......@@ -37,7 +37,7 @@ namespace DeviceLibrary
retry:
try
{
result = wc.UploadString(inputCounterDataByXRayMachine_URL, "POST", json);
result = wc.UploadString(ConfigHelper.Config.Get("inputCounterDataByXRayMachine"), "POST", json);
return JsonHelper.DeserializeJsonToObject<CountResult>(result);
}
catch (Exception e)
......@@ -76,7 +76,7 @@ namespace DeviceLibrary
retry:
try
{
result = wc.UploadString(DetermineReelStorageLocation_URL, "POST", json);
result = wc.UploadString(ConfigHelper.Config.Get("DetermineReelStorageLocation"), "POST", json);
return JsonHelper.DeserializeJsonToObject<ReelLocation>(result);
}
catch (Exception e)
......
......@@ -202,7 +202,6 @@ namespace AutoCountMachine
//
// configControl1
//
this.configControl1.Config = null;
this.configControl1.Location = new System.Drawing.Point(3, 3);
this.configControl1.Name = "configControl1";
this.configControl1.Size = new System.Drawing.Size(663, 293);
......
......@@ -51,7 +51,6 @@ namespace AutoCountMachine
this.tabPage1 = new System.Windows.Forms.TabPage();
this.label_Productivity = new System.Windows.Forms.Label();
this.btn_PauseBuzzer = new System.Windows.Forms.Button();
this.boxResetControl1 = new AutoCountMachine.BoxResetControl();
this.cmb_runmode = new System.Windows.Forms.ComboBox();
this.btn_releaseshelf = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
......@@ -59,10 +58,11 @@ namespace AutoCountMachine
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.stateView = new System.Windows.Forms.ListView();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.settingControl1 = new AutoCountMachine.SettingControl();
this.btn_stop = new System.Windows.Forms.Button();
this.btn_run = new System.Windows.Forms.Button();
this.listView1 = new System.Windows.Forms.ListView();
this.boxResetControl1 = new AutoCountMachine.BoxResetControl();
this.settingControl1 = new AutoCountMachine.SettingControl();
this.menuStrip1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
......@@ -260,16 +260,6 @@ namespace AutoCountMachine
this.btn_PauseBuzzer.Visible = false;
this.btn_PauseBuzzer.Click += new System.EventHandler(this.btn_PauseBuzzer_Click);
//
// boxResetControl1
//
this.boxResetControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.boxResetControl1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.boxResetControl1.Location = new System.Drawing.Point(790, 249);
this.boxResetControl1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.boxResetControl1.Name = "boxResetControl1";
this.boxResetControl1.Size = new System.Drawing.Size(207, 279);
this.boxResetControl1.TabIndex = 5;
//
// cmb_runmode
//
this.cmb_runmode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
......@@ -353,21 +343,12 @@ namespace AutoCountMachine
this.tabPage2.Controls.Add(this.settingControl1);
this.tabPage2.Location = new System.Drawing.Point(4, 30);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.tabPage2.Size = new System.Drawing.Size(748, 460);
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(1000, 606);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "设置";
this.tabPage2.UseVisualStyleBackColor = true;
//
// settingControl1
//
this.settingControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.settingControl1.Location = new System.Drawing.Point(3, 3);
this.settingControl1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.settingControl1.Name = "settingControl1";
this.settingControl1.Size = new System.Drawing.Size(742, 454);
this.settingControl1.TabIndex = 0;
//
// btn_stop
//
this.btn_stop.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......@@ -401,10 +382,29 @@ namespace AutoCountMachine
this.listView1.MultiSelect = false;
this.listView1.Name = "listView1";
this.listView1.ShowGroups = false;
this.listView1.Size = new System.Drawing.Size(660, 111);
this.listView1.Size = new System.Drawing.Size(660, 118);
this.listView1.TabIndex = 7;
this.listView1.UseCompatibleStateImageBehavior = false;
//
// boxResetControl1
//
this.boxResetControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.boxResetControl1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.boxResetControl1.Location = new System.Drawing.Point(790, 249);
this.boxResetControl1.Margin = new System.Windows.Forms.Padding(5);
this.boxResetControl1.Name = "boxResetControl1";
this.boxResetControl1.Size = new System.Drawing.Size(207, 279);
this.boxResetControl1.TabIndex = 5;
//
// settingControl1
//
this.settingControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.settingControl1.Location = new System.Drawing.Point(3, 3);
this.settingControl1.Margin = new System.Windows.Forms.Padding(5);
this.settingControl1.Name = "settingControl1";
this.settingControl1.Size = new System.Drawing.Size(994, 600);
this.settingControl1.TabIndex = 0;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......
......@@ -242,7 +242,6 @@ namespace AutoCountMachine
//
// configControl1
//
this.configControl1.Config = null;
this.configControl1.Location = new System.Drawing.Point(558, 3);
this.configControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.configControl1.Name = "configControl1";
......
......@@ -60,6 +60,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
......@@ -103,6 +104,12 @@
<Compile Include="UCCOMMON\FrmPassword.Designer.cs">
<DependentUpon>FrmPassword.cs</DependentUpon>
</Compile>
<Compile Include="UCCOMMON\NBDTControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UCCOMMON\NBDTControl.Designer.cs">
<DependentUpon>NBDTControl.cs</DependentUpon>
</Compile>
<Compile Include="UCCOMMON\Role.cs" />
<Compile Include="SettingControl.cs">
<SubType>UserControl</SubType>
......@@ -200,6 +207,9 @@
<EmbeddedResource Include="SettingControl.resx">
<DependentUpon>SettingControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UCCOMMON\NBDTControl.resx">
<DependentUpon>NBDTControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="XrayControl.resx">
<DependentUpon>XrayControl.cs</DependentUpon>
</EmbeddedResource>
......
......@@ -32,6 +32,9 @@ namespace AutoCountMachine
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.panel1 = new System.Windows.Forms.Panel();
this.btn_search = new System.Windows.Forms.Button();
this.textBox_search = new System.Windows.Forms.TextBox();
this.comboBox_searchtype = new System.Windows.Forms.ComboBox();
this.label_count = new System.Windows.Forms.Label();
this.dateTimePicker_end = new System.Windows.Forms.DateTimePicker();
this.dateTimePicker_start = new System.Windows.Forms.DateTimePicker();
......@@ -46,19 +49,20 @@ namespace AutoCountMachine
this.btn_setadminpassword = new System.Windows.Forms.Button();
this.cb_autorun = new System.Windows.Forms.CheckBox();
this.cb_EnableBuzzer = new System.Windows.Forms.CheckBox();
this.comboBox_searchtype = new System.Windows.Forms.ComboBox();
this.textBox_search = new System.Windows.Forms.TextBox();
this.btn_search = new System.Windows.Forms.Button();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.nbdtControl1 = new AutoCountMachine.UCCOMMON.NBDTControl();
this.tabControl1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.tabPage1.SuspendLayout();
this.tabPage3.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0);
......@@ -100,6 +104,36 @@ namespace AutoCountMachine
this.panel1.Size = new System.Drawing.Size(758, 529);
this.panel1.TabIndex = 2;
//
// btn_search
//
this.btn_search.Location = new System.Drawing.Point(513, 474);
this.btn_search.Name = "btn_search";
this.btn_search.Size = new System.Drawing.Size(75, 23);
this.btn_search.TabIndex = 6;
this.btn_search.Text = "Search";
this.btn_search.UseVisualStyleBackColor = true;
this.btn_search.Click += new System.EventHandler(this.btn_search_Click);
//
// textBox_search
//
this.textBox_search.Location = new System.Drawing.Point(384, 448);
this.textBox_search.Name = "textBox_search";
this.textBox_search.Size = new System.Drawing.Size(204, 21);
this.textBox_search.TabIndex = 5;
//
// comboBox_searchtype
//
this.comboBox_searchtype.DisplayMember = "PartNumber";
this.comboBox_searchtype.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox_searchtype.FormattingEnabled = true;
this.comboBox_searchtype.Items.AddRange(new object[] {
"PartNumber",
"ReelID"});
this.comboBox_searchtype.Location = new System.Drawing.Point(384, 423);
this.comboBox_searchtype.Name = "comboBox_searchtype";
this.comboBox_searchtype.Size = new System.Drawing.Size(98, 20);
this.comboBox_searchtype.TabIndex = 4;
//
// label_count
//
this.label_count.AutoSize = true;
......@@ -264,35 +298,24 @@ namespace AutoCountMachine
this.cb_EnableBuzzer.UseVisualStyleBackColor = true;
this.cb_EnableBuzzer.CheckedChanged += new System.EventHandler(this.cb_EnableBuzzer_CheckedChanged);
//
// comboBox_searchtype
// tabPage3
//
this.comboBox_searchtype.DisplayMember = "PartNumber";
this.comboBox_searchtype.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox_searchtype.FormattingEnabled = true;
this.comboBox_searchtype.Items.AddRange(new object[] {
"PartNumber",
"ReelID"});
this.comboBox_searchtype.Location = new System.Drawing.Point(384, 423);
this.comboBox_searchtype.Name = "comboBox_searchtype";
this.comboBox_searchtype.Size = new System.Drawing.Size(98, 20);
this.comboBox_searchtype.TabIndex = 4;
this.tabPage3.Controls.Add(this.nbdtControl1);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
this.tabPage3.Size = new System.Drawing.Size(764, 535);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "流程配置";
this.tabPage3.UseVisualStyleBackColor = true;
//
// textBox_search
//
this.textBox_search.Location = new System.Drawing.Point(384, 448);
this.textBox_search.Name = "textBox_search";
this.textBox_search.Size = new System.Drawing.Size(204, 21);
this.textBox_search.TabIndex = 5;
//
// btn_search
// nbdtControl1
//
this.btn_search.Location = new System.Drawing.Point(513, 474);
this.btn_search.Name = "btn_search";
this.btn_search.Size = new System.Drawing.Size(75, 23);
this.btn_search.TabIndex = 6;
this.btn_search.Text = "Search";
this.btn_search.UseVisualStyleBackColor = true;
this.btn_search.Click += new System.EventHandler(this.btn_search_Click);
this.nbdtControl1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.nbdtControl1.Location = new System.Drawing.Point(3, 3);
this.nbdtControl1.Name = "nbdtControl1";
this.nbdtControl1.Size = new System.Drawing.Size(891, 481);
this.nbdtControl1.TabIndex = 0;
//
// SettingControl
//
......@@ -308,6 +331,7 @@ namespace AutoCountMachine
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.tabPage3.ResumeLayout(false);
this.ResumeLayout(false);
}
......@@ -334,5 +358,7 @@ namespace AutoCountMachine
private System.Windows.Forms.ComboBox comboBox_searchtype;
private System.Windows.Forms.Button btn_search;
private System.Windows.Forms.TextBox textBox_search;
private System.Windows.Forms.TabPage tabPage3;
private UCCOMMON.NBDTControl nbdtControl1;
}
}
......@@ -84,13 +84,12 @@ namespace AutoCountMachine
{
if (DesignMode)
return;
cb_EnableBuzzer.Checked = Config.Get("EnableBuzzer", true);
cb_autorun.Checked = Config.Get("App_AutoRun", false);
this.cb_autorun.CheckedChanged += new System.EventHandler(this.cb_autorun_CheckedChanged);
rb_datafilter_today.Checked = true;
}
private void RoleManger_RoleChange(object sender, Role e)
......
......@@ -486,7 +486,6 @@ namespace AutoCountMachine
//
// ioControl1
//
this.ioControl1.Config = null;
this.ioControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ioControl1.Location = new System.Drawing.Point(3, 3);
this.ioControl1.Margin = new System.Windows.Forms.Padding(4);
......@@ -497,7 +496,6 @@ namespace AutoCountMachine
//
// configControl1
//
this.configControl1.Config = null;
this.configControl1.Location = new System.Drawing.Point(565, 12);
this.configControl1.Name = "configControl1";
this.configControl1.Size = new System.Drawing.Size(688, 422);
......
......@@ -43,33 +43,33 @@ namespace AutoCountMachine
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(16, 6);
this.label1.Location = new System.Drawing.Point(4, 6);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 12);
this.label1.Size = new System.Drawing.Size(49, 14);
this.label1.TabIndex = 1;
this.label1.Text = "NG料箱";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(138, 6);
this.label2.Location = new System.Drawing.Point(140, 6);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(47, 12);
this.label2.Size = new System.Drawing.Size(56, 14);
this.label2.TabIndex = 1;
this.label2.Text = "MSD料箱";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(71, 6);
this.label3.Location = new System.Drawing.Point(64, 6);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(59, 12);
this.label3.Size = new System.Drawing.Size(70, 14);
this.label3.TabIndex = 1;
this.label3.Text = "Paper料箱";
//
// btn_NGClear
//
this.btn_NGClear.Location = new System.Drawing.Point(16, 121);
this.btn_NGClear.Location = new System.Drawing.Point(12, 130);
this.btn_NGClear.Name = "btn_NGClear";
this.btn_NGClear.Size = new System.Drawing.Size(45, 40);
this.btn_NGClear.TabIndex = 2;
......@@ -79,7 +79,7 @@ namespace AutoCountMachine
//
// btn_MSDClear
//
this.btn_MSDClear.Location = new System.Drawing.Point(141, 121);
this.btn_MSDClear.Location = new System.Drawing.Point(146, 130);
this.btn_MSDClear.Name = "btn_MSDClear";
this.btn_MSDClear.Size = new System.Drawing.Size(45, 40);
this.btn_MSDClear.TabIndex = 2;
......@@ -89,7 +89,7 @@ namespace AutoCountMachine
//
// btn_PaperClear
//
this.btn_PaperClear.Location = new System.Drawing.Point(78, 121);
this.btn_PaperClear.Location = new System.Drawing.Point(79, 130);
this.btn_PaperClear.Name = "btn_PaperClear";
this.btn_PaperClear.Size = new System.Drawing.Size(45, 40);
this.btn_PaperClear.TabIndex = 2;
......@@ -99,14 +99,14 @@ namespace AutoCountMachine
//
// PaperCountBar
//
this.PaperCountBar.Location = new System.Drawing.Point(78, 21);
this.PaperCountBar.Location = new System.Drawing.Point(79, 30);
this.PaperCountBar.Name = "PaperCountBar";
this.PaperCountBar.Size = new System.Drawing.Size(45, 94);
this.PaperCountBar.TabIndex = 0;
//
// MsdCountBar
//
this.MsdCountBar.Location = new System.Drawing.Point(141, 21);
this.MsdCountBar.Location = new System.Drawing.Point(146, 30);
this.MsdCountBar.Name = "MsdCountBar";
this.MsdCountBar.Size = new System.Drawing.Size(45, 94);
this.MsdCountBar.TabIndex = 0;
......@@ -114,7 +114,7 @@ namespace AutoCountMachine
// NgCountBar
//
this.NgCountBar.ForeColor = System.Drawing.Color.MediumSeaGreen;
this.NgCountBar.Location = new System.Drawing.Point(16, 21);
this.NgCountBar.Location = new System.Drawing.Point(12, 30);
this.NgCountBar.MarqueeAnimationSpeed = 0;
this.NgCountBar.Name = "NgCountBar";
this.NgCountBar.Size = new System.Drawing.Size(45, 94);
......@@ -122,8 +122,7 @@ namespace AutoCountMachine
//
// BoxResetControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.btn_PaperClear);
this.Controls.Add(this.btn_MSDClear);
this.Controls.Add(this.btn_NGClear);
......@@ -133,6 +132,7 @@ namespace AutoCountMachine
this.Controls.Add(this.PaperCountBar);
this.Controls.Add(this.MsdCountBar);
this.Controls.Add(this.NgCountBar);
this.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "BoxResetControl";
this.Size = new System.Drawing.Size(324, 316);
this.ResumeLayout(false);
......
......@@ -38,6 +38,7 @@ namespace AutoCountMachine
private void Crc_LanguageChangeEvent(object sender, EventArgs e)
{
if (Config!=null)
LoadPosList();
}
......

namespace AutoCountMachine.UCCOMMON
{
partial class NBDTControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.button_modify = new System.Windows.Forms.Button();
this.button_apply = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label_print = new System.Windows.Forms.Label();
this.label_count = new System.Windows.Forms.Label();
this.comboBox_configlist = new System.Windows.Forms.ComboBox();
this.label_current = new System.Windows.Forms.Label();
this.checkBox_forcevttower = new System.Windows.Forms.CheckBox();
this.textBox_count = new System.Windows.Forms.TextBox();
this.textBox_print = new System.Windows.Forms.TextBox();
this.label_name = new System.Windows.Forms.Label();
this.textBox_name = new System.Windows.Forms.TextBox();
this.button_add = new System.Windows.Forms.Button();
this.button_del = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// button_modify
//
this.button_modify.Location = new System.Drawing.Point(308, 182);
this.button_modify.Name = "button_modify";
this.button_modify.Size = new System.Drawing.Size(87, 27);
this.button_modify.TabIndex = 9;
this.button_modify.Text = "修改配置";
this.button_modify.UseVisualStyleBackColor = true;
this.button_modify.Click += new System.EventHandler(this.button_modify_Click);
//
// button_apply
//
this.button_apply.Location = new System.Drawing.Point(215, 182);
this.button_apply.Name = "button_apply";
this.button_apply.Size = new System.Drawing.Size(87, 27);
this.button_apply.TabIndex = 10;
this.button_apply.Text = "应用配置";
this.button_apply.UseVisualStyleBackColor = true;
this.button_apply.Click += new System.EventHandler(this.button_apply_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.textBox_print);
this.groupBox1.Controls.Add(this.button_del);
this.groupBox1.Controls.Add(this.button_add);
this.groupBox1.Controls.Add(this.textBox_name);
this.groupBox1.Controls.Add(this.textBox_count);
this.groupBox1.Controls.Add(this.label_print);
this.groupBox1.Controls.Add(this.label_name);
this.groupBox1.Controls.Add(this.label_count);
this.groupBox1.Location = new System.Drawing.Point(3, 219);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(660, 282);
this.groupBox1.TabIndex = 8;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "添加或修改流程配置";
//
// label_print
//
this.label_print.AutoSize = true;
this.label_print.Location = new System.Drawing.Point(27, 149);
this.label_print.Name = "label_print";
this.label_print.Size = new System.Drawing.Size(161, 14);
this.label_print.TabIndex = 0;
this.label_print.Text = "标签打印/分盘数据接口:";
//
// label_count
//
this.label_count.AutoSize = true;
this.label_count.Location = new System.Drawing.Point(27, 87);
this.label_count.Name = "label_count";
this.label_count.Size = new System.Drawing.Size(126, 14);
this.label_count.TabIndex = 0;
this.label_count.Text = "点料数据上传接口:";
//
// comboBox_configlist
//
this.comboBox_configlist.FormattingEnabled = true;
this.comboBox_configlist.Location = new System.Drawing.Point(3, 185);
this.comboBox_configlist.Name = "comboBox_configlist";
this.comboBox_configlist.Size = new System.Drawing.Size(202, 22);
this.comboBox_configlist.TabIndex = 7;
//
// label_current
//
this.label_current.Location = new System.Drawing.Point(1, 38);
this.label_current.Name = "label_current";
this.label_current.Size = new System.Drawing.Size(721, 131);
this.label_current.TabIndex = 6;
this.label_current.Text = "当前配置:";
//
// checkBox_forcevttower
//
this.checkBox_forcevttower.AutoSize = true;
this.checkBox_forcevttower.Location = new System.Drawing.Point(3, 0);
this.checkBox_forcevttower.Name = "checkBox_forcevttower";
this.checkBox_forcevttower.Size = new System.Drawing.Size(152, 18);
this.checkBox_forcevttower.TabIndex = 5;
this.checkBox_forcevttower.Text = "强制流转到VT Tower";
this.checkBox_forcevttower.UseVisualStyleBackColor = true;
//
// textBox_count
//
this.textBox_count.Location = new System.Drawing.Point(29, 105);
this.textBox_count.Name = "textBox_count";
this.textBox_count.Size = new System.Drawing.Size(588, 23);
this.textBox_count.TabIndex = 1;
//
// textBox_print
//
this.textBox_print.Location = new System.Drawing.Point(29, 167);
this.textBox_print.Name = "textBox_print";
this.textBox_print.Size = new System.Drawing.Size(588, 23);
this.textBox_print.TabIndex = 1;
//
// label_name
//
this.label_name.AutoSize = true;
this.label_name.Location = new System.Drawing.Point(27, 34);
this.label_name.Name = "label_name";
this.label_name.Size = new System.Drawing.Size(98, 14);
this.label_name.TabIndex = 0;
this.label_name.Text = "流程配置名称:";
//
// textBox_name
//
this.textBox_name.Location = new System.Drawing.Point(29, 51);
this.textBox_name.Name = "textBox_name";
this.textBox_name.Size = new System.Drawing.Size(207, 23);
this.textBox_name.TabIndex = 1;
//
// button_add
//
this.button_add.Location = new System.Drawing.Point(497, 225);
this.button_add.Name = "button_add";
this.button_add.Size = new System.Drawing.Size(121, 27);
this.button_add.TabIndex = 10;
this.button_add.Text = "添加/修改";
this.button_add.UseVisualStyleBackColor = true;
this.button_add.Click += new System.EventHandler(this.button_add_Click);
//
// button_del
//
this.button_del.Location = new System.Drawing.Point(29, 225);
this.button_del.Name = "button_del";
this.button_del.Size = new System.Drawing.Size(121, 27);
this.button_del.TabIndex = 10;
this.button_del.Text = "删除";
this.button_del.UseVisualStyleBackColor = true;
this.button_del.Click += new System.EventHandler(this.button_del_Click);
//
// NBDTControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.button_modify);
this.Controls.Add(this.button_apply);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.comboBox_configlist);
this.Controls.Add(this.label_current);
this.Controls.Add(this.checkBox_forcevttower);
this.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "NBDTControl";
this.Size = new System.Drawing.Size(891, 481);
this.Load += new System.EventHandler(this.NBDTControl_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button_modify;
private System.Windows.Forms.Button button_apply;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label_print;
private System.Windows.Forms.Label label_count;
private System.Windows.Forms.ComboBox comboBox_configlist;
private System.Windows.Forms.Label label_current;
private System.Windows.Forms.CheckBox checkBox_forcevttower;
private System.Windows.Forms.TextBox textBox_print;
private System.Windows.Forms.TextBox textBox_count;
private System.Windows.Forms.TextBox textBox_name;
private System.Windows.Forms.Label label_name;
private System.Windows.Forms.Button button_del;
private System.Windows.Forms.Button button_add;
}
}
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AutoCountMachine.UCCOMMON
{
using crc = OnlineStore.CodeResourceControl;
public partial class NBDTControl : UserControl
{
public NBDTControl()
{
InitializeComponent();
}
private void NBDTControl_Load(object sender, EventArgs e)
{
ConfigHelper.Config.PropertyBind<bool>("ForceVTTower", checkBox_forcevttower, "Checked", "CheckedChanged", false);
Loadnbdtconfig();
}
List<NBDTConfig> NBDTConfigs;
void Loadnbdtconfig() {
if (!File.Exists("Config\\NBDT.json"))
{
NBDTConfigs = new List<NBDTConfig>();
Savenbdtconfig();
}
var txt = File.ReadAllText("Config\\NBDT.json");
NBDTConfigs = JsonConvert.DeserializeObject<List<NBDTConfig>>(txt);
comboBox_configlist.Items.Clear();
comboBox_configlist.Items.Add(crc.GetString("SFCS_select_config","请选择配置"));
NBDTConfigs.ForEach(c => comboBox_configlist.Items.Add(c.Name));
comboBox_configlist.SelectedIndex = 0;
ShowCurrnet();
}
void Savenbdtconfig() {
var txt = JsonConvert.SerializeObject(NBDTConfigs);
File.WriteAllText("Config\\NBDT.json",txt);
}
struct NBDTConfig {
public string Name;
public string inputCounterDataByXRayMachine;
public string DetermineReelStorageLocation;
}
private void button_apply_Click(object sender, EventArgs e)
{
if (comboBox_configlist.SelectedIndex <= 0)
return;
var name = comboBox_configlist.SelectedItem.ToString();
var cfg = NBDTConfigs.Find(c => c.Name == name);
ConfigHelper.Config.Set("SFCSName", cfg.Name);
ConfigHelper.Config.Set("inputCounterDataByXRayMachine", cfg.inputCounterDataByXRayMachine);
ConfigHelper.Config.Set("DetermineReelStorageLocation", cfg.DetermineReelStorageLocation);
ShowCurrnet();
}
void ShowCurrnet() {
label_current.Text = crc.GetString("SFCS_current_config", "当前配置") + ":"
+ crc.GetString("SFCS_config_name", "配置名称")+ ":" + ConfigHelper.Config.Get("SFCSName") + "\n\n"
+ " "+ crc.GetString("SFCS_config_addr1", "点料数据上传接口") + ":" + "\n\n"
+ " "+ ConfigHelper.Config.Get("inputCounterDataByXRayMachine") + "\n\n"
+ " " + crc.GetString("SFCS_config_addr2", "标签打印/分盘接口") + ":" + "\n\n"
+ " "+ ConfigHelper.Config.Get("DetermineReelStorageLocation")
;
}
private void button_add_Click(object sender, EventArgs e)
{
var name = textBox_name.Text.Trim();
NBDTConfig nBDTConfig = new NBDTConfig();
nBDTConfig.Name = name;
nBDTConfig.inputCounterDataByXRayMachine = textBox_count.Text.Trim();
nBDTConfig.DetermineReelStorageLocation = textBox_print.Text.Trim();
var cc = NBDTConfigs.FindIndex(c => c.Name == name);
if (cc >= 0)
{
NBDTConfigs[cc]=nBDTConfig;
}
else
NBDTConfigs.Add(nBDTConfig);
Savenbdtconfig();
Loadnbdtconfig();
}
private void button_modify_Click(object sender, EventArgs e)
{
if (comboBox_configlist.SelectedIndex <= 0)
return;
var name = comboBox_configlist.SelectedItem.ToString();
var cc = NBDTConfigs.FindIndex(c => c.Name == name);
if (cc < 0)
return;
var nBDTConfig = NBDTConfigs[cc];
textBox_name.Text = nBDTConfig.Name;
textBox_count.Text = nBDTConfig.inputCounterDataByXRayMachine;
textBox_print.Text = nBDTConfig.DetermineReelStorageLocation;
}
private void button_del_Click(object sender, EventArgs e)
{
var name = textBox_name.Text.Trim();
if (string.IsNullOrWhiteSpace(name))
return;
var cc = NBDTConfigs.FindIndex(c => c.Name == name);
if (cc >= 0)
{
NBDTConfigs.RemoveAt(cc);
textBox_name.Text = "";
textBox_count.Text = "";
textBox_print.Text = "";
}
Savenbdtconfig();
Loadnbdtconfig();
}
}
}
<?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>
\ No newline at end of file
......@@ -180,7 +180,6 @@ namespace AutoCountMachine
//
// configControl1
//
this.configControl1.Config = null;
this.configControl1.Location = new System.Drawing.Point(559, 3);
this.configControl1.Name = "configControl1";
this.configControl1.Size = new System.Drawing.Size(653, 504);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!