| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170 |
- using Metis.ParameterSet;
- using OpenCvSharp;
- using PaintDotNet.Base;
- using PaintDotNet.Base.CommTool;
- using PaintDotNet.Data.Param;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.Linq;
- using System.Windows.Forms;
- //using OpenCvSharp.Extensions;
- namespace PaintDotNet.DedicatedAnalysis.PetroleumGeology.SYT6103
- {
- internal class MethodADialog : PetroleumGeologyStandardDialog
- {
- /// <summary>
- /// 测定结果暂存
- /// </summary>
- private List<DataTable> dataTable1s = new List<DataTable>();
- /// <summary>
- /// 储存点击保存结果后的所有原图与分析图
- /// </summary>
- private Dictionary<string, List<Bitmap>> bitCeDingDic = new Dictionary<string, List<Bitmap>>();
- // <summary>
- /// 保存窗口参数 range
- /// </summary>
- private GrainSizeAnalysisModel analysisModel;
- private const string ParamKey_Report = "report";//报告设置
- private const string ParamKey_SortMicron = "sortMicron";//分类微米
- private const string ParamKey_SortDiam = "sortDiam";//分类直径
- private const string ParamKey_LongDiam = "longDiam";//长径
- private const string ParamKey_ShortDiam = "shortDiam";//短径
- private const string ParamKey_AvgDiam = "avgDiam";//平均径
- private const string ParamKey_EqualDiam = "equalDiam";//等效圆直径
- private const string ParamKey_Threshold = "threshold";//喉道阈值
- private const string ParamKey_Number = "number";//显示孔隙编号
- private const string ParamKey_NumberFontSize = "numberFontSize";//编号字体大小
- private const string ParamKey_NumberColour = "numberColour";//编号颜色
- private const string ParamKey_Diameter = "diameter";//显示孔隙直径
- private const string ParamKey_DiameterFontSize = "diameterFontSize";//直径字体大小
- private const string ParamKey_DiameterColour = "diameterColour";//直径颜色
- private const string ParamKey_DecimalPlace = "decimalPlace";//保留小数位数
- #region 组件
- private DataGridViewTextBoxColumn Column11;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
- private GroupBox groupBox1;
- private GroupBox groupBox2;
- private Label label1;
- private Label label8;
- private RadioButton radioButton5;
- private RadioButton radioButton6;
- private RadioButton radioButton3;
- private RadioButton radioButton4;
- private RadioButton radioButton7;
- private RadioButton radioButton8;
- private Label label3;
- private Label label4;
- private TextBox textBox5;
- private Button button2;
- private DataGridView dataGridView1;
- private GroupBox groupBox3;
- private TextBox textBox1;
- private CheckBox checkBox2;
- private Label label5;
- private CheckBox checkBox1;
- private Label label7;
- private Panel panel3;
- private TextBox textBox2;
- private Label label9;
- private Label label6;
- private Panel panel1;
- private GroupBox groupBox5;
- private GroupBox groupBox4;
- private Button button3;
- /// <summary>
- /// 是否脚本运行
- /// </summary>
- private Boolean initScriptValues = false;
- #endregion 组件
- /// <summary>
- /// 构造函数
- /// </summary>
- /// <param name="appWorkspace"></param>
- /// <param name="dialogText"></param>
- public MethodADialog(AppWorkspace appWorkspace, string dialogText, PdnMenuItem menuItem) : base(appWorkspace, dialogText, false, menuItem)
- {
- string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GrainSizeAnalyze\\GrainSizeAnalysisModel.xml";
- GrainSizeAnalysisModel analysisModelXml = XmlSerializeHelper.DESerializer<GrainSizeAnalysisModel>(FileOperationHelper.ReadStringFromFile(filePath, System.IO.FileMode.Open));
- this.analysisModel = analysisModelXml.cloneListParamModel(this.menuId);
- foreach (var item in this.analysisModel.ListParam)
- item.setValue();
- //如果是脚本执行,将参数带入
- if (appWorkspace.ScriptRunning && appWorkspace.ScriptCurrentParam != null)
- {
- this.initScriptValues = true;//ScriptAutomatic
- //Boolean initScriptValues = true;
- ////在这里反射出对应功能的参数类
- string className = InvariantData.path_Action + ".Action" + menuId;
- ParamObject param = (ParamObject)System.Reflection.Assembly.Load(InvariantData.assembly_Data).CreateInstance(className);
- foreach (Args arg in param.Lists)
- {
- Args param1 = appWorkspace.ScriptCurrentParam.Lists.Find(m => m.Key.Equals(arg.Key));
- if (param1.value != null)
- arg.Value = param1.value;
- getValue(arg.key, arg.Value);
- }
- appWorkspace.ScriptCurrentParam = null;//阻止第二次进入仍然被赋值参数
- }
- else
- {//读取上次关闭窗口时保存的参数
- GetListParamModel();
- }
- }
- #region 初始化组件
- private void InitializeLanguageText()
- {
- this.checkBox1.Text = PdnResources.GetString("Menu.Displaypmeter.text");
- this.label5.Text = PdnResources.GetString("Menu.Fontsize.text") + ":";
- this.checkBox2.Text = PdnResources.GetString("Menu.Displayporediameter.text");
- this.label6.Text = PdnResources.GetString("Menu.color.text") + ":";
- this.label9.Text = PdnResources.GetString("Menu.Fontsize.text") + ":";
- this.label7.Text = PdnResources.GetString("Menu.color.text") + ":";
- this.groupBox3.Text = PdnResources.GetString("Menu.Displayparamssettings.text");
- this.label3.Text = PdnResources.GetString("Menu.Throatthreshold.text") + ":";
- this.button3.Text = PdnResources.GetString("Menu.Manualsegmentation.text");
- this.button2.Text = PdnResources.GetString("Menu.Automaticsegmentation.text");
- this.groupBox2.Text = PdnResources.GetString("Menu.Throatsegmentation.text");
- this.label8.Text = PdnResources.GetString("Menu.Classificationmethod.text") + ":";
- this.radioButton7.Text = PdnResources.GetString("Menu.Accordingtotheonofmicrons.text");
- this.radioButton8.Text = PdnResources.GetString("Menu.Accordingtotheclassificationofmicrons.text");
- this.label1.Text = PdnResources.GetString("Menu.Classificationofdiameter.text") + ":";
- this.radioButton3.Text = PdnResources.GetString("Menu.Equivalentcirculardiameter.text");
- this.radioButton6.Text = PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.majoraxis.text");
- this.radioButton4.Text = PdnResources.GetString("Menu.Theaveragediameter.text");
- this.radioButton5.Text = PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.short trail.text");
- this.groupBox1.Text = PdnResources.GetString("Menu.paramssettings.text");
- this.dataGridViewTextBoxColumn4.HeaderText = PdnResources.GetString("Menu.Gradeclassification.text");
- this.dataGridViewTextBoxColumn2.HeaderText = PdnResources.GetString("Menu.Apparentdiameterofparticle.text");
- this.dataGridViewTextBoxColumn1.HeaderText = PdnResources.GetString("Menu.Thethroatwidth.text");
- this.Column11.HeaderText = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.holearea.text");
- }
- private void InitializeComponent()
- {
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
- this.dataGridView1 = new System.Windows.Forms.DataGridView();
- this.Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.groupBox5 = new System.Windows.Forms.GroupBox();
- this.radioButton5 = new System.Windows.Forms.RadioButton();
- this.radioButton4 = new System.Windows.Forms.RadioButton();
- this.radioButton6 = new System.Windows.Forms.RadioButton();
- this.radioButton3 = new System.Windows.Forms.RadioButton();
- this.label1 = new System.Windows.Forms.Label();
- this.groupBox4 = new System.Windows.Forms.GroupBox();
- this.radioButton8 = new System.Windows.Forms.RadioButton();
- this.radioButton7 = new System.Windows.Forms.RadioButton();
- this.label8 = new System.Windows.Forms.Label();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.button2 = new System.Windows.Forms.Button();
- this.button3 = new System.Windows.Forms.Button();
- this.label4 = new System.Windows.Forms.Label();
- this.textBox5 = new System.Windows.Forms.TextBox();
- this.label3 = new System.Windows.Forms.Label();
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.label7 = new System.Windows.Forms.Label();
- this.panel3 = new System.Windows.Forms.Panel();
- this.textBox2 = new System.Windows.Forms.TextBox();
- this.label9 = new System.Windows.Forms.Label();
- this.label6 = new System.Windows.Forms.Label();
- this.panel1 = new System.Windows.Forms.Panel();
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.checkBox2 = new System.Windows.Forms.CheckBox();
- this.label5 = new System.Windows.Forms.Label();
- this.checkBox1 = new System.Windows.Forms.CheckBox();
- this.groupBox_report.SuspendLayout();
- this.groupBox_analysisResult1.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1_0)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
- this.groupBox1.SuspendLayout();
- this.groupBox5.SuspendLayout();
- this.groupBox4.SuspendLayout();
- this.groupBox2.SuspendLayout();
- this.groupBox3.SuspendLayout();
- this.SuspendLayout();
- //
- // dataGridView1
- //
- this.dataGridView1.AllowUserToAddRows = false;
- this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
- dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
- dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
- dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
- this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.Column11,
- this.dataGridViewTextBoxColumn1,
- this.dataGridViewTextBoxColumn2,
- this.dataGridViewTextBoxColumn4});
- this.dataGridView1.Location = new System.Drawing.Point(6, 36);
- this.dataGridView1.MultiSelect = false;
- this.dataGridView1.Name = "dataGridView1";
- this.dataGridView1.ReadOnly = true;
- this.dataGridView1.RowHeadersVisible = false;
- this.dataGridView1.RowTemplate.Height = 23;
- this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
- this.dataGridView1.Size = new System.Drawing.Size(341, 103);
- this.dataGridView1.TabIndex = 29;
- //
- // Column11
- //
- dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- this.Column11.DefaultCellStyle = dataGridViewCellStyle2;
- this.Column11.Name = "Column11";
- this.Column11.ReadOnly = true;
- this.Column11.Width = 66;
- //
- // dataGridViewTextBoxColumn1
- //
- dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle3;
- this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
- this.dataGridViewTextBoxColumn1.ReadOnly = true;
- //
- // dataGridViewTextBoxColumn2
- //
- dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle4;
- this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
- this.dataGridViewTextBoxColumn2.ReadOnly = true;
- //
- // dataGridViewTextBoxColumn4
- //
- dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle5;
- this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
- this.dataGridViewTextBoxColumn4.ReadOnly = true;
- this.dataGridViewTextBoxColumn4.Width = 72;
- //
- // groupBox1
- //
- this.groupBox1.Controls.Add(this.groupBox5);
- this.groupBox1.Controls.Add(this.label1);
- this.groupBox1.Controls.Add(this.groupBox4);
- this.groupBox1.Controls.Add(this.label8);
- this.groupBox1.Location = new System.Drawing.Point(179, 365);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(360, 96);
- this.groupBox1.TabIndex = 41;
- this.groupBox1.TabStop = false;
- //
- // groupBox5
- //
- this.groupBox5.Controls.Add(this.radioButton5);
- this.groupBox5.Controls.Add(this.radioButton4);
- this.groupBox5.Controls.Add(this.radioButton6);
- this.groupBox5.Controls.Add(this.radioButton3);
- this.groupBox5.Location = new System.Drawing.Point(79, 50);
- this.groupBox5.Name = "groupBox5";
- this.groupBox5.Size = new System.Drawing.Size(269, 40);
- this.groupBox5.TabIndex = 26;
- this.groupBox5.TabStop = false;
- //
- // radioButton5
- //
- this.radioButton5.AutoSize = true;
- this.radioButton5.Location = new System.Drawing.Point(65, 14);
- this.radioButton5.Name = "radioButton5";
- this.radioButton5.Size = new System.Drawing.Size(14, 13);
- this.radioButton5.TabIndex = 29;
- this.radioButton5.UseVisualStyleBackColor = true;
- this.radioButton5.CheckedChanged += new System.EventHandler(this.radioButton5_CheckedChanged);
- //
- // radioButton4
- //
- this.radioButton4.AutoSize = true;
- this.radioButton4.Location = new System.Drawing.Point(118, 14);
- this.radioButton4.Name = "radioButton4";
- this.radioButton4.Size = new System.Drawing.Size(14, 13);
- this.radioButton4.TabIndex = 26;
- this.radioButton4.UseVisualStyleBackColor = true;
- this.radioButton4.CheckedChanged += new System.EventHandler(this.radioButton4_CheckedChanged);
- //
- // radioButton6
- //
- this.radioButton6.AutoSize = true;
- this.radioButton6.Checked = true;
- this.radioButton6.Location = new System.Drawing.Point(9, 14);
- this.radioButton6.Name = "radioButton6";
- this.radioButton6.Size = new System.Drawing.Size(14, 13);
- this.radioButton6.TabIndex = 28;
- this.radioButton6.TabStop = true;
- this.radioButton6.UseVisualStyleBackColor = true;
- this.radioButton6.CheckedChanged += new System.EventHandler(this.radioButton6_CheckedChanged);
- //
- // radioButton3
- //
- this.radioButton3.AutoSize = true;
- this.radioButton3.Location = new System.Drawing.Point(183, 14);
- this.radioButton3.Name = "radioButton3";
- this.radioButton3.Size = new System.Drawing.Size(14, 13);
- this.radioButton3.TabIndex = 27;
- this.radioButton3.UseVisualStyleBackColor = true;
- this.radioButton3.CheckedChanged += new System.EventHandler(this.radioButton3_CheckedChanged);
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(6, 66);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(0, 12);
- this.label1.TabIndex = 23;
- //
- // groupBox4
- //
- this.groupBox4.Controls.Add(this.radioButton8);
- this.groupBox4.Controls.Add(this.radioButton7);
- this.groupBox4.Location = new System.Drawing.Point(79, 10);
- this.groupBox4.Name = "groupBox4";
- this.groupBox4.Size = new System.Drawing.Size(179, 40);
- this.groupBox4.TabIndex = 0;
- this.groupBox4.TabStop = false;
- //
- // radioButton8
- //
- this.radioButton8.AutoSize = true;
- this.radioButton8.Checked = true;
- this.radioButton8.Location = new System.Drawing.Point(6, 15);
- this.radioButton8.Name = "radioButton8";
- this.radioButton8.Size = new System.Drawing.Size(14, 13);
- this.radioButton8.TabIndex = 24;
- this.radioButton8.TabStop = true;
- this.radioButton8.UseVisualStyleBackColor = true;
- this.radioButton8.CheckedChanged += new System.EventHandler(this.radioButton8_CheckedChanged);
- //
- // radioButton7
- //
- this.radioButton7.AutoSize = true;
- this.radioButton7.Location = new System.Drawing.Point(89, 15);
- this.radioButton7.Name = "radioButton7";
- this.radioButton7.Size = new System.Drawing.Size(14, 13);
- this.radioButton7.TabIndex = 25;
- this.radioButton7.UseVisualStyleBackColor = true;
- this.radioButton7.CheckedChanged += new System.EventHandler(this.radioButton7_CheckedChanged);
- //
- // label8
- //
- this.label8.AutoSize = true;
- this.label8.Location = new System.Drawing.Point(6, 30);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(0, 12);
- this.label8.TabIndex = 22;
- //
- // groupBox2
- //
- this.groupBox2.Controls.Add(this.button2);
- this.groupBox2.Controls.Add(this.button3);
- this.groupBox2.Controls.Add(this.label4);
- this.groupBox2.Controls.Add(this.textBox5);
- this.groupBox2.Controls.Add(this.label3);
- this.groupBox2.Location = new System.Drawing.Point(179, 467);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(360, 53);
- this.groupBox2.TabIndex = 42;
- this.groupBox2.TabStop = false;
- //
- // button2
- //
- this.button2.Anchor = System.Windows.Forms.AnchorStyles.Right;
- this.button2.Location = new System.Drawing.Point(183, 19);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(75, 23);
- this.button2.TabIndex = 36;
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // button3
- //
- this.button3.Anchor = System.Windows.Forms.AnchorStyles.Right;
- this.button3.Location = new System.Drawing.Point(271, 19);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(75, 23);
- this.button3.TabIndex = 35;
- this.button3.UseVisualStyleBackColor = true;
- this.button3.Click += new System.EventHandler(this.button3_Click);
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(114, 25);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(23, 12);
- this.label4.TabIndex = 30;
- this.label4.Text = "μm";
- //
- // textBox5
- //
- this.textBox5.Location = new System.Drawing.Point(77, 21);
- this.textBox5.Name = "textBox5";
- this.textBox5.Size = new System.Drawing.Size(31, 21);
- this.textBox5.TabIndex = 34;
- this.textBox5.Text = "10";
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(6, 25);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(0, 12);
- this.label3.TabIndex = 30;
- //
- // groupBox3
- //
- this.groupBox3.Controls.Add(this.label7);
- this.groupBox3.Controls.Add(this.panel3);
- this.groupBox3.Controls.Add(this.textBox2);
- this.groupBox3.Controls.Add(this.label9);
- this.groupBox3.Controls.Add(this.label6);
- this.groupBox3.Controls.Add(this.panel1);
- this.groupBox3.Controls.Add(this.textBox1);
- this.groupBox3.Controls.Add(this.checkBox2);
- this.groupBox3.Controls.Add(this.label5);
- this.groupBox3.Controls.Add(this.checkBox1);
- this.groupBox3.Location = new System.Drawing.Point(179, 524);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(360, 82);
- this.groupBox3.TabIndex = 42;
- this.groupBox3.TabStop = false;
- //
- // label7
- //
- this.label7.AutoSize = true;
- this.label7.Location = new System.Drawing.Point(227, 54);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(0, 12);
- this.label7.TabIndex = 44;
- //
- // panel3
- //
- this.panel3.BackColor = System.Drawing.Color.Gray;
- this.panel3.Location = new System.Drawing.Point(274, 49);
- this.panel3.Name = "panel3";
- this.panel3.Size = new System.Drawing.Size(72, 21);
- this.panel3.TabIndex = 43;
- this.panel3.Click += new System.EventHandler(this.panel2_Click);
- //
- // textBox2
- //
- this.textBox2.Location = new System.Drawing.Point(166, 49);
- this.textBox2.Name = "textBox2";
- this.textBox2.Size = new System.Drawing.Size(47, 21);
- this.textBox2.TabIndex = 42;
- this.textBox2.Text = "6";
- this.textBox2.TextChanged += new System.EventHandler(this.textBox2_TextChanged);
- //
- // label9
- //
- this.label9.AutoSize = true;
- this.label9.Location = new System.Drawing.Point(119, 54);
- this.label9.Name = "label9";
- this.label9.Size = new System.Drawing.Size(0, 12);
- this.label9.TabIndex = 41;
- //
- // label6
- //
- this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(227, 28);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(0, 12);
- this.label6.TabIndex = 40;
- //
- // panel1
- //
- this.panel1.BackColor = System.Drawing.Color.Black;
- this.panel1.Location = new System.Drawing.Point(274, 23);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(72, 21);
- this.panel1.TabIndex = 39;
- this.panel1.Click += new System.EventHandler(this.panel1_Click);
- //
- // textBox1
- //
- this.textBox1.Location = new System.Drawing.Point(166, 23);
- this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(47, 21);
- this.textBox1.TabIndex = 38;
- this.textBox1.Text = "6";
- this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
- //
- // checkBox2
- //
- this.checkBox2.Anchor = System.Windows.Forms.AnchorStyles.Right;
- this.checkBox2.AutoSize = true;
- this.checkBox2.Location = new System.Drawing.Point(95, 52);
- this.checkBox2.Name = "checkBox2";
- this.checkBox2.Size = new System.Drawing.Size(15, 14);
- this.checkBox2.TabIndex = 25;
- this.checkBox2.UseVisualStyleBackColor = true;
- this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
- //
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(119, 28);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(0, 12);
- this.label5.TabIndex = 37;
- //
- // checkBox1
- //
- this.checkBox1.Anchor = System.Windows.Forms.AnchorStyles.Right;
- this.checkBox1.AutoSize = true;
- this.checkBox1.Location = new System.Drawing.Point(95, 27);
- this.checkBox1.Name = "checkBox1";
- this.checkBox1.Size = new System.Drawing.Size(15, 14);
- this.checkBox1.TabIndex = 24;
- this.checkBox1.UseVisualStyleBackColor = true;
- this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
- //
- // MethodADialog
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
- this.ClientSize = new System.Drawing.Size(1127, 830);
- this.Controls.Add(this.groupBox3);
- this.Controls.Add(this.groupBox2);
- this.Controls.Add(this.groupBox1);
- this.Name = "MethodADialog";
- this.Text = "SYT6103-2004";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MethodADialog_FormClosing);
- this.Load += new System.EventHandler(this.MethodADialog_Load);
- this.Controls.SetChildIndex(this.groupBox6groupBox_analysisResult2, 0);
- this.Controls.SetChildIndex(this.groupBox_img, 0);
- this.Controls.SetChildIndex(this.groupBox_review, 0);
- this.Controls.SetChildIndex(this.groupBox_analysisResult1, 0);
- this.Controls.SetChildIndex(this.groupBox_report, 0);
- this.Controls.SetChildIndex(this.groupBox1, 0);
- this.Controls.SetChildIndex(this.groupBox2, 0);
- this.Controls.SetChildIndex(this.groupBox3, 0);
- this.groupBox_report.ResumeLayout(false);
- this.groupBox_report.PerformLayout();
- this.groupBox_analysisResult1.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1_0)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
- this.groupBox1.ResumeLayout(false);
- this.groupBox1.PerformLayout();
- this.groupBox5.ResumeLayout(false);
- this.groupBox5.PerformLayout();
- this.groupBox4.ResumeLayout(false);
- this.groupBox4.PerformLayout();
- this.groupBox2.ResumeLayout(false);
- this.groupBox2.PerformLayout();
- this.groupBox3.ResumeLayout(false);
- this.groupBox3.PerformLayout();
- this.ResumeLayout(false);
- }
- #endregion 初始化组件
- #region 需继承方法
- protected override void drawSubclass(Graphics graphics)
- {
- if (showOrimat())
- return;
- //if (matGeology != null && matGeology.Width > 0 && matGeology.Height > 0)
- //{
- // graphics.DrawImage(OpenCvSharp.Extensions.BitmapConverter.ToBitmap(matGeology), 0, 0);
- //}
- base.drawSubclass(graphics);
- if (lstAttribute.Count > 0/* && holeNumberVisible*/)
- {
- float text1Font;
- if (float.TryParse(this.textBox1.Text.ToString(), out text1Font))
- { }
- else
- {
- text1Font = 6;
- }
- float text2Font;
- if (float.TryParse(this.textBox2.Text.ToString(), out text2Font))
- { }
- else
- {
- text2Font = 6;
- }
- //foreach (var attribute in lstAttribute)
- //{
- // if (attribute[7] == 27)
- // {
- // graphics.DrawString(/*attribute[0] + */"" + attribute[7], myFont, new SolidBrush(/*this.panel1.BackColor*/Color.Green), (float)attribute[1] - 3, (float)attribute[2] - 3);
- // }
- // else
- // graphics.DrawString(/*attribute[0] + */"" + attribute[7], myFont, bush, (float)attribute[1] - 3, (float)attribute[2] - 3);
- //}
- if (this.checkBox1.Checked && this.checkBox2.Checked)
- {
- foreach (var attribute in lstAttribute)
- {
- graphics.DrawString("" + attribute[7] + ":", new Font("宋体", text1Font), new SolidBrush(this.panel1.BackColor), new PointF((float)attribute[1] - 3, (float)attribute[2] - 3));
- SizeF sizeF = graphics.MeasureString("" + attribute[7] + ":", new Font("宋体", text1Font));
- graphics.DrawString("" + Math.Round(this.getHolesD(attribute), Convert.ToInt32(this.numericUpDown1_0.Value)) + "", new Font("宋体", text2Font), new SolidBrush(this.panel3.BackColor), new PointF((float)attribute[1] - 2 - 3 + sizeF.Width, (float)attribute[2] - 3));
- }
- }
- else if (!this.checkBox1.Checked && this.checkBox2.Checked)
- {
- foreach (var attribute in lstAttribute)
- {
- graphics.DrawString("" + Math.Round(this.getHolesD(attribute), Convert.ToInt32(this.numericUpDown1_0.Value)), new Font("宋体", text2Font), new SolidBrush(this.panel3.BackColor), new PointF((float)attribute[1] - 3, (float)attribute[2] - 3));
- }
- }
- else if (this.checkBox1.Checked && !this.checkBox2.Checked)
- {
- foreach (var attribute in lstAttribute)
- {
- graphics.DrawString("" + attribute[7] + "", new Font("宋体", text1Font), new SolidBrush(this.panel1.BackColor), new PointF((float)attribute[1] - 3, (float)attribute[2] - 3));
- }
- }
- }
- }
- protected override void refreshWhileImgChanged()
- {
- if (this.dataGridView1.Rows.Count > 0)
- {
- //foreach (DataGridViewRow gridViewRow in this.dataGridView1.Rows)
- //{
- // foreach (var dataTable in this.dataTable1s)
- // {
- // if (dataTable.TableName.Equals(gridViewRow.Tag))
- // {
- // this.dataTable1s.Remove(dataTable);
- // break;
- // }
- // }
- // if (bitCeDingDic.ContainsKey((string)gridViewRow.Tag))
- // bitCeDingDic.Remove((string)gridViewRow.Tag);
- //}
- this.dataGridView1.Rows.Clear();
- }
- //this.checkBox1.Checked = false;
- //this.checkBox2.Checked = false;
- }
- /// <summary>
- /// 获取孔隙直径计算类型 1长径 2短径 3平均径 4等效圆直径 5φ值
- /// </summary>
- /// <returns></returns>
- protected override int getHolesType()
- {
- if (this.radioButton7.Checked)
- return 5;
- if (this.radioButton6.Checked)
- return 1;
- if (this.radioButton5.Checked)
- return 2;
- if (this.radioButton4.Checked)
- return 3;
- if (this.radioButton3.Checked)
- return 4;
- return 4;
- }
- protected override string getTemplateName()
- {
- return "Template.Manager.item3.PetroleumGeology_SYT6103";
- }
- protected override string getProjectEngineeringName()
- {
- return "Menu.DedicatedAnalysis.PetroleumGeology.PetroleumGeologySon.Text";// "Menu.DedicatedAnalysis.NonferrousMetal.CopperAlloy.Text";//######################
- }
- protected override void SubclassInitialize()
- {
- InitializeComponent();
- InitializeLanguageText();
- }
- #endregion
- private void AllShow()
- {
- this.dataGridView2.Rows.Clear();
- for (int i = 0; i < this.dataTables.Count; i++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- dgvr.Tag = this.dataTables[i].TableName;
- foreach (DataGridViewColumn Column in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- }
- for (int c = 0; c < this.dataTables[i].Columns.Count; c++)
- {
- //if (c > 2 && c < 4)
- // dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(this.dataTables[i].Rows[0][c]), Convert.ToInt32(this.numericUpDown1_0.Value)).ToString();
- //else
- dgvr.Cells[c].Value = this.dataTables[i].Rows[0][c].ToString();
- }
- this.dataGridView2.Rows.Add(dgvr);
- }
- }
- /// <summary>
- /// 自动分割
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button2_Click(object sender, EventArgs e)
- {
- double thresValue;
- if (!double.TryParse(this.textBox5.Text.ToString(), out thresValue) || thresValue < 0)
- {
- MessageBox.Show(PdnResources.GetString("Menu.holdformatinputisincorrectpleasereenter.text"));
- return;
- }
- autoSegmentAction((int)thresValue/*10*/);
- }
- /// <summary>
- /// 显示孔隙编号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- controlHoleNumberVisible(checkBox1.Checked);
- }
- private void checkBox2_CheckedChanged(object sender, EventArgs e)
- {
- this.documentWorkspace.Refresh();
- }
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- float text1Font;
- if (float.TryParse(this.textBox1.Text.ToString(), out text1Font))
- {
- this.documentWorkspace.Refresh();
- }
- }
- private void textBox2_TextChanged(object sender, EventArgs e)
- {
- float text2Font;
- if (float.TryParse(this.textBox2.Text.ToString(), out text2Font))
- {
- this.documentWorkspace.Refresh();
- }
- }
- private void button3_Click(object sender, EventArgs e)
- {
- menuSegmentAction((Button)sender);
- }
- private void panel1_Click(object sender, EventArgs e)
- {
- this.panelColor_Click(sender, e);
- }
- private void panel2_Click(object sender, EventArgs e)
- {
- this.panelColor_Click(sender, e);
- }
- private void radioButton8_CheckedChanged(object sender, EventArgs e)
- {
- this.documentWorkspace.Refresh();
- if (radioButton7.Checked)
- {
- this.radioButton6.Enabled = false;
- this.radioButton5.Enabled = false;
- this.radioButton4.Enabled = false;
- this.radioButton3.Enabled = false;
- }
- else
- {
- this.radioButton6.Enabled = true;
- this.radioButton5.Enabled = true;
- this.radioButton4.Enabled = true;
- this.radioButton3.Enabled = true;
- }
- }
- private void radioButton7_CheckedChanged(object sender, EventArgs e)
- {
- this.documentWorkspace.Refresh();
- if (radioButton7.Checked)
- {
- this.radioButton6.Enabled = false;
- this.radioButton5.Enabled = false;
- this.radioButton4.Enabled = false;
- this.radioButton3.Enabled = false;
- }
- else
- {
- this.radioButton6.Enabled = true;
- this.radioButton5.Enabled = true;
- this.radioButton4.Enabled = true;
- this.radioButton3.Enabled = true;
- }
- }
- private void radioButton6_CheckedChanged(object sender, EventArgs e)
- {
- this.documentWorkspace.Refresh();
- }
- private void radioButton5_CheckedChanged(object sender, EventArgs e)
- {
- this.documentWorkspace.Refresh();
- }
- private void radioButton4_CheckedChanged(object sender, EventArgs e)
- {
- this.documentWorkspace.Refresh();
- }
- private void radioButton3_CheckedChanged(object sender, EventArgs e)
- {
- this.documentWorkspace.Refresh();
- }
- private void MethodADialog_Load(object sender, EventArgs e)
- {
- }
- #region 参数保存及提取
- /// <summary>
- /// 保存参数的key,value和type
- /// </summary>
- /// <param name="param_key"></param>
- /// <param name="param_value"></param>
- /// <param name="param_type"></param>
- private void saveParamValue(string param_key, string param_value, int param_type)
- {
- bool foundItem = false;
- foreach (var item in this.analysisModel.ListParam)
- {
- if (item.param_key.Equals(param_key) && item.menuId == this.menuId)
- {
- item.param_value = param_value;
- item.setValue();
- foundItem = true;
- break;
- }
- }
- if (!foundItem)
- {
- GrainSizeAnalysisModel analysisItem = new GrainSizeAnalysisModel();
- analysisItem.menuId = this.menuId;
- analysisItem.param_key = param_key;
- analysisItem.param_type = param_type;
- analysisItem.param_value = param_value;
- analysisItem.setValue();
- this.analysisModel.ListParam.Add(analysisItem);
- }
- }
- /// <summary>
- /// 保存界面中的参数到model
- /// </summary>
- private void saveDialogParamValues()
- {
- saveParamValue(ParamKey_Report, checkBox_generateReport_opensetting.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//报告设置
- saveParamValue(ParamKey_SortMicron, radioButton8.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//分类微米
- saveParamValue(ParamKey_SortDiam, radioButton7.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//分类直径
- saveParamValue(ParamKey_LongDiam, radioButton6.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//长径
- saveParamValue(ParamKey_ShortDiam, radioButton5.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//短径
- saveParamValue(ParamKey_AvgDiam, radioButton4.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//平均径
- saveParamValue(ParamKey_EqualDiam, radioButton3.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//等效圆直径
- saveParamValue(ParamKey_Threshold, textBox5.Text, (int)Base.Dtryt.ItemString);//喉道阈值
- saveParamValue(ParamKey_Number, checkBox1.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//显示孔隙编号
- saveParamValue(ParamKey_NumberFontSize, textBox1.Text, (int)Base.Dtryt.ItemString);//编号字体大小
- saveParamValue(ParamKey_NumberColour, panel1.BackColor.ToArgb().ToString(), (int)Base.Dtryt.Color);//编号颜色
- saveParamValue(ParamKey_Diameter, checkBox2.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//显示孔隙直径
- saveParamValue(ParamKey_DiameterFontSize, textBox2.Text, (int)Base.Dtryt.ItemString);//直径字体大小
- saveParamValue(ParamKey_DiameterColour, panel3.BackColor.ToArgb().ToString(), (int)Base.Dtryt.Color);//直径颜色
- saveParamValue(ParamKey_DecimalPlace, numericUpDown1_0.Value.ToString(), (int)Base.Dtryt.Decimal);//保留小数位数
- }
- /// <summary>
- /// 获取保存的参数
- /// </summary>
- private void GetListParamModel()
- {
- if (this.analysisModel != null)
- {
- for (int i = 0; i < this.analysisModel.ListParam.Count; i++)
- {
- switch (this.analysisModel.ListParam[i].param_key)
- {
- case ParamKey_Report:
- checkBox_generateReport_opensetting.Checked = (Boolean)this.analysisModel.ListParam[i].value;
- break;
- case ParamKey_SortMicron:
- radioButton8.Checked = (Boolean)this.analysisModel.ListParam[i].value;
- break;
- case ParamKey_SortDiam:
- radioButton7.Checked = (Boolean)this.analysisModel.ListParam[i].value;
- break;
- case ParamKey_LongDiam:
- radioButton6.Checked = (Boolean)this.analysisModel.ListParam[i].value;
- break;
- case ParamKey_ShortDiam:
- radioButton5.Checked = (Boolean)this.analysisModel.ListParam[i].value;
- break;
- case ParamKey_AvgDiam:
- radioButton4.Checked = (Boolean)this.analysisModel.ListParam[i].value;
- break;
- case ParamKey_EqualDiam:
- radioButton3.Checked = (Boolean)this.analysisModel.ListParam[i].value;
- break;
- case ParamKey_Threshold:
- textBox5.Text = (string)this.analysisModel.ListParam[i].value;
- break;
- case ParamKey_Number:
- checkBox1.Checked = (Boolean)this.analysisModel.ListParam[i].value;
- break;
- case ParamKey_NumberFontSize:
- textBox1.Text = (string)this.analysisModel.ListParam[i].value;
- break;
- case ParamKey_NumberColour:
- panel1.BackColor = Color.FromArgb((int)this.analysisModel.ListParam[i].value);
- break;
- case ParamKey_Diameter:
- checkBox2.Checked = (Boolean)this.analysisModel.ListParam[i].value;
- break;
- case ParamKey_DiameterFontSize:
- textBox2.Text = (string)this.analysisModel.ListParam[i].value;
- break;
- case ParamKey_DiameterColour:
- panel3.BackColor = Color.FromArgb((int)this.analysisModel.ListParam[i].value);
- break;
- case ParamKey_DecimalPlace:
- numericUpDown1_0.Value = decimal.Parse(this.analysisModel.ListParam[i].param_value);
- break;
- }
- }
- }
- }
- #endregion
- private void MethodADialog_FormClosing(object sender, FormClosingEventArgs e)
- {
- this.saveDialogParamValues();
- //xml保存路径
- string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GrainSizeAnalyze\\GrainSizeAnalysisModel.xml";
- GrainSizeAnalysisModel analysisModelXml = XmlSerializeHelper.DESerializer<GrainSizeAnalysisModel>(FileOperationHelper.ReadStringFromFile(filePath, System.IO.FileMode.Open));
- foreach (var analysisItem in this.analysisModel.ListParam)
- {
- bool foundItem = false;
- foreach (var item in analysisModelXml.ListParam)
- {
- if (item.param_key.Equals(analysisItem.param_key) && item.menuId == analysisItem.menuId)
- {
- item.param_value = analysisItem.param_value;
- foundItem = true;
- break;
- }
- }
- if (!foundItem)
- analysisModelXml.ListParam.Add(analysisItem.cloneModel());
- }
- //按路径和名称保存xml文件
- string userInfoXml = XmlSerializeHelper.XmlSerialize<GrainSizeAnalysisModel>(analysisModelXml);
- //保存xml
- FileOperationHelper.WriteStringToFile(userInfoXml, filePath, System.IO.FileMode.Create);
- }
- #region [脚本相关]
- private void getValue(string key, object value)
- {
- switch (key)
- {
- case "parameter1":
- if ((int)value == 0)
- {
- radioButton8.Checked = true;
- }
- else {
- radioButton7.Checked = true;
- }
- break;
- case "parameter2":
- if ((int)value == 0)
- {
- radioButton6.Checked = true;
- }
- else if ((int)value == 1) {
- radioButton6.Checked = true;
- }
- else if ((int)value == 2)
- {
- radioButton4.Checked = true;
- }
- else
- {
- radioButton3.Checked = true;
- }
- break;
- case "parameter3":
- textBox5.Text = value.ToString();
- break;
- case "parameter4":
- checkBox1.Checked = Convert.ToBoolean(value);
- break;
- case "parameter5":
- textBox1.Text = value.ToString();
- break;
- case "parameter6":
- panel1.BackColor = Color.FromArgb((int)value);
- break;
- case "parameter7":
- checkBox2.Checked = Convert.ToBoolean(value);
- break;
- case "parameter8":
- textBox2.Text = value.ToString();
- break;
- case "parameter9":
- panel3.BackColor = Color.FromArgb((int)value);
- break;
- case "OpenWhileExportReport":
- checkBox_generateReport_opensetting.Checked = Convert.ToBoolean(value);
- break;
- case "CalculatorDecimalDigits":
- numericUpDown1_0.Value = Convert.ToDecimal(value);
- break;
- }
- }
- #endregion
- #region [脚本录制]
- protected override void getScriptRecording()
- {
- string className = InvariantData.path_Action + ".Action" + menuId;
- ParamObject param = (ParamObject)System.Reflection.Assembly.Load(InvariantData.assembly_Data).CreateInstance(className);
- List<Args> args = param.Lists;
- foreach (var item in args)
- {
- item.value = setScriptRecording(item.key);
- }
- //找出二值相关参数 进行赋值
- List<Args> isNullList = args.Where(m => m.value == null).ToList();
- foreach (var item in isNullList)
- {
- item.value = binaryClass.setScriptRecording(item.key);
- }
- appWorkspace.SetScriptStartRecording(this.menuId, menuName, args);
- }
- private object setScriptRecording(string key)
- {
- object value = null;
- switch (key)
- {
- case "parameter1":
- if (radioButton8.Checked)
- {
- value = 0;
- }
- else
- {
- value = 1;
- }
- break;
- case "parameter2":
- if (radioButton6.Checked)
- {
- value = 0;
- }
- else if (radioButton6.Checked)
- {
- value = 1;
- }
- else if (radioButton4.Checked)
- {
- value = 2;
- }
- else
- {
- value = 3;
- }
- break;
- case "parameter3":
- value = textBox5.Text;
- break;
- case "parameter4":
- value = checkBox1.Checked;
- break;
- case "parameter5":
- value = textBox1.Text;
- break;
- case "parameter6":
- value = panel1.BackColor.ToArgb();
- break;
- case "parameter7":
- value = checkBox2.Checked;
- break;
- case "parameter8":
- value = textBox2.Text;
- break;
- case "parameter9":
- value = panel3.BackColor.ToArgb();
- break;
- case "OpenWhileExportReport":
- value = checkBox_generateReport_opensetting.Checked;
- break;
- case "CalculatorDecimalDigits":
- value = numericUpDown1_0.Value;
- break;
- case "ExportResults":
- value = false;
- break;
- case "ExportReports":
- value = false;
- break;
- case "ExportProjects":
- value = false;
- break;
- }
- return value;
- }
- #endregion
- }
- }
|