1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725 |
- using Metis.ParameterSet;
- using OpenCvSharp;
- using PaintDotNet.Base;
- using PaintDotNet.Base.CommTool;
- using PaintDotNet.Base.Functionodel;
- using PaintDotNet.Base.SettingModel;
- using PaintDotNet.CustomControl;
- using PaintDotNet.Data.Param;
- using PaintDotNet.DbOpreate.DbBll;
- using PaintDotNet.DbOpreate.DbModel;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.Linq;
- using System.Windows.Forms;
- namespace PaintDotNet.DedicatedAnalysis.GrainSize.YBT4290_2012
- {
- /// <summary>
- /// 测量法
- /// </summary>
- internal class GrainSizeMeasurementDialog : PdnBaseForm
- {
- #region 基础控件
- private Button button1;
- private CheckBox checkBox1;
- private Button button2;
- private Button button32;
- private GroupBox groupBox2;
- private ListView listView1;
- private GroupBox groupBox3;
- private Panel panel1;
- private Label label3;
- private GroupBox groupBox7;
- private GroupBox groupBox8;
- private GroupBox groupBox9;
- private Button button6;
- private Button button7;
- private ListView listView2;
- private DataGridView dataGridView2;
- private Button button9;
- private Button button8;
- private NumericUpDown numericUpDown1;
- private Label label8;
- private Label label9;
- private Label label10;
- private ImageList imageList1;
- private IContainer components;
- private GroupBox groupBox1;
- private Button button3;
- private NumericUpDown numericUpDown4;
- private Label label4;
- private Label label2;
- private NumericUpDown numericUpDown3;
- private NumericUpDown numericUpDown2;
- private Label label1;
- private Label label7;
- private Label label6;
- private Label label5;
- private TextBox textBox3;
- private TextBox textBox2;
- private TextBox textBox1;
- private Button button10;
- #endregion
- /// <summary>
- /// 调色板
- /// </summary>
- PaintDotNet.ColorsForm colorsForm1;
- /// <summary>
- /// 主控件
- /// </summary>
- private AppWorkspace appWorkspace;
- /// <summary>
- /// 图像面板
- /// </summary>
- private DocumentWorkspaceWindow documentWorkspace;
- /// <summary>
- /// 公共按钮
- /// </summary>
- private CommonControlButtons commonControlButtons;
- //二值化集成1
- BinaryClass binaryClass;
- private int menuId;
- private string menuName;
- protected static string ParamKey_lineWidth = "lineWidth";//线宽
- protected static string ParamKey_lineColor = "lineColor";//颜色
- protected static string ParamKey_maxDiameter = "maxDiameter";//最大卡尺直径
- protected static string ParamKey_minDiameter = "minDiameter";//最小卡尺直径
- protected static string ParamKey_CalculatorDecimalDigits = "CalculatorDecimalDigits";//小数点位数
- protected static string ParamKey_OpenWhileExportReport = "OpenWhileExportReport";//生成报告时打开设置
- /// <summary>
- /// 保存所有窗口的参数
- /// </summary>
- private Dictionary<string, GrainSizeAnalysisModel> analysisDict = new Dictionary<string, GrainSizeAnalysisModel>();
- /// <summary>
- /// 晶界重现-保存所有窗口的参数 应用则计算,不应用则清空Mat。应用到全部则提前清空Mat和Model
- /// </summary>
- private Dictionary<string, GrainBoundryDectModel> grainBoundaryDict = new Dictionary<string, GrainBoundryDectModel>();
- /// <summary>
- /// 晶界重现-保存所有窗口的计算结果 应用则计算,不应用则清空
- /// </summary>
- private Dictionary<string, Mat> grainBoundaryMatDict = new Dictionary<string, Mat>();
- /// <summary>
- /// 当前选择的图片
- /// </summary>
- private Mat imageMat;
- /// <summary>
- /// 起止点
- /// </summary>
- private System.Drawing.PointF startPoint, endPoint;
- /// <summary>
- /// 测量点
- /// </summary>
- public RectangleF rectangleFBorder;
- /// <summary>
- /// 存储当前线的点集合
- /// </summary>
- private PointF[] nowLine;
- /// <summary>
- /// 计算结果的表格集合
- /// </summary>
- private List<DataTable> resultTableList = new List<DataTable>();
- /// <summary>
- /// 保存用于生成报告的图片
- /// </summary>
- private List<Bitmap> bitList;
- /// <summary>
- /// 储存点击保存结果后的所有原图与分析图
- /// </summary>
- private Dictionary<string, List<Bitmap>> bitDic = new Dictionary<string, List<Bitmap>>();
- /// <summary>
- /// 是否显示全部
- /// </summary>
- private bool showAll = false;
- /// <summary>
- /// 辅助计算偏移量-移动线两端的点
- /// </summary>
- private PointF lastPoint = new PointF(0, 0);
- /// <summary>
- /// 辅助计算偏移量-移动线中间的点
- /// </summary>
- private PointF tempPoint = new PointF(0, 0);
- /// <summary>
- /// 判断图形是否可移动
- /// </summary>
- private bool canMove = false;
- /// <summary>
- /// 判断图形是否可绘制
- /// </summary>
- private bool canDraw = false;
- /// <summary>
- /// 是否已选中
- /// </summary>
- private bool selected = false;
- /// <summary>
- /// 移动线上的哪一个点
- /// </summary>
- private int movePointIndex = -1;
- /// <summary>
- /// 点击次数
- /// </summary>
- private int clickCount = 0;
- ///// <summary>
- ///// 单位标尺
- ///// </summary>
- //private double unitLength = 1;
- /// <summary>
- /// 放大倍数
- /// </summary>
- private decimal gainNumber = 1;
- /// <summary>
- /// 分级数组
- /// </summary>
- private decimal[] levelArr = new decimal[] { 0.00101m, 0.00143m, 0.00202m, 0.00285m, 0.00403m, 0.00570m, 0.00807m, 0.0114m, 0.0161m, 0.0228m, 0.0323m,
- 0.0456m, 0.0645m, 0.0912m, 0.129m, 0.182m, 0.258m, 0.365m, 0.516m, 0.730m, 1.03m, 1.46m, 2.06m};
- /// <summary>
- /// 是否选择了图片
- /// </summary>
- private int selectPicture = -1;
- /// <summary>
- /// 存在视场标记
- /// </summary>
- private bool existViewFlag = false;
- private BinaryControlSmaller bc;
- /// <summary>
- /// 中间数据
- /// </summary>
- private List<ExportProjectModel> tempDataModel = new List<ExportProjectModel>();
- private Button button_ApplyToAll;
- /// <summary>
- /// 0,E93099; 2,YBT4290;
- /// </summary>
- int gbtType;
- /// <summary>
- ///
- /// </summary>
- /// <param name="appWorkspace"></param>
- /// <param name="gbtType">>0,E93099; 2,YBT4290;</param>
- public GrainSizeMeasurementDialog(AppWorkspace appWorkspace, int gbtType, PdnMenuItem menuItem)
- {
- this.menuId = menuItem.MenuId;
- this.menuName = menuItem.Text;
- binaryClass = new BinaryClass(menuId);
- this.appWorkspace = appWorkspace;
- this.gbtType = gbtType;
- if (this.gbtType == 2)
- this.Text = "YBT4290_2012(" + PdnResources.GetString("Menu.Dedicatedanalysis.blackmetal.Measurementmethod.text") + ")";
- else if (this.gbtType == 0)
- this.Text = "ASTM_E93099_2007(" + PdnResources.GetString("Menu.Dedicatedanalysis.blackmetal.Measurementmethod.text") + ")";
- else
- this.Text = PdnResources.GetString("Menu.Dedicatedanalysis.blackmetal.Measurementmethod.text");
- InitializeComponent();
- InitializeLanguageText();
- InitGridHeader();
- InitPicList();
- //初始化图片列表
- int imgIndex = -1;
- for (int i = 0; i < this.appWorkspace.DocumentWorkspaces.Length; i++)
- if (this.appWorkspace.DocumentWorkspaces[i].Equals(this.appWorkspace.ActiveDocumentWorkspace))
- {
- imgIndex = i;
- break;
- }
- InitOtherTools();
- //如果是脚本执行,将参数带入
- if (imgIndex != -1 && appWorkspace.ScriptRunning && appWorkspace.ScriptCurrentParam != null && (int)appWorkspace.ScriptCurrentParam.MenuId == menuId)
- {
- ////在这里反射出对应功能的参数类
- 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;
- }
- GrainSizeAnalysisModel analysisModel = GrainSizeAnalysisModel.cloneListParamScript(param);
- foreach (var item in analysisModel.ListParam)
- item.setValue();
- this.analysisDict.Add(this.imageList1.Images.Keys[imgIndex], analysisModel);
- appWorkspace.ScriptCurrentParam = null;//阻止第二次进入仍然被赋值参数
- }
- else if (imgIndex != -1)
- {//读取上次关闭窗口时保存的参数
- string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GrainSizeAnalyze\\GrainSizeAnalysisModel.xml";
- GrainSizeAnalysisModel analysisModelXml = XmlSerializeHelper.DESerializer<GrainSizeAnalysisModel>(FileOperationHelper.ReadStringFromFile(filePath, System.IO.FileMode.Open));
- GrainSizeAnalysisModel analysisModel = analysisModelXml.cloneListParamModel(this.menuId);
- foreach (var item in analysisModel.ListParam)
- item.setValue();
- this.analysisDict.Add(this.imageList1.Images.Keys[imgIndex], analysisModel);
- }
- InitCommonButtonEvent();
- AddPictureBoxEvent();
- SetAnalyzeModelFromXml(getModelName());
- }
- private void ShownChoiseItemAndInitData(object sender, EventArgs e)
- {
- binaryClass.RefreshHistogramControl1Values();
- int imgIndex = -1;
- this.listView1.Focus();
- //初始化图片列表
- for (int i = 0; i < this.appWorkspace.DocumentWorkspaces.Length; i++)
- {
- //this.imageList1.Add("img" + i, this.appWorkspace.DocumentWorkspaces[i].BinarizationThumbnail);
- //this.listView1.Items.Add("", i);
- //this.lstView_img.Items[i].ImageIndex = i;
- //this.lstView_img.Items[i].Text = this.appWorkspace.DocumentWorkspaces[i].GetFriendlyName();
- //this.lstView_img.Items[i].Name = this.appWorkspace.DocumentWorkspaces[i].GetFriendlyName();
- if (this.appWorkspace.DocumentWorkspaces[i].Equals(this.appWorkspace.ActiveDocumentWorkspace))
- {
- imgIndex = i;
- break;
- }
- }
- if (imgIndex != -1)//#21538
- {
- //滚动到指定的行位置
- this.listView1.EnsureVisible(imgIndex);
- this.listView1.Items[imgIndex].Focused = true;
- this.listView1.Items[imgIndex].Selected = true;
- }
- //getLastData();
- //bc.OriginCheckedChangedAction += new EventHandler(this.bcOriginCheckedChanged);//初始化原图勾选改变事件
- //binaryClass.BinaryImplFinishAction += new EventHandler(this.bClassBinaryImplFinishAction);//二值化后续处理事件
- }
- private string getModelName()
- {
- if (this.gbtType == 2)
- return "Template.Manager.item3.GrainSizeMeasurement";
- else if (this.gbtType == 0)
- return "Template.Manager.item3.GrainSizeMeasure93099Method";
- else
- return "Template.Manager.item3.GrainSizeMeasurement";
- }
- private void InitializeLanguageText()
- {
- this.bc = new PaintDotNet.CustomControl.BinaryControlSmaller();
- //
- // bc
- //
- this.bc.BinaryBackColor = System.Drawing.Color.Red;
- this.bc.BinaryChecked = false;
- this.bc.BinaryStyle = 1;
- this.bc.Location = new System.Drawing.Point(150, 58);
- this.bc.Name = "bc";
- this.bc.OriginChecked = false;
- this.bc.scope1End = 0D;
- this.bc.scope1Start = 0D;
- this.bc.scope2End = 0D;
- this.bc.scope2Start = 0D;
- this.bc.scope3End = 0D;
- this.bc.scope3Start = 0D;
- this.bc.Size = new System.Drawing.Size(360, 247);
- this.bc.TabIndex = 31;
- this.Controls.Add(this.bc);
- this.Controls.SetChildIndex(this.bc, 0);
- this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
- this.button2.Text = PdnResources.GetString("Menu.Saveresult.text");
- this.button32.Text = PdnResources.GetString("Menu.Grainboundarytoreproduce.text");
- this.checkBox1.Text = PdnResources.GetString("Menu.Opensettingsatingreport.text");
- this.button1.Text = PdnResources.GetString("Menu.Setting.Text");
- this.button_ApplyToAll.Text = "应用到全部";
- this.groupBox2.Text = PdnResources.GetString("Menu.Tools.ImageIndex.Text");
- this.groupBox3.Text = PdnResources.GetString("Menu.Preview.text");
- this.label3.Text = PdnResources.GetString("Menu.Linewidth.text") + ":";
- this.groupBox7.Text = PdnResources.GetString("Menu.measuring.text");
- this.button3.Text = PdnResources.GetString("Menu.measuring.text");
- this.label4.Text = PdnResources.GetString("Menu.Verticalcaliperdiameter.Text") + ":";
- this.label2.Text = PdnResources.GetString("Menu.color.text") + ":";
- this.label1.Text = PdnResources.GetString("Menu.Maximumcalipddderdiameter.Text") + ":";
- this.groupBox8.Text = PdnResources.GetString("Menu.Dedicatedanalysis.blackmetal.Previewresults.text");
- this.label7.Text = PdnResources.GetString("Menu.ALAgrainlevel.text") + ":";
- this.label6.Text = PdnResources.GetString("Menu.Actualarea.text") + ":";
- this.label5.Text = PdnResources.GetString("Menu.Ellipsearea.text") + ":";
- this.groupBox9.Text = PdnResources.GetString("Menu.Analysisresult.text");
- this.button10.Text = PdnResources.GetString("Menu.Exportproject.text");
- this.label8.Text = PdnResources.GetString("Menu.Decimal.text") + ":";
- this.button9.Text = PdnResources.GetString("Menu.Exportresults.text");
- this.button8.Text = PdnResources.GetString("Menu.Tools.CreateReport.Text");
- this.button7.Text = PdnResources.GetString("Menu.Edit.Delete.Text");
- this.button6.Text = PdnResources.GetString("Menu.Showall.text");
- }
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.button2 = new System.Windows.Forms.Button();
- this.button32 = new System.Windows.Forms.Button();
- this.checkBox1 = new System.Windows.Forms.CheckBox();
- this.button1 = new System.Windows.Forms.Button();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.listView1 = new System.Windows.Forms.ListView();
- this.imageList1 = new System.Windows.Forms.ImageList(this.components);
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.panel1 = new System.Windows.Forms.Panel();
- this.label3 = new System.Windows.Forms.Label();
- this.groupBox7 = new System.Windows.Forms.GroupBox();
- this.button3 = new System.Windows.Forms.Button();
- this.numericUpDown4 = new System.Windows.Forms.NumericUpDown();
- this.label4 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.numericUpDown3 = new System.Windows.Forms.NumericUpDown();
- this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
- this.label1 = new System.Windows.Forms.Label();
- this.groupBox8 = new System.Windows.Forms.GroupBox();
- this.textBox3 = new System.Windows.Forms.TextBox();
- this.textBox2 = new System.Windows.Forms.TextBox();
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.label7 = new System.Windows.Forms.Label();
- this.label6 = new System.Windows.Forms.Label();
- this.label5 = new System.Windows.Forms.Label();
- this.groupBox9 = new System.Windows.Forms.GroupBox();
- this.button10 = new System.Windows.Forms.Button();
- this.label10 = new System.Windows.Forms.Label();
- this.label9 = new System.Windows.Forms.Label();
- this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
- this.label8 = new System.Windows.Forms.Label();
- this.button9 = new System.Windows.Forms.Button();
- this.button8 = new System.Windows.Forms.Button();
- this.dataGridView2 = new System.Windows.Forms.DataGridView();
- this.listView2 = new System.Windows.Forms.ListView();
- this.button7 = new System.Windows.Forms.Button();
- this.button6 = new System.Windows.Forms.Button();
- this.button_ApplyToAll = new System.Windows.Forms.Button();
- this.groupBox1.SuspendLayout();
- this.groupBox2.SuspendLayout();
- this.groupBox7.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
- this.groupBox8.SuspendLayout();
- this.groupBox9.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit();
- this.SuspendLayout();
- //
- // groupBox1
- //
- this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox1.Controls.Add(this.button_ApplyToAll);
- this.groupBox1.Controls.Add(this.button2);
- this.groupBox1.Controls.Add(this.button32);
- this.groupBox1.Controls.Add(this.checkBox1);
- this.groupBox1.Controls.Add(this.button1);
- this.groupBox1.Location = new System.Drawing.Point(14, 3);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(1081, 50);
- this.groupBox1.TabIndex = 1;
- this.groupBox1.TabStop = false;
- //
- // button2
- //
- this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.button2.Location = new System.Drawing.Point(895, 17);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(84, 24);
- this.button2.TabIndex = 2;
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // button32
- //
- this.button32.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.button32.Location = new System.Drawing.Point(805, 17);
- this.button32.Name = "button32";
- this.button32.Size = new System.Drawing.Size(84, 24);
- this.button32.TabIndex = 2;
- this.button32.UseVisualStyleBackColor = true;
- this.button32.Click += new System.EventHandler(this.button32_Click);
- //
- // checkBox1
- //
- this.checkBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.checkBox1.AutoSize = true;
- this.checkBox1.Location = new System.Drawing.Point(141, 21);
- this.checkBox1.Name = "checkBox1";
- this.checkBox1.Size = new System.Drawing.Size(15, 14);
- this.checkBox1.TabIndex = 1;
- this.checkBox1.UseVisualStyleBackColor = true;
- //
- // button1
- //
- this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.button1.Location = new System.Drawing.Point(15, 14);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(84, 30);
- this.button1.TabIndex = 0;
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // groupBox2
- //
- this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox2.Controls.Add(this.listView1);
- this.groupBox2.Location = new System.Drawing.Point(14, 60);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(135, 544);
- this.groupBox2.TabIndex = 2;
- this.groupBox2.TabStop = false;
- //
- // listView1
- //
- this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.listView1.HideSelection = false;
- this.listView1.LargeImageList = this.imageList1;
- this.listView1.Location = new System.Drawing.Point(5, 17);
- this.listView1.MultiSelect = false;
- this.listView1.Name = "listView1";
- this.listView1.Size = new System.Drawing.Size(124, 521);
- this.listView1.TabIndex = 0;
- this.listView1.UseCompatibleStateImageBehavior = false;
- this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
- //
- // imageList1
- //
- this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
- this.imageList1.ImageSize = new System.Drawing.Size(64, 64);
- this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
- //
- // groupBox3
- //
- this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox3.Location = new System.Drawing.Point(515, 60);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(580, 543);
- this.groupBox3.TabIndex = 3;
- this.groupBox3.TabStop = false;
- //
- // panel1
- //
- this.panel1.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panel1.Location = new System.Drawing.Point(233, 20);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(84, 18);
- this.panel1.TabIndex = 5;
- this.panel1.Click += new System.EventHandler(this.panel1_Click);
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(16, 23);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(0, 12);
- this.label3.TabIndex = 0;
- //
- // groupBox7
- //
- this.groupBox7.Controls.Add(this.button3);
- this.groupBox7.Controls.Add(this.numericUpDown4);
- this.groupBox7.Controls.Add(this.label4);
- this.groupBox7.Controls.Add(this.label2);
- this.groupBox7.Controls.Add(this.numericUpDown3);
- this.groupBox7.Controls.Add(this.numericUpDown2);
- this.groupBox7.Controls.Add(this.label1);
- this.groupBox7.Controls.Add(this.label3);
- this.groupBox7.Controls.Add(this.panel1);
- this.groupBox7.Location = new System.Drawing.Point(154, 318);
- this.groupBox7.Name = "groupBox7";
- this.groupBox7.Size = new System.Drawing.Size(356, 94);
- this.groupBox7.TabIndex = 7;
- this.groupBox7.TabStop = false;
- //
- // button3
- //
- this.button3.Location = new System.Drawing.Point(236, 53);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(75, 23);
- this.button3.TabIndex = 12;
- this.button3.UseVisualStyleBackColor = true;
- this.button3.Click += new System.EventHandler(this.button3_Click);
- //
- // numericUpDown4
- //
- this.numericUpDown4.DecimalPlaces = 5;
- this.numericUpDown4.Increment = new decimal(new int[] {
- 1,
- 0,
- 0,
- 131072});
- this.numericUpDown4.Location = new System.Drawing.Point(125, 67);
- this.numericUpDown4.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown4.Name = "numericUpDown4";
- this.numericUpDown4.ReadOnly = true;
- this.numericUpDown4.Size = new System.Drawing.Size(98, 21);
- this.numericUpDown4.TabIndex = 11;
- this.numericUpDown4.ValueChanged += new System.EventHandler(this.numericUpDown4_ValueChanged);
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(16, 71);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(0, 12);
- this.label4.TabIndex = 10;
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(189, 23);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(0, 12);
- this.label2.TabIndex = 9;
- //
- // numericUpDown3
- //
- this.numericUpDown3.DecimalPlaces = 5;
- this.numericUpDown3.Increment = new decimal(new int[] {
- 1,
- 0,
- 0,
- 131072});
- this.numericUpDown3.Location = new System.Drawing.Point(125, 43);
- this.numericUpDown3.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown3.Name = "numericUpDown3";
- this.numericUpDown3.ReadOnly = true;
- this.numericUpDown3.Size = new System.Drawing.Size(98, 21);
- this.numericUpDown3.TabIndex = 8;
- this.numericUpDown3.ValueChanged += new System.EventHandler(this.numericUpDown3_ValueChanged);
- //
- // numericUpDown2
- //
- this.numericUpDown2.Location = new System.Drawing.Point(59, 19);
- this.numericUpDown2.Maximum = new decimal(new int[] {
- 50,
- 0,
- 0,
- 0});
- this.numericUpDown2.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown2.Name = "numericUpDown2";
- this.numericUpDown2.Size = new System.Drawing.Size(69, 21);
- this.numericUpDown2.TabIndex = 7;
- this.numericUpDown2.Value = new decimal(new int[] {
- 3,
- 0,
- 0,
- 0});
- this.numericUpDown2.ValueChanged += new System.EventHandler(this.numericUpDown2_ValueChanged);
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(16, 47);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(0, 12);
- this.label1.TabIndex = 6;
- //
- // groupBox8
- //
- this.groupBox8.Controls.Add(this.textBox3);
- this.groupBox8.Controls.Add(this.textBox2);
- this.groupBox8.Controls.Add(this.textBox1);
- this.groupBox8.Controls.Add(this.label7);
- this.groupBox8.Controls.Add(this.label6);
- this.groupBox8.Controls.Add(this.label5);
- this.groupBox8.Location = new System.Drawing.Point(154, 418);
- this.groupBox8.Name = "groupBox8";
- this.groupBox8.Size = new System.Drawing.Size(356, 75);
- this.groupBox8.TabIndex = 8;
- this.groupBox8.TabStop = false;
- //
- // textBox3
- //
- this.textBox3.Location = new System.Drawing.Point(112, 45);
- this.textBox3.Name = "textBox3";
- this.textBox3.ReadOnly = true;
- this.textBox3.Size = new System.Drawing.Size(142, 21);
- this.textBox3.TabIndex = 5;
- //
- // textBox2
- //
- this.textBox2.Location = new System.Drawing.Point(237, 16);
- this.textBox2.Name = "textBox2";
- this.textBox2.ReadOnly = true;
- this.textBox2.Size = new System.Drawing.Size(88, 21);
- this.textBox2.TabIndex = 4;
- //
- // textBox1
- //
- this.textBox1.Location = new System.Drawing.Point(73, 16);
- this.textBox1.Name = "textBox1";
- this.textBox1.ReadOnly = true;
- this.textBox1.Size = new System.Drawing.Size(88, 21);
- this.textBox1.TabIndex = 3;
- //
- // label7
- //
- this.label7.AutoSize = true;
- this.label7.Location = new System.Drawing.Point(16, 49);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(0, 12);
- this.label7.TabIndex = 2;
- //
- // label6
- //
- this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(180, 21);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(0, 12);
- this.label6.TabIndex = 1;
- //
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(16, 21);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(0, 12);
- this.label5.TabIndex = 0;
- //
- // groupBox9
- //
- this.groupBox9.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox9.Controls.Add(this.button10);
- this.groupBox9.Controls.Add(this.label10);
- this.groupBox9.Controls.Add(this.label9);
- this.groupBox9.Controls.Add(this.numericUpDown1);
- this.groupBox9.Controls.Add(this.label8);
- this.groupBox9.Controls.Add(this.button9);
- this.groupBox9.Controls.Add(this.button8);
- this.groupBox9.Controls.Add(this.dataGridView2);
- this.groupBox9.Controls.Add(this.listView2);
- this.groupBox9.Controls.Add(this.button7);
- this.groupBox9.Controls.Add(this.button6);
- this.groupBox9.Location = new System.Drawing.Point(14, 609);
- this.groupBox9.Name = "groupBox9";
- this.groupBox9.Size = new System.Drawing.Size(1081, 204);
- this.groupBox9.TabIndex = 9;
- this.groupBox9.TabStop = false;
- //
- // button10
- //
- this.button10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.button10.Location = new System.Drawing.Point(941, 109);
- this.button10.Name = "button10";
- this.button10.Size = new System.Drawing.Size(128, 26);
- this.button10.TabIndex = 10;
- this.button10.UseVisualStyleBackColor = true;
- this.button10.Click += new System.EventHandler(this.button10_Click);
- //
- // label10
- //
- this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.label10.AutoSize = true;
- this.label10.ForeColor = System.Drawing.SystemColors.ScrollBar;
- this.label10.Location = new System.Drawing.Point(927, 9);
- this.label10.Name = "label10";
- this.label10.Size = new System.Drawing.Size(11, 192);
- this.label10.TabIndex = 9;
- this.label10.Text = "|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|";
- //
- // label9
- //
- this.label9.AutoSize = true;
- this.label9.ForeColor = System.Drawing.SystemColors.ScrollBar;
- this.label9.Location = new System.Drawing.Point(210, 9);
- this.label9.Name = "label9";
- this.label9.Size = new System.Drawing.Size(11, 192);
- this.label9.TabIndex = 8;
- this.label9.Text = "|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|";
- //
- // numericUpDown1
- //
- this.numericUpDown1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.numericUpDown1.Location = new System.Drawing.Point(993, 162);
- this.numericUpDown1.Maximum = new decimal(new int[] {
- 10,
- 0,
- 0,
- 0});
- this.numericUpDown1.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown1.Name = "numericUpDown1";
- this.numericUpDown1.Size = new System.Drawing.Size(70, 21);
- this.numericUpDown1.TabIndex = 7;
- this.numericUpDown1.Value = new decimal(new int[] {
- 3,
- 0,
- 0,
- 0});
- this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
- //
- // label8
- //
- this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.label8.AutoSize = true;
- this.label8.Location = new System.Drawing.Point(957, 167);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(0, 12);
- this.label8.TabIndex = 6;
- //
- // button9
- //
- this.button9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.button9.Location = new System.Drawing.Point(941, 71);
- this.button9.Name = "button9";
- this.button9.Size = new System.Drawing.Size(128, 26);
- this.button9.TabIndex = 5;
- this.button9.UseVisualStyleBackColor = true;
- this.button9.Click += new System.EventHandler(this.button9_Click);
- //
- // button8
- //
- this.button8.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.button8.Location = new System.Drawing.Point(941, 34);
- this.button8.Name = "button8";
- this.button8.Size = new System.Drawing.Size(128, 26);
- this.button8.TabIndex = 4;
- this.button8.UseVisualStyleBackColor = true;
- this.button8.Click += new System.EventHandler(this.button8_Click);
- //
- // dataGridView2
- //
- this.dataGridView2.AllowUserToAddRows = false;
- this.dataGridView2.AllowUserToDeleteRows = false;
- this.dataGridView2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.dataGridView2.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
- this.dataGridView2.BackgroundColor = System.Drawing.Color.White;
- this.dataGridView2.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
- this.dataGridView2.Location = new System.Drawing.Point(228, 20);
- this.dataGridView2.MultiSelect = false;
- this.dataGridView2.Name = "dataGridView2";
- this.dataGridView2.RowHeadersVisible = false;
- this.dataGridView2.RowTemplate.Height = 23;
- this.dataGridView2.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
- this.dataGridView2.Size = new System.Drawing.Size(693, 176);
- this.dataGridView2.TabIndex = 3;
- //
- // listView2
- //
- this.listView2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.listView2.HideSelection = false;
- this.listView2.Location = new System.Drawing.Point(16, 56);
- this.listView2.Name = "listView2";
- this.listView2.Size = new System.Drawing.Size(181, 140);
- this.listView2.TabIndex = 2;
- this.listView2.UseCompatibleStateImageBehavior = false;
- this.listView2.SelectedIndexChanged += new System.EventHandler(this.listView2_SelectedIndexChanged);
- //
- // button7
- //
- this.button7.Location = new System.Drawing.Point(145, 20);
- this.button7.Name = "button7";
- this.button7.Size = new System.Drawing.Size(52, 26);
- this.button7.TabIndex = 1;
- this.button7.UseVisualStyleBackColor = true;
- this.button7.Click += new System.EventHandler(this.button7_Click);
- //
- // button6
- //
- this.button6.Location = new System.Drawing.Point(16, 20);
- this.button6.Name = "button6";
- this.button6.Size = new System.Drawing.Size(93, 26);
- this.button6.TabIndex = 0;
- this.button6.UseVisualStyleBackColor = true;
- this.button6.Click += new System.EventHandler(this.button6_Click);
- //
- // button_ApplyToAll
- //
- this.button_ApplyToAll.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.button_ApplyToAll.Location = new System.Drawing.Point(985, 17);
- this.button_ApplyToAll.Name = "button_ApplyToAll";
- this.button_ApplyToAll.Size = new System.Drawing.Size(84, 24);
- this.button_ApplyToAll.TabIndex = 3;
- this.button_ApplyToAll.UseVisualStyleBackColor = true;
- this.button_ApplyToAll.Click += new System.EventHandler(this.button_ApplyToAll_Click);
- //
- // GrainSizeMeasurementDialog
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
- this.ClientSize = new System.Drawing.Size(1107, 818);
- this.Controls.Add(this.groupBox9);
- this.Controls.Add(this.groupBox8);
- this.Controls.Add(this.groupBox7);
- this.Controls.Add(this.groupBox3);
- this.Controls.Add(this.groupBox2);
- this.Controls.Add(this.groupBox1);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.Name = "GrainSizeMeasurementDialog";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.GrainSizeDialog_FormClosing);
- this.Load += new System.EventHandler(this.GrainSizeDialog_Load);
- this.Shown += new System.EventHandler(this.ShownChoiseItemAndInitData);
- this.Controls.SetChildIndex(this.groupBox1, 0);
- this.Controls.SetChildIndex(this.groupBox2, 0);
- this.Controls.SetChildIndex(this.groupBox3, 0);
- this.Controls.SetChildIndex(this.groupBox7, 0);
- this.Controls.SetChildIndex(this.groupBox8, 0);
- this.Controls.SetChildIndex(this.groupBox9, 0);
- this.groupBox1.ResumeLayout(false);
- this.groupBox1.PerformLayout();
- this.groupBox2.ResumeLayout(false);
- this.groupBox7.ResumeLayout(false);
- this.groupBox7.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
- this.groupBox8.ResumeLayout(false);
- this.groupBox8.PerformLayout();
- this.groupBox9.ResumeLayout(false);
- this.groupBox9.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit();
- this.ResumeLayout(false);
- }
- /// <summary>
- /// 初始化其他控件
- /// </summary>
- private void InitOtherTools()
- {
- //
- //初始化图像控件
- //
- this.documentWorkspace = new DocumentWorkspaceWindow(this.appWorkspace);
- this.documentWorkspace.Dock = DockStyle.Fill;
- this.documentWorkspace.HookMouseEvents();
- this.documentWorkspace.AuxiliaryLineEnabled = false;
- this.documentWorkspace.Visible = false;
- this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.NullTool;
- this.groupBox3.Controls.Add(documentWorkspace);
- //
- //初始化操作按钮
- //
- this.commonControlButtons = new CommonControlButtons();
- this.commonControlButtons.Dock = DockStyle.Top;
- this.commonControlButtons.Height = 30;
- this.commonControlButtons.HideZoomToWindowAndActualSize();
- this.commonControlButtons.Visible = false;
- this.groupBox3.Controls.Add(commonControlButtons);
- //{
- // //二值化相关
- // PhaseModel model = new PhaseModel();
- // model.choise = true;
- // model.mat = null;
- // model.color = panel2.BackColor.ToArgb();
- // model.position = this.documentWorkspace.PhaseModels.Count + 1;
- // model.name = PdnResources.GetString("Menu.BinaryAction.BinaryExtraction.Text");
- // this.documentWorkspace.PhaseModels.Add(model);
- // //二值化end
- //}
- //{
- // //
- // //初始化相
- // //
- // PhaseModel model = new PhaseModel();
- // model.choise = true;
- // model.mat = null;
- // model.color = Color.Green/*panel2.BackColor*/.ToArgb();
- // model.position = this.documentWorkspace.PhaseModels.Count + 1;
- // model.name = PdnResources.GetString("Menu.Grainboundarytoreproduce.text");
- // this.documentWorkspace.PhaseModels.Add(model);
- //}
- //二值化集成2
- bc.OriginCheckedChangedAction += new EventHandler(this.bcOriginCheckedChanged);//初始化原图勾选改变事件
- binaryClass.createDocumentItemsSmaller(new string[] { PdnResources.GetString("Menu.BinaryAction.BinaryExtraction.Text"), PdnResources.GetString("Menu.Grainboundarytoreproduce.text") }
- , this.bc, this.appWorkspace, this.documentWorkspace, this.listView1);//初始化相的工作结构
- binaryClass.BinaryImplFinishAction += new EventHandler(this.bClassBinaryImplFinishAction);//二值化后续处理事件
- //
- //调色板
- //
- this.colorsForm1 = new ColorsForm();
- this.colorsForm1.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm1.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- //
- //颜色panel给定初始值
- //
- this.panel1.BackColor = Color.Green;
- ////
- ////获取系统标尺-毫米
- ////
- //this.appWorkspace.getMeasureInfo().TryGetValue(MeasurementUnit.Millimeter, out unitLength);
- ////double unitLength = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetRuler(MeasurementUnit.Millimeter);
- ////double physical_area_length_Micron = getCurrentWorkspace().GetRuler(MeasurementUnit.Micron);
- //if (this.unitLength == 0)
- // this.unitLength = 1;
- ////
- ////获取当前系统放大倍数
- ////
- //this.gainNumber = this.appWorkspace.GetGainMultiple();
- //if (this.gainNumber == 0)
- // this.gainNumber = 1;
- }
- /// <summary>
- /// 初始化图片列表数据
- /// </summary>
- public void InitPicList()
- {
- //初始化图片列表
- for (int i = 0; i < this.appWorkspace.DocumentWorkspaces.Length; i++)
- {
- this.imageList1.Images.Add("img" + i, this.appWorkspace.DocumentWorkspaces[i].BinarizationThumbnail);
- this.listView1.Items.Add("", i);
- this.listView1.Items[i].ImageIndex = i;
- this.listView1.Items[i].Text = this.appWorkspace.DocumentWorkspaces[i].GetFriendlyName();
- this.listView1.Items[i].Name = this.appWorkspace.DocumentWorkspaces[i].GetFriendlyName();
- }
- }
- /// <summary>
- /// 初始化表头
- /// </summary>
- private void InitGridHeader()
- {
- //
- //分析结果表
- //
- this.dataGridView2.ColumnHeadersHeight = 30;
- DataGridViewTextBoxColumn h1 = new DataGridViewTextBoxColumn();
- h1.Width = 174;
- DataGridViewTextBoxColumn h2 = new DataGridViewTextBoxColumn();
- h2.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
- h2.Width = 172;
- DataGridViewTextBoxColumn h3 = new DataGridViewTextBoxColumn();
- h3.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
- h3.Width = 172;
- DataGridViewTextBoxColumn h4 = new DataGridViewTextBoxColumn();
- h4.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
- h4.Width = 172;
- this.dataGridView2.Columns.Add(h1);
- this.dataGridView2.Columns.Add(h2);
- this.dataGridView2.Columns.Add(h3);
- this.dataGridView2.Columns.Add(h4);
- DataGridViewHelper helper2 = new DataGridViewHelper(this.dataGridView2);
- helper2.Headers.Add(new DataGridViewHelper.TopHeader(0, 1, PdnResources.GetString("Menu.picture.Text")));
- helper2.Headers.Add(new DataGridViewHelper.TopHeader(1, 1, PdnResources.GetString("Menu.Ellipsearea.text")+"(μm)"));
- helper2.Headers.Add(new DataGridViewHelper.TopHeader(2, 1, PdnResources.GetString("Menu.Actualarea.text")+"(μm)"));
- helper2.Headers.Add(new DataGridViewHelper.TopHeader(3, 1, PdnResources.GetString("Menu.ALAgrainlevel.text")));
- this.dataGridView2.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
- this.dataGridView2.Columns[0].ReadOnly = true;
- this.dataGridView2.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable;
- this.dataGridView2.Columns[1].ReadOnly = true;
- this.dataGridView2.Columns[2].SortMode = DataGridViewColumnSortMode.NotSortable;
- this.dataGridView2.Columns[2].ReadOnly = true;
- this.dataGridView2.Columns[3].SortMode = DataGridViewColumnSortMode.NotSortable;
- this.dataGridView2.Columns[3].ReadOnly = true;
- this.dataGridView2.AllowUserToResizeRows = false;
- this.dataGridView2.AllowUserToResizeColumns = false;
- //
- //左下表
- //
- this.listView2.View = View.Details;
- ColumnHeader header0 = new ColumnHeader();
- header0.Text = PdnResources.GetString("Menu.Resultlist.Text");
- header0.Width = 175;
- this.listView2.Columns.Add(header0);
- }
- /// <summary>
- /// 初始化画布按键功能
- /// </summary>
- private void InitCommonButtonEvent()
- {
- this.commonControlButtons.zoomInButton.Click += new EventHandler(zoomInButton_Click);
- this.commonControlButtons.zoomOutButton.Click += new EventHandler(zoomOutButton_Click);
- this.commonControlButtons.zoomToWindowButton.Click += new EventHandler(zoomToWindowButton_Click);
- this.commonControlButtons.actualSizeButton.Click += new EventHandler(actualSizeButton_Click);
- this.commonControlButtons.pointerButton.Click += new EventHandler(pointerButton_Click);
- this.commonControlButtons.mobileModeButton.Click += new EventHandler(mobileModeButton_Click);
- }
- private void zoomInButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomIn();
- }
- private void zoomOutButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomOut();
- }
- private void zoomToWindowButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomBasis = ZoomBasis.FitToWindow;
- }
- private void actualSizeButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomBasis = ZoomBasis.ScaleFactor;
- this.documentWorkspace.ScaleFactor = ScaleFactor.OneToOne;
- }
- private void pointerButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.Pointer;
- }
- private void mobileModeButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.MoveMode;
- }
- /// <summary>
- /// 添加画布绑定事件
- /// </summary>
- private void AddPictureBoxEvent()
- {
- this.documentWorkspace.panel.MouseDown += new MouseEventHandler(this.BoxMouseDownHandler);
- this.documentWorkspace.panel.MouseMove += new MouseEventHandler(this.BoxMouseMoveHandler);
- this.documentWorkspace.panel.MouseUp += new MouseEventHandler(this.BoxMouseUpHandler);
- this.documentWorkspace.panel.Paint += new PaintEventHandler(this.BoxPaintHandler);
- }
- /// <summary>
- /// 调色板回调函数
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ce"></param>
- private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
- {
- }
- /// <summary>
- /// 添加内容单元格
- /// </summary>
- /// <param name="text"></param>
- /// <param name="tag"></param>
- /// <returns></returns>
- private DataGridViewTextBoxCell CreateTextBoxCell(string text, object tag)
- {
- DataGridViewTextBoxCell textboxcell = new DataGridViewTextBoxCell();
- textboxcell.Value = text;
- textboxcell.Tag = tag;
- return textboxcell;
- }
- /// <summary>
- /// 设置按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button1_Click(object sender, EventArgs e)
- {
- AnalyzeSettingDialog grainSizeMeasurementSetDialog = new AnalyzeSettingDialog(this, getModelName());
- if (grainSizeMeasurementSetDialog.hasModule)
- {
- grainSizeMeasurementSetDialog.StartPosition = FormStartPosition.CenterScreen;
- grainSizeMeasurementSetDialog.ShowDialog();
- }
- else
- {
- grainSizeMeasurementSetDialog = null;
- }
- }
- protected Color PhaseModels1Color;
- /// <summary>
- /// 晶界编辑按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button32_Click(object sender, EventArgs e)
- {
- if (this.imageMat == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text") + "!");
- return;
- }
- GrainSizeStandard.IntegrationClass.GrainBoundaryEditingDialog boundaryEditingDialog = new GrainSizeStandard.IntegrationClass.GrainBoundaryEditingDialog(this.appWorkspace, this.menuId, this.listView1.FocusedItem.Index, this.documentWorkspace.PhaseModels[1].mat == null ? Color.Red : PhaseModels1Color/*this.panel1.BackColor*/
- , this.documentWorkspace.PhaseModels[1].mat == null ? null : this.documentWorkspace.PhaseModels[1].mat.Clone());
- if (boundaryEditingDialog.ShowDialog() == DialogResult.OK && boundaryEditingDialog.PhaseMat != null)
- {
- PhaseModels1Color = boundaryEditingDialog.PhaseColor;
- this.documentWorkspace.PhaseModels[1].mat = boundaryEditingDialog.PhaseMat.Clone();
- this.documentWorkspace.Refresh();
- }
- }
- /// <summary>
- /// 保存结果按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button2_Click(object sender, EventArgs e)
- {
- if (this.listView1.SelectedItems.Count > 0)
- {
- string imgName = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetFriendlyName();
- string tag = this.imageList1.Images.Keys[this.listView1.SelectedItems[0].Index];
- bool replace = false;
- int rowIndex = 0;
- if (!string.IsNullOrEmpty(this.textBox1.Text) && !string.IsNullOrEmpty(this.textBox2.Text) && !string.IsNullOrEmpty(this.textBox3.Text))
- {
- if (this.listView2.Items.Count > 0)
- {
- foreach (ListViewItem item in this.listView2.Items)
- {
- if (item.Name.Equals(tag))
- {
- DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Theanalysisreertoreplaceit.text")+"?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
- if (dr == DialogResult.OK)
- {
- replace = true;
- }
- else
- {
- return;
- }
- break;
- }
- }
- }
- double unitLength = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetRuler(MeasurementUnit.Millimeter);
- decimal rulerWidth = decimal.Parse((BasicCalculationHelper.GetDistance(this.nowLine[0], this.nowLine[1], 10) * unitLength).ToString());
- decimal rulerheight = decimal.Parse((BasicCalculationHelper.GetDistance(this.nowLine[2], this.nowLine[3], 10) * unitLength).ToString());
- decimal area = 0.785m * rulerWidth * rulerheight;
- decimal realArea = area / (this.gainNumber * this.gainNumber);
- //有重名需要替换
- if (replace)
- {
- for (int i = 0; i < this.resultTableList.Count; i++)
- {
- if (this.resultTableList[i].TableName.Equals(tag))
- {
- rowIndex = i;
- this.resultTableList.Remove(this.resultTableList[i]);
- if (this.nowLine[0] != PointF.Empty && this.nowLine[1] != PointF.Empty && this.nowLine[2] != PointF.Empty && this.nowLine[3] != PointF.Empty)
- {
- DataTable dt = new DataTable(tag);
- dt.Columns.Add(PdnResources.GetString("Menu.picture.Text"));
- dt.Columns.Add(PdnResources.GetString("Menu.Ellipsearea.text")+"(μm)");
- dt.Columns.Add(PdnResources.GetString("Menu.Actualarea.text")+"(μm)");
- dt.Columns.Add(PdnResources.GetString("Menu.ALAgrainlevel.text"));
- DataRow dataRow = dt.NewRow();
- dataRow[PdnResources.GetString("Menu.picture.Text")] = imgName;
- dataRow[PdnResources.GetString("Menu.Ellipsearea.text")+"(μm)"] = area * 1000000;
- dataRow[PdnResources.GetString("Menu.Actualarea.text")+"(μm)"] = realArea * 1000000;
- dataRow[PdnResources.GetString("Menu.ALAgrainlevel.text")] = this.textBox3.Text;
- dt.Rows.Add(dataRow);
- resultTableList.Insert(rowIndex, dt);
- }
- }
- }
- }
- //新增
- else
- {
- if (this.nowLine[0] != PointF.Empty && this.nowLine[1] != PointF.Empty && this.nowLine[2] != PointF.Empty && this.nowLine[3] != PointF.Empty)
- {
- ListViewItem listViewItem = new ListViewItem();
- listViewItem.Name = tag;
- listViewItem.SubItems[0].Text = imgName;
- this.listView2.Items.Add(listViewItem);
- this.listView2.SelectedItems.Clear();
- this.listView2.Items[this.listView2.Items.Count - 1].Selected = true;
- DataTable dt = new DataTable(tag);
- dt.Columns.Add(PdnResources.GetString("Menu.picture.Text"));
- dt.Columns.Add(PdnResources.GetString("Menu.Ellipsearea.text")+"(μm)");
- dt.Columns.Add(PdnResources.GetString("Menu.Actualarea.text")+"(μm)");
- dt.Columns.Add(PdnResources.GetString("Menu.ALAgrainlevel.text"));
- DataRow dataRow = dt.NewRow();
- dataRow[PdnResources.GetString("Menu.picture.Text")] = imgName;
- dataRow[PdnResources.GetString("Menu.Ellipsearea.text")+"(μm)"] = area * 1000000;
- dataRow[PdnResources.GetString("Menu.Actualarea.text")+"(μm)"] = realArea * 1000000;
- dataRow[PdnResources.GetString("Menu.ALAgrainlevel.text")] = this.textBox3.Text;
- dt.Rows.Add(dataRow);
- resultTableList.Add(dt);
- }
- }
- RefreshDataGridView2();
- //保存处理后的图片
- double pantographRatio = (double)this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetRulerMultiple(MeasurementUnit.Micron);//标尺*放大倍数
- List<Bitmap> tempBit = new List<Bitmap>();
- Bitmap originalBit = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].CompositionSurface.CreateAliasedBitmap();
- originalBit.Tag = pantographRatio;
- tempBit.Add(originalBit);
- Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
- Graphics graphics = Graphics.FromImage(newBit);
- if (this.documentWorkspace.PhaseModels[0].choise && this.documentWorkspace.PhaseModels[0].mat != null)
- {
- Mat targetMat = this.documentWorkspace.PhaseModels[0].mat;
- graphics.DrawImage(OpenCvSharp.Extensions.BitmapConverter.ToBitmap(targetMat), 0, 0, targetMat.Width, targetMat.Height);
- }
- if (this.documentWorkspace.PhaseModels[1].choise && this.documentWorkspace.PhaseModels[1].mat != null)
- {
- Mat targetMat = this.documentWorkspace.PhaseModels[1].mat;
- graphics.DrawImage(OpenCvSharp.Extensions.BitmapConverter.ToBitmap(targetMat), 0, 0, targetMat.Width, targetMat.Height);
- }
- Draw(graphics);
- newBit.Tag = pantographRatio;
- tempBit.Add(newBit);
- if (bitDic.ContainsKey(tag))
- bitDic[tag] = tempBit;
- else
- bitDic.Add(tag, tempBit);
- //拼接中间数据
- List<List<string>> dataList = new List<List<string>>();
- List<string> columnName = new List<string>();
- columnName.Add(PdnResources.GetString("Menu.Imagement.Measurementlist.ordernumber.text"));
- columnName.Add(PdnResources.GetString("Menu.Maximumcalipddderdiameter.Text"));
- columnName.Add(PdnResources.GetString("Menu.Verticalcaliperdiameter.Text"));
- columnName.Add(PdnResources.GetString("Menu.Ellipsearea.text"));
- columnName.Add(PdnResources.GetString("Menu.Actualarea.text"));
- columnName.Add(PdnResources.GetString("Menu.ALAgrainlevel.text"));
- dataList.Add(columnName);
- List<string> strList = new List<string>();
- strList.Add("1");
- strList.Add((1000*rulerWidth).ToString());
- strList.Add((1000*rulerheight).ToString());
- strList.Add((area * 1000000).ToString());
- strList.Add((realArea * 1000000).ToString());
- strList.Add(this.textBox3.Text);
- dataList.Add(strList);
- bool isExist = false;//是否已存在进行替换
- int modelIndex = -1;//要替换的下标
- for (int j = 0; j < tempDataModel.Count; j++)
- {
- if (tempDataModel[j].tagName.Equals(tag))
- {
- isExist = true;
- modelIndex = j;
- break;
- }
- }
- if (isExist && modelIndex > -1)
- tempDataModel[modelIndex].dataList = dataList;
- else
- {
- ExportProjectModel newModel = new ExportProjectModel();
- newModel.tagName = tag;
- newModel.picName = imgName;
- newModel.dataList = dataList;
- tempDataModel.Add(newModel);
- }
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleasedrawthecaliperfirst.text"));
- }
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapictaurefirst.Text"));
- }
- }
- /// <summary>
- /// 刷新分析结果表
- /// </summary>
- private void RefreshDataGridView2()
- {
- this.dataGridView2.Rows.Clear();
- if (this.showAll)
- {
- if (this.resultTableList.Count > 0)
- {
- foreach (DataTable dt in resultTableList)
- {
- for(int i = 0; i < dt.Rows.Count; i++)
- {
- DataGridViewRow row = new DataGridViewRow();
- row.Height = 30;
- row.Cells.Add(CreateTextBoxCell(dt.Rows[i][0].ToString(), ""));
- row.Cells.Add(CreateTextBoxCell(Math.Round(Convert.ToDecimal(string.IsNullOrEmpty(dt.Rows[i][1].ToString()) ? "0" :
- dt.Rows[i][1].ToString()), Convert.ToInt32(this.numericUpDown1.Value)) + "", ""));
- row.Cells.Add(CreateTextBoxCell(Math.Round(Convert.ToDecimal(string.IsNullOrEmpty(dt.Rows[i][2].ToString()) ? "0" :
- dt.Rows[i][2].ToString()), Convert.ToInt32(this.numericUpDown1.Value)) + "", ""));
- row.Cells.Add(CreateTextBoxCell(dt.Rows[i][3].ToString(), ""));
- this.dataGridView2.Rows.Add(row);
- }
- }
- }
- }
- else
- {
- if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0)
- {
- for (int i = 0; i < this.listView2.SelectedItems.Count; i++)
- {
- string tableName = this.listView2.SelectedItems[i].Name;
- foreach (DataTable dt in resultTableList)
- {
- if (dt.TableName.Equals(tableName))
- {
- for (int j = 0; j < dt.Rows.Count; j++)
- {
- DataGridViewRow row = new DataGridViewRow();
- row.Height = 30;
- row.Cells.Add(CreateTextBoxCell(dt.Rows[j][0].ToString(), ""));
- row.Cells.Add(CreateTextBoxCell(Math.Round(Convert.ToDecimal(string.IsNullOrEmpty(dt.Rows[j][1].ToString()) ? "0" :
- dt.Rows[j][1].ToString()), Convert.ToInt32(this.numericUpDown1.Value)) + "", ""));
- row.Cells.Add(CreateTextBoxCell(Math.Round(Convert.ToDecimal(string.IsNullOrEmpty(dt.Rows[j][2].ToString()) ? "0" :
- dt.Rows[j][2].ToString()), Convert.ToInt32(this.numericUpDown1.Value)) + "", ""));
- row.Cells.Add(CreateTextBoxCell(dt.Rows[j][3].ToString(), ""));
- this.dataGridView2.Rows.Add(row);
- }
- }
- }
- }
- }
- }
- }
- /// <summary>
- /// 全部显示按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button6_Click(object sender, EventArgs e)
- {
- if(this.button6.Text == PdnResources.GetString("Menu.Showall.text"))
- {
- this.button6.Text = PdnResources.GetString("Menu.Cancelshowall.text");
- this.showAll = true;
- RefreshDataGridView2();
- }
- else if (this.button6.Text == PdnResources.GetString("Menu.Cancelshowall.text"))
- {
- this.button6.Text = PdnResources.GetString("Menu.Showall.text");
- this.showAll = false;
- RefreshDataGridView2();
- }
- }
- /// <summary>
- /// 删除按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button7_Click(object sender, EventArgs e)
- {
- if(this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0)
- {
- DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Determineallanalysisrlete.text")+"?", PdnResources.GetString("Menu.alert.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
- if (dr == DialogResult.OK)
- {
- for (int i = 0; i < this.listView2.SelectedItems.Count; i++)
- {
- string tableName = this.listView2.SelectedItems[i].Name;
- foreach (DataTable dt in resultTableList)
- {
- if (dt.TableName.Equals(tableName))
- {
- resultTableList.Remove(dt);
- break;
- }
- }
- if (bitDic.ContainsKey(tableName))
- bitDic.Remove(tableName);
- foreach (ExportProjectModel model in this.tempDataModel)
- {
- if (model.tagName.Equals(tableName))
- {
- this.tempDataModel.Remove(model);
- break;
- }
- }
- }
- foreach (ListViewItem item in this.listView2.Items)
- {
- if (item.Selected)
- this.listView2.Items.Remove(item);
- }
- RefreshDataGridView2();
- }
- }
- }
- /// <summary>
- /// 生成报告按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button8_Click(object sender, EventArgs e)
- {
- if (this.checkBox1.Checked)
- this.button1.PerformClick();
- if (this.analyzeSettingModel != null && !string.IsNullOrEmpty(this.analyzeSettingModel.analyzeClassify))
- {
- //获取word书签与excel单元格的关系,以字典方式存储
- List<mic_module_infos> mic_module_infos = mic_module_infos_BLL.FindAll().FindAll(a => a.analyze_classify == this.analyzeSettingModel.analyzeClassify);
- Dictionary<string, string> tagInfos = new Dictionary<string, string>();
- if (mic_module_infos != null && mic_module_infos.Count > 0)
- {
- foreach (mic_module_infos info in mic_module_infos)
- {
- tagInfos.Add(info.tag_name, info.cell_position);
- }
- }
- //分析结果
- List<List<string>> analysisContent = new List<List<string>>();
- List<string> contentHead = new List<string>();
- contentHead.Add(PdnResources.GetString("Menu.picture.Text"));
- contentHead.Add(PdnResources.GetString("Menu.Ellipsearea.text")+"(μm)");
- contentHead.Add(PdnResources.GetString("Menu.Actualarea.text")+"(μm)");
- contentHead.Add(PdnResources.GetString("Menu.ALAgrainlevel.text"));
- analysisContent.Add(contentHead);
- foreach (DataGridViewRow item in this.dataGridView2.Rows)
- {
- List<string> content = new List<string>();
- content.Add(item.Cells[0].Value.ToString());
- content.Add(item.Cells[1].Value.ToString());
- content.Add(item.Cells[2].Value.ToString());
- content.Add(item.Cells[3].Value.ToString());
- analysisContent.Add(content);
- }
- //图片
- bitList = new List<Bitmap>();
- if (this.showAll)
- {
- foreach(KeyValuePair<string, List<Bitmap>> kv in this.bitDic)
- {
- bitList.Add(kv.Value[0]);
- bitList.Add(kv.Value[1]);
- }
- }
- else
- {
- if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0)
- {
- foreach (ListViewItem item in this.listView2.SelectedItems)
- {
- if (bitDic.ContainsKey(item.Name))
- {
- bitList.Add(bitDic[item.Name][0]);
- bitList.Add(bitDic[item.Name][1]);
- }
- }
- }
- }
-
- this.appWorkspace.CreateAnalysisReport(this.analyzeSettingModel, analysisContent, bitList, tagInfos);
- }
- else
- MessageBox.Show(PdnResources.GetString("Menu.Pleasesettheanalysisreportfirst.text")+"!");
- }
- /// <summary>
- /// 导出结果按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button9_Click(object sender, EventArgs e)
- {
- if (this.listView2.Items.Count > 0)
- {
- SaveFileDialog exe = new SaveFileDialog();
- exe.Filter = "Execl files (*.xlsx)|*.xlsx";
- exe.FilterIndex = 0;
- exe.RestoreDirectory = true;
- //exe.CreatePrompt = true;
- exe.Title = "Export Excel File";
- exe.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
- exe.FileName = PdnResources.GetString("Menu.DedicatedAnalysis.BlackMetal.GrainSize.Text")+ PdnResources.GetString("Menu.Dedicatedanalysis.blackmetal.Measurementmethod.text") + PdnResources.GetString("Menu.Analysisresult.text") + DateTime.Now.ToString("yyyyMMddHHmmss");
- DialogResult dr = exe.ShowDialog();
- if (dr != DialogResult.OK)
- return;
- DataTable dtb = new DataTable();
- dtb.Columns.Add(PdnResources.GetString("Menu.picture.Text"));
- dtb.Columns.Add(PdnResources.GetString("Menu.Ellipsearea.text")+"(μm)");
- dtb.Columns.Add(PdnResources.GetString("Menu.Actualarea.text")+"(μm)");
- dtb.Columns.Add(PdnResources.GetString("Menu.ALAgrainlevel.text"));
- for(int i = 0; i < this.dataGridView2.Rows.Count; i++)
- {
- DataRow dataRow = dtb.NewRow();
- dataRow[PdnResources.GetString("Menu.picture.Text")] = this.dataGridView2.Rows[i].Cells[0].Value;
- dataRow[PdnResources.GetString("Menu.Ellipsearea.text")+"(μm)"] = this.dataGridView2.Rows[i].Cells[1].Value;
- dataRow[PdnResources.GetString("Menu.Actualarea.text")+"(μm)"] = this.dataGridView2.Rows[i].Cells[2].Value;
- dataRow[PdnResources.GetString("Menu.ALAgrainlevel.text")] = this.dataGridView2.Rows[i].Cells[3].Value;
- dtb.Rows.Add(dataRow);
- }
- List<DataTable> list = new List<DataTable>();
- list.Add(dtb);
- this.appWorkspace.ExportDataToExcelWithProgress(list, exe.FileName, true, false, true);
- }
- else
- MessageBox.Show(PdnResources.GetString("Menu.Noanalysineratereport.text")+"!");
- }
- /// <summary>
- /// 图像索引切换选中事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void listView1_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (this.listView1.FocusedItem != null && this.listView1.FocusedItem.Selected)
- {
- existViewFlag = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GraphicsList.IsExsitView();
- this.imageMat = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].CompositionSurface.CreatedAliasedMat();
- nowLine = new PointF[4];
- rectangleFBorder = new RectangleF();
- //二值化集成4
- binaryClass.listView1_SelectedIndexChanged(this.imageMat.Clone(), this.getCurrentWorkTag()/*.listView1.SelectedItems.Count == 0 ? null : this.imageList1.Images.Keys[this.listView1.SelectedItems[0].Index]*/);
- if (binaryClass.getModelMat(getCurrentWorkTag()) != null)
- this.documentWorkspace.PhaseModels[0].mat = binaryClass.getModelMat(getCurrentWorkTag()).Clone();
- if (this.selectPicture >= 0)
- {
- this.saveDialogParamValues(this.imageList1.Images.Keys[this.selectPicture].ToString());
- if (!this.analysisDict.ContainsKey(getCurrentWorkTag()))
- this.analysisDict.Add(getCurrentWorkTag(), this.analysisDict[this.imageList1.Images.Keys[this.selectPicture]].cloneListParamModel(this.menuId));
- }
- this.showSaveParamToControl();
- //if (this.checkBox1.Checked)
- //{
- // //this.documentWorkspace.PhaseModels[1].choise = true;//###
- // this.applyDect();
- //}
- string toSelectImageKey = getCurrentWorkTag();
- ////选择了应用晶界重现但是没有计算结果,则进行晶界重现的计算
- //if (this.grainBoundaryDict.ContainsKey(toSelectImageKey) && this.grainBoundaryDict[toSelectImageKey].grainApplygrainboundaries == 1
- // && !this.grainBoundaryMatDict.ContainsKey(toSelectImageKey))
- //{
- // procClass = new ProgressThreadProcClass();
- // procClass.StartProgressAutoAction(this, new System.Threading.ThreadStart(applyDectAction), PdnResources.GetString("Menu.Grainboundarytoreproduce.text"));
- //}
- if (this.grainBoundaryMatDict.ContainsKey(toSelectImageKey))
- {
- this.documentWorkspace.PhaseModels[1].mat = this.grainBoundaryMatDict[toSelectImageKey].Clone();
- this.documentWorkspace.PhaseModels[1].choise = !bcOriginChecked();
- }
- else
- this.documentWorkspace.PhaseModels[1].mat = null;
- this.commonControlButtons.Visible = true;
- this.selectPicture = this.listView1.FocusedItem.Index;
- ResetAllText();
- this.button3.Text = PdnResources.GetString("Menu.measuring.text");
- }
- }
- private string getCurrentWorkTag()
- {
- if (this.listView1.FocusedItem != null && this.listView1.FocusedItem.Selected)
- return this.imageList1.Images.Keys[this.listView1.FocusedItem/*SelectedItems[0]*/.Index];
- return null;
- }
- /// <summary>
- /// 颜色panel被点击
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void panel1_Click(object sender, EventArgs e)
- {
- this.colorsForm1.UserPrimaryColor = ColorBgra.FromColor(this.panel1.BackColor);
- this.colorsForm1.setSaveBtn_Click(new System.EventHandler(this.colorsForm1Changed));
- this.colorsForm1.ShowDialog();
- }
- private void colorsForm1Changed(object sender, EventArgs e)
- {
- this.panel1.BackColor = this.colorsForm1.UserPrimaryColor.ToColor();
- this.colorsForm1.Close();
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 小数数字框值改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown1_ValueChanged(object sender, EventArgs e)
- {
- if (this.numericUpDown1.Value > this.numericUpDown1.Maximum)
- this.numericUpDown1.Value = this.numericUpDown1.Maximum;
- if (this.numericUpDown1.Value < this.numericUpDown1.Minimum)
- this.numericUpDown1.Value = this.numericUpDown1.Minimum;
- CalcArea();
- RefreshDataGridView2();
- }
- /// <summary>
- /// 测量按钮被点击
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button3_Click(object sender, EventArgs e)
- {
- if (this.button3.Text == PdnResources.GetString("Menu.measuring.text"))
- canDraw = true;
- else if (this.button3.Text == PdnResources.GetString("Menu.Edit.Delete.Text"))
- {
- DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Areyousucalipers.text") + "?", PdnResources.GetString("Menu.alert.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
- if (dr == DialogResult.OK)
- {
- this.nowLine = new PointF[4];
- this.button3.Text = PdnResources.GetString("Menu.measuring.text");
- ResetAllText();
- this.documentWorkspace.Refresh();
- }
- }
- }
- /// <summary>
- /// 鼠标按下
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void BoxMouseDownHandler(object sender, MouseEventArgs e)
- {
- if (e.Button == MouseButtons.Left)
- {
- PointF downPoint = this.documentWorkspace.GetScalePoint(e.Location);
- if (canDraw)
- {
- clickCount++;
- if (clickCount == 1)
- {
- startPoint = endPoint = downPoint;
- nowLine[0] = startPoint;
- nowLine[1] = endPoint;
- }
- else if (clickCount == 2)
- {
- if (this.startPoint == this.endPoint)
- {
- canDraw = false;
- clickCount = 0;
- this.nowLine = new PointF[4];
- }
- }
- else if (clickCount == 3)
- {
- nowLine[2] = downPoint;
- tempPoint.X = downPoint.X;
- tempPoint.Y = downPoint.Y;
- }
- else if (clickCount == 4)
- {
- if (this.nowLine[3] == PointF.Empty)
- {
- canDraw = false;
- clickCount = 0;
- this.nowLine = new PointF[4];
- this.documentWorkspace.Refresh();
- MessageBox.Show(PdnResources.GetString("Menu.Thetwopointsoftaintodraw.text"));
- return;
- }
- CalcOtherRectangle();
- CalcDiameter();
- canDraw = false;
- clickCount = 0;
- if (this.nowLine[3] != PointF.Empty)
- {
- this.button3.Text = PdnResources.GetString("Menu.Edit.Delete.Text");
- selected = true;
- }
- }
- }
- else
- {
- lastPoint.X = downPoint.X;
- lastPoint.Y = downPoint.Y;
- if (rectangleFBorder.Contains(downPoint))
- {
- selected = true;
- canMove = true;
- }
- if (selected)
- {
- if (new RectangleF(this.nowLine[0].X - 3, this.nowLine[0].Y - 3, 7, 7).Contains(downPoint))
- movePointIndex = 0;
- else if (new RectangleF(this.nowLine[1].X - 3, this.nowLine[1].Y - 3, 7, 7).Contains(downPoint))
- movePointIndex = 1;
- else if (new RectangleF(this.nowLine[2].X - 3, this.nowLine[2].Y - 3, 7, 7).Contains(downPoint))
- movePointIndex = 2;
- else if (new RectangleF(this.nowLine[3].X - 3, this.nowLine[3].Y - 3, 7, 7).Contains(downPoint))
- movePointIndex = 3;
- else
- movePointIndex = -1;
- }
- if (canMove)
- return;
- selected = false;
- }
- }
- }
- /// <summary>
- /// 鼠标移动
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void BoxMouseMoveHandler(object sender, MouseEventArgs e)
- {
- this.documentWorkspace.panel.Cursor = Cursors.Default;
- if(canDraw)
- {
- PointF movePoint = this.documentWorkspace.GetScalePoint(e.Location);
- if (clickCount == 1)
- {
- this.endPoint = movePoint;
- this.nowLine[1] = this.endPoint;
- }
- else if (clickCount == 3 && this.nowLine[2] != PointF.Empty)
- {
- //第二条线是水平线
- if(this.nowLine[0].X == this.nowLine[1].X)
- {
- this.nowLine[3].Y = this.nowLine[2].Y;
- this.nowLine[3].X = movePoint.X;
- }
- //第二条线是垂线
- else if (this.nowLine[0].Y == this.nowLine[1].Y)
- {
- this.nowLine[3].X = this.nowLine[2].X;
- this.nowLine[3].Y = movePoint.Y;
- }
- //其他情况
- else
- {
- float k = -1 / ((this.nowLine[1].Y - this.nowLine[0].Y) / (this.nowLine[1].X - this.nowLine[0].X));
- float b = this.nowLine[2].Y - k * this.nowLine[2].X;
- float dxTemp = movePoint.X - tempPoint.X;
- float dyTemp = movePoint.Y - tempPoint.Y;
- if (Math.Abs(dxTemp) >= Math.Abs(dyTemp))
- {
- this.nowLine[3].X = movePoint.X;
- this.nowLine[3].Y = k * this.nowLine[3].X + b;
- }
- else
- {
- this.nowLine[3].Y = movePoint.Y;
- this.nowLine[3].X = (this.nowLine[3].Y - b) / k;
- }
- }
- }
- this.documentWorkspace.Refresh();
- }
- else
- {
- if(selected && e.Button == MouseButtons.Left && canMove)
- {
- PointF movePoint = this.documentWorkspace.GetScalePoint(e.Location);
- float dx = movePoint.X - lastPoint.X;
- float dy = movePoint.Y - lastPoint.Y;
- lastPoint.X = movePoint.X;
- lastPoint.Y = movePoint.Y;
- if(movePointIndex == -1)
- {
- if (rectangleFBorder.Contains(movePoint))
- this.documentWorkspace.panel.Cursor = Cursors.SizeAll;
- rectangleFBorder.X += dx;
- rectangleFBorder.Y += dy;
- for (int i = 0; i < this.nowLine.Count(); i++)
- {
- this.nowLine[i].X += dx;
- this.nowLine[i].Y += dy;
- }
- }
- else if (movePointIndex == 0)
- {
- PointF oldPoint = new PointF(nowLine[0].X, nowLine[0].Y);
- this.nowLine[0].X += dx;
- this.nowLine[0].Y += dy;
- double angle = BasicCalculationHelper.CalculateAngle(nowLine[1].X, nowLine[1].Y, oldPoint.X, oldPoint.Y ,nowLine[0].X, nowLine[0].Y);
- this.nowLine[3] = BasicCalculationHelper.GetAnglePoint(this.nowLine[3], this.nowLine[2], angle);
- CalcDiameter();
- }
- else if (movePointIndex == 1)
- {
- PointF oldPoint = new PointF(nowLine[1].X, nowLine[1].Y);
- this.nowLine[1].X += dx;
- this.nowLine[1].Y += dy;
- double angle = BasicCalculationHelper.CalculateAngle(nowLine[0].X, nowLine[0].Y, oldPoint.X, oldPoint.Y, nowLine[1].X, nowLine[1].Y);
- this.nowLine[3] = BasicCalculationHelper.GetAnglePoint(this.nowLine[3], this.nowLine[2], angle);
- CalcDiameter();
- }
- else if (movePointIndex == 2)
- {
- PointF oldPoint = new PointF(nowLine[2].X, nowLine[2].Y);
- this.nowLine[2].X += dx;
- this.nowLine[2].Y += dy;
- double angle = BasicCalculationHelper.CalculateAngle(nowLine[3].X, nowLine[3].Y, oldPoint.X, oldPoint.Y, nowLine[2].X, nowLine[2].Y);
- this.nowLine[1] = BasicCalculationHelper.GetAnglePoint(this.nowLine[1], this.nowLine[0], angle);
- CalcDiameter();
- }
- else if (movePointIndex == 3)
- {
- PointF oldPoint = new PointF(nowLine[3].X, nowLine[3].Y);
- this.nowLine[3].X += dx;
- this.nowLine[3].Y += dy;
- double angle = BasicCalculationHelper.CalculateAngle(nowLine[2].X, nowLine[2].Y, oldPoint.X, oldPoint.Y, nowLine[3].X, nowLine[3].Y);
- this.nowLine[1] = BasicCalculationHelper.GetAnglePoint(this.nowLine[1], this.nowLine[0], angle);
- CalcDiameter();
- }
- CalcOtherRectangle();
- this.documentWorkspace.Refresh();
- }
- }
- }
- /// <summary>
- /// 鼠标抬起
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void BoxMouseUpHandler(object sender, MouseEventArgs e)
- {
- if (e.Button == MouseButtons.Left && canMove)
- {
- canMove = false;
- movePointIndex = -1;
- }
- }
- /// <summary>
- /// 绘制事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void BoxPaintHandler(object sender, PaintEventArgs e)
- {
- if (this.documentWorkspace.CompositionSurface != null)
- {
- Rectangle rc = this.documentWorkspace.panel.ClientRectangle;
- int width = (int)(this.documentWorkspace.CompositionSurface.Width * this.documentWorkspace.ScaleFactor.Ratio);
- int height = (int)(this.documentWorkspace.CompositionSurface.Height * this.documentWorkspace.ScaleFactor.Ratio);
- int x = (rc.Width < width) ? this.documentWorkspace.panel.AutoScrollPosition.X : (rc.Width - width) / 2;
- int y = (rc.Height < height) ? this.documentWorkspace.panel.AutoScrollPosition.Y : (rc.Height - height) / 2;
- e.Graphics.TranslateTransform(x, y);
- e.Graphics.ScaleTransform((float)this.documentWorkspace.ScaleFactor.Ratio, (float)this.documentWorkspace.ScaleFactor.Ratio);
- Draw(e.Graphics);
- e.Graphics.ScaleTransform(1 / (float)this.documentWorkspace.ScaleFactor.Ratio, 1 / (float)this.documentWorkspace.ScaleFactor.Ratio);
- e.Graphics.TranslateTransform(-x, -y);
- }
- }
- /// <summary>
- /// 绘制
- /// </summary>
- private void Draw(Graphics graphics)
- {
- graphics.SmoothingMode = SmoothingMode.AntiAlias;
- Pen measurePen = new Pen(this.panel1.BackColor, Convert.ToInt32(this.numericUpDown2.Value));//基准线画笔
- Pen borderPen = new Pen(Color.Black);//填充点外圈
- SolidBrush insideBrush = new SolidBrush(Color.White);//填充点内圈
- Pen rectPen = new Pen(Color.Black);
- rectPen.DashStyle = DashStyle.Custom;
- float[] dashArray = { 2.0f, 3.0f };
- rectPen.DashPattern = dashArray;
- if (this.nowLine[0] != this.nowLine[1])
- {
- graphics.DrawLine(measurePen, nowLine[0], nowLine[1]);
- if (this.nowLine[2] != PointF.Empty && this.nowLine[3] != PointF.Empty)
- {
- graphics.DrawLine(measurePen, nowLine[2], nowLine[3]);
- }
- }
- if (selected && !canDraw)
- {
- if(this.nowLine[0] != PointF.Empty)
- {
- graphics.DrawRectangle(borderPen, new Rectangle((int)(this.nowLine[0].X - 3), (int)(this.nowLine[0].Y - 3), 7, 7));
- graphics.FillRectangle(insideBrush, new RectangleF(this.nowLine[0].X - 3, this.nowLine[0].Y - 3, 7, 7));
- }
- if (this.nowLine[1] != PointF.Empty)
- {
- graphics.DrawRectangle(borderPen, new Rectangle((int)(this.nowLine[1].X - 3), (int)(this.nowLine[1].Y - 3), 7, 7));
- graphics.FillRectangle(insideBrush, new RectangleF(this.nowLine[1].X - 3, this.nowLine[1].Y - 3, 7, 7));
- }
- if (this.nowLine[2] != PointF.Empty)
- {
- graphics.DrawRectangle(borderPen, new Rectangle((int)(this.nowLine[2].X - 3), (int)(this.nowLine[2].Y - 3), 7, 7));
- graphics.FillRectangle(insideBrush, new RectangleF(this.nowLine[2].X - 3, this.nowLine[2].Y - 3, 7, 7));
- }
- if (this.nowLine[3] != PointF.Empty)
- {
- graphics.DrawRectangle(borderPen, new Rectangle((int)(this.nowLine[3].X - 3), (int)(this.nowLine[3].Y - 3), 7, 7));
- graphics.FillRectangle(insideBrush, new RectangleF(this.nowLine[3].X - 3, this.nowLine[3].Y - 3, 7, 7));
- }
- graphics.DrawRectangle(rectPen, rectangleFBorder.X, rectangleFBorder.Y, rectangleFBorder.Width, rectangleFBorder.Height);
- }
- measurePen.Dispose();
- borderPen.Dispose();
- insideBrush.Dispose();
- rectPen.Dispose();
- }
- /// <summary>
- /// 分析结果列表选择切换
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void listView2_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (this.showAll)
- return;
- RefreshDataGridView2();
- }
- /// <summary>
- /// 修改线宽
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown2_ValueChanged(object sender, EventArgs e)
- {
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 计算外接矩形
- /// </summary>
- private void CalcOtherRectangle()
- {
- RectangleF rectangleF = new RectangleF();
- float[] pointX = new float[] { this.nowLine[0].X, this.nowLine[1].X, this.nowLine[2].X, this.nowLine[3].X };
- rectangleF.X = (int)pointX.Min();
- float[] pointY = new float[] { this.nowLine[0].Y, this.nowLine[1].Y, this.nowLine[2].Y, this.nowLine[3].Y };
- rectangleF.Y = (int)pointY.Min();
- rectangleF.Width = (int)Math.Abs(pointX.Max() - pointX.Min());
- rectangleF.Height = (int)Math.Abs(pointY.Max() - pointY.Min());
- rectangleFBorder = new RectangleF(rectangleF.X - 3, rectangleF.Y - 3, rectangleF.Width + 7, rectangleF.Height + 7);
- }
- /// <summary>
- /// 计算面积及其他数值
- /// </summary>
- private void CalcArea()
- {
- if(this.numericUpDown3.Value != 0 && this.numericUpDown4.Value != 0)
- {
- double unitLength = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetRuler(MeasurementUnit.Millimeter);
- double widthLine = BasicCalculationHelper.GetDistance(this.nowLine[0], this.nowLine[1], 10) * unitLength;
- double heightLine = BasicCalculationHelper.GetDistance(this.nowLine[2], this.nowLine[3], 10) * unitLength;
- decimal area = 0.785m * (decimal)widthLine * (decimal)heightLine;
- decimal realArea = (area / (this.gainNumber * this.gainNumber));// * (area / this.gainNumber);
- //椭圆面积
- this.textBox1.Text = Math.Round(area * 1000000, Convert.ToInt32(this.numericUpDown1.Value)) + "";
- //实际面积
- this.textBox2.Text = Math.Round(realArea * 1000000, Convert.ToInt32(this.numericUpDown1.Value)) + "";
- //ALA晶粒级别
- string level = "";
- realArea = realArea;
- if (realArea <= levelArr[0])
- level = "7.0";
- else if (realArea > levelArr[0] && realArea <= levelArr[1])
- level = "6.5";
- else if (realArea > levelArr[1] && realArea <= levelArr[2])
- level = "6.0";
- else if (realArea > levelArr[2] && realArea <= levelArr[3])
- level = "5.5";
- else if (realArea > levelArr[3] && realArea <= levelArr[4])
- level = "5.0";
- else if (realArea > levelArr[4] && realArea <= levelArr[5])
- level = "4.5";
- else if (realArea > levelArr[5] && realArea <= levelArr[6])
- level = "4.0";
- else if (realArea > levelArr[6] && realArea <= levelArr[7])
- level = "3.5";
- else if (realArea > levelArr[7] && realArea <= levelArr[8])
- level = "3.0";
- else if (realArea > levelArr[8] && realArea <= levelArr[9])
- level = "2.5";
- else if (realArea > levelArr[9] && realArea <= levelArr[10])
- level = "2.0";
- else if (realArea > levelArr[10] && realArea <= levelArr[11])
- level = "1.5";
- else if (realArea > levelArr[11] && realArea <= levelArr[12])
- level = "1.0";
- else if (realArea > levelArr[12] && realArea <= levelArr[13])
- level = "0.5";
- else if (realArea > levelArr[13] && realArea <= levelArr[14])
- level = "0";
- else if (realArea > levelArr[14] && realArea <= levelArr[15])
- level = "-0.5";
- else if (realArea > levelArr[15] && realArea <= levelArr[16])
- level = "00"+ PdnResources.GetString("Menu.or.Text")+ "-1.0";
- else if (realArea > levelArr[16] && realArea <= levelArr[17])
- level = "-1.5";
- else if (realArea > levelArr[17] && realArea <= levelArr[18])
- level = "000"+ PdnResources.GetString("Menu.or.Text")+ "-2.0";
- else if (realArea > levelArr[18] && realArea <= levelArr[19])
- level = "-2.5";
- else if (realArea > levelArr[19] && realArea <= levelArr[20])
- level = "0000"+ PdnResources.GetString("Menu.or.Text")+ "-3.0";
- else if (realArea > levelArr[20] && realArea <= levelArr[21])
- level = "-3.5";
- else if (realArea > levelArr[21] && realArea <= levelArr[22])
- level = "00000"+ PdnResources.GetString("Menu.or.Text")+ "-4.0";
- else
- level = PdnResources.GetString("Menu.Theunknown.Text");
- this.textBox3.Text = level;
- }
- }
- /// <summary>
- /// 重置所有文本状态
- /// </summary>
- private void ResetAllText()
- {
- selected = false;
- this.numericUpDown3.ValueChanged -= numericUpDown3_ValueChanged;
- this.numericUpDown4.ValueChanged -= numericUpDown4_ValueChanged;
- this.numericUpDown3.ReadOnly = true;
- this.numericUpDown3.Value = 0;
- this.numericUpDown4.ReadOnly = true;
- this.numericUpDown4.Value = 0;
- this.numericUpDown3.ValueChanged += new EventHandler(numericUpDown3_ValueChanged);
- this.numericUpDown4.ValueChanged += new EventHandler(numericUpDown4_ValueChanged);
- this.textBox1.Text = "";
- this.textBox2.Text = "";
- this.textBox3.Text = "";
- }
- /// <summary>
- /// 修改最大卡尺直径
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown3_ValueChanged(object sender, EventArgs e)
- {
- if(this.numericUpDown3.Value > 0 && this.numericUpDown4.Value > 0 && this.nowLine != null && this.nowLine[0] != PointF.Empty && this.nowLine[1] != PointF.Empty)
- {
- PointF newPointF = GetRotationPoint(this.nowLine[0], this.nowLine[1], this.numericUpDown3.Value);
- if(newPointF != PointF.Empty)
- {
- this.nowLine[1] = newPointF;
- CalcOtherRectangle();
- CalcArea();
- this.documentWorkspace.Refresh();
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Thevalueistoolarecalculated.text"));
- }
- }
- }
- /// <summary>
- /// 修改垂直卡尺直径
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown4_ValueChanged(object sender, EventArgs e)
- {
- if (this.numericUpDown3.Value > 0 && this.numericUpDown4.Value > 0 && this.nowLine != null && this.nowLine[2] != PointF.Empty && this.nowLine[3] != PointF.Empty)
- {
- PointF newPointF = GetRotationPoint(this.nowLine[2], this.nowLine[3], this.numericUpDown4.Value);
- if (newPointF != PointF.Empty)
- {
- this.nowLine[3] = newPointF;
- CalcOtherRectangle();
- CalcArea();
- this.documentWorkspace.Refresh();
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Thevalueistoolargetocalculate.text"));
- }
- }
- }
- /// <summary>
- /// 重新计算改变长度后的点
- /// </summary>
- /// <param name="cen"></param>
- /// <param name="rotation"></param>
- /// <param name="newLineLength"></param>
- /// <returns></returns>
- private PointF GetRotationPoint(PointF cen, PointF rotation, decimal newLength)
- {
- decimal maxValue = Convert.ToDecimal(Math.Sqrt(int.MaxValue));
- decimal minValue = Convert.ToDecimal(Math.Sqrt(4.9E-324));
- double lineLength = BasicCalculationHelper.GetDistance(cen, rotation, 10);
- double unitLength = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetRuler(MeasurementUnit.Millimeter);
- decimal newLineLength = newLength / (decimal)(unitLength * 1000);
- if (newLineLength >= maxValue)
- return PointF.Empty;
- if (newLineLength <= minValue)
- return PointF.Empty;
- PointF rotationPoint = new PointF(cen.X + (float)newLineLength, cen.Y);
- double angle = BasicCalculationHelper.Angle(cen, new PointF(cen.X + (float)lineLength, cen.Y), rotation);
- if (rotation.Y < cen.Y)
- {
- angle = 360 - angle;
- }
- Matrix matrix = new Matrix();
- matrix.RotateAt((float)angle, cen);
- PointF[] ff = new PointF[1];
- ff[0] = rotationPoint;
- matrix.TransformPoints(ff);
- matrix.Dispose();
- matrix = null;
- return ff[0];
- }
- /// <summary>
- /// 计算直径
- /// </summary>
- private void CalcDiameter()
- {
- this.numericUpDown3.ValueChanged -= numericUpDown3_ValueChanged;
- this.numericUpDown4.ValueChanged -= numericUpDown4_ValueChanged;
- double unitLength = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetRuler(MeasurementUnit.Millimeter);
- this.numericUpDown3.ReadOnly = false;
- this.numericUpDown3.Value = decimal.Parse(Math.Round((BasicCalculationHelper.GetDistance(this.nowLine[0], this.nowLine[1], 10) * 1000 * unitLength), 5).ToString());
- this.numericUpDown4.ReadOnly = false;
- this.numericUpDown4.Value = decimal.Parse(Math.Round((BasicCalculationHelper.GetDistance(this.nowLine[2], this.nowLine[3], 10) * 1000 * unitLength), 5).ToString());
- this.numericUpDown3.ValueChanged += new EventHandler(numericUpDown3_ValueChanged);
- this.numericUpDown4.ValueChanged += new EventHandler(numericUpDown4_ValueChanged);
- CalcArea();
- }
- /// <summary>
- /// 导出项目
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button10_Click(object sender, EventArgs e)
- {
- if (this.checkBox1.Checked)
- this.button1.PerformClick();
- if (this.analyzeSettingModel != null && !string.IsNullOrEmpty(this.analyzeSettingModel.analyzeClassify))
- {
- Instrument.ProjectEngineering.NodeItem nodeItem = this.appWorkspace.GetInsertProjectPath(2, "Menu.DedicatedAnalysis.BlackMetal.GrainSize.Text", this.analyzeSettingModel.savePath);
- if (nodeItem == null) return;
- //获取word书签与excel单元格的关系,以字典方式存储
- List<mic_module_infos> mic_module_infos = mic_module_infos_BLL.FindAll().FindAll(a => a.analyze_classify == this.analyzeSettingModel.analyzeClassify);
- Dictionary<string, string> tagInfos = new Dictionary<string, string>();
- if (mic_module_infos != null && mic_module_infos.Count > 0)
- {
- foreach (mic_module_infos info in mic_module_infos)
- {
- tagInfos.Add(info.tag_name, info.cell_position);
- }
- }
- //分析结果
- List<List<string>> analysisContent = new List<List<string>>();
- List<string> contentHead = new List<string>();
- contentHead.Add(PdnResources.GetString("Menu.picture.Text"));
- contentHead.Add(PdnResources.GetString("Menu.Ellipsearea.text")+"(μm)");
- contentHead.Add(PdnResources.GetString("Menu.Actualarea.text")+"(μm)");
- contentHead.Add(PdnResources.GetString("Menu.ALAgrainlevel.text"));
- analysisContent.Add(contentHead);
- foreach (DataGridViewRow item in this.dataGridView2.Rows)
- {
- List<string> content = new List<string>();
- content.Add(item.Cells[0].Value.ToString());
- content.Add(item.Cells[1].Value.ToString());
- content.Add(item.Cells[2].Value.ToString());
- content.Add(item.Cells[3].Value.ToString());
- analysisContent.Add(content);
- }
- //图片
- bitList = new List<Bitmap>();
- if (this.showAll)
- {
- foreach (KeyValuePair<string, List<Bitmap>> kv in this.bitDic)
- {
- bitList.Add(kv.Value[0]);
- bitList.Add(kv.Value[1]);
- }
- }
- else
- {
- if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0)
- {
- foreach (ListViewItem item in this.listView2.SelectedItems)
- {
- if (bitDic.ContainsKey(item.Name))
- {
- bitList.Add(bitDic[item.Name][0]);
- bitList.Add(bitDic[item.Name][1]);
- }
- }
- }
- }
- //中间数据
- if (!this.showAll)
- {
- if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0)
- {
- List<ExportProjectModel> exportModel = new List<ExportProjectModel>();
- foreach (ListViewItem rowItem in this.listView2.SelectedItems)
- {
- foreach (ExportProjectModel model in this.tempDataModel)
- {
- if (model.tagName.Equals(rowItem.Name))
- {
- ExportProjectModel tempModel = new ExportProjectModel();
- tempModel.tagName = model.tagName;
- tempModel.picName = model.picName;
- tempModel.dataList = model.dataList;
- exportModel.Add(tempModel);
- break;
- }
- }
- }
- this.appWorkspace.CreateAnalysisReport(this.analyzeSettingModel, analysisContent, exportModel, bitList, tagInfos, nodeItem.path, nodeItem.code);
- }
- }
- else
- this.appWorkspace.CreateAnalysisReport(this.analyzeSettingModel, analysisContent, tempDataModel, bitList, tagInfos, nodeItem.path, nodeItem.code);
- //保存项目信息到数据库
- this.appWorkspace.InsertIntoDB(this.analyzeSettingModel, nodeItem);
- }
- else
- MessageBox.Show(PdnResources.GetString("Menu.Pleasesettheanalysisreportfirst.text")+"!");
- }
- //二值化集成3
- #region 二值化相关方法
- private void GrainSizeDialog_FormClosing(object sender, FormClosingEventArgs e)
- {
- if (getCurrentWorkTag() == null)
- {
- return;
- }
- #region [开启脚本录制]
- if (appWorkspace.startScriptRecording)
- {
- getScriptRecording();
- }
- #endregion
- binaryClass.saveParams();
- this.saveDialogParamValues(getCurrentWorkTag());
- GrainSizeAnalysisModel analysisModel = this.analysisDict[getCurrentWorkTag()];
- //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 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)
- {
- GrainSizeAnalysisModel newMod = analysisItem.cloneModel();
- newMod.value = null;//避免value为集合导致保存出错
- analysisModelXml.ListParam.Add(newMod);
- }
- //analysisModelXml.ListParam.Add(analysisItem.cloneModel());
- }
- //按路径和名称保存xml文件
- string userInfoXml = XmlSerializeHelper.XmlSerialize<GrainSizeAnalysisModel>(analysisModelXml);
- //保存xml
- FileOperationHelper.WriteStringToFile(userInfoXml, filePath, System.IO.FileMode.Create);
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 读取保存的参数给窗口显示
- /// </summary>
- private void showSaveParamToControl()
- {
- //读取上次关闭窗口时保存的参数
- if (this.analysisDict.Count == 0)
- {
- string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GrainSizeAnalyze\\GrainSizeAnalysisModel.xml";
- GrainSizeAnalysisModel analysisModelXml = XmlSerializeHelper.DESerializer<GrainSizeAnalysisModel>(FileOperationHelper.ReadStringFromFile(filePath, System.IO.FileMode.Open));
- GrainSizeAnalysisModel grainSizeAnalysisModel = analysisModelXml.cloneListParamModel(this.menuId);
- foreach (var item in grainSizeAnalysisModel.ListParam)
- item.setValue();
- this.analysisDict.Add(getCurrentWorkTag(), grainSizeAnalysisModel);
- }
- GrainSizeAnalysisModel analysisModel = this.analysisDict[getCurrentWorkTag()];
- object ShowGrainBoundry;
- if (analysisModel.GetParamValue1(ParamKey_CalculatorDecimalDigits, out ShowGrainBoundry, this.menuId))//小数点位数
- this.numericUpDown1.Value = (int)ShowGrainBoundry;
- if (analysisModel.GetParamValue1(ParamKey_OpenWhileExportReport, out ShowGrainBoundry, this.menuId))//生成报告时打开设置
- this.checkBox1.Checked = (bool)ShowGrainBoundry;
- if (analysisModel.GetParamValue1(ParamKey_lineWidth, out ShowGrainBoundry, this.menuId))//线宽
- this.numericUpDown2.Value = (int)ShowGrainBoundry;
- if (analysisModel.GetParamValue1(ParamKey_lineColor, out ShowGrainBoundry, this.menuId))//颜色
- this.panel1.BackColor = Color.FromArgb((int)ShowGrainBoundry);
- if (analysisModel.GetParamValue1(ParamKey_maxDiameter, out ShowGrainBoundry, this.menuId))//最大卡尺直径
- this.numericUpDown3.Value = decimal.Parse(ShowGrainBoundry.ToString());
- if (analysisModel.GetParamValue1(ParamKey_minDiameter, out ShowGrainBoundry, this.menuId))//最小卡尺直径
- this.numericUpDown4.Value = decimal.Parse(ShowGrainBoundry.ToString());
- }
- /// <summary>
- /// 保存界面中的参数到model
- /// </summary>
- private void saveDialogParamValues(string imageKey)
- {
- GrainSizeAnalysisModel analysisModel = this.analysisDict[imageKey];
- analysisModel.saveParamValue(ParamKey_lineWidth, Convert.ToInt32(this.numericUpDown2.Value).ToString(), (int)Base.Dtryt.Interger, this.menuId);//线宽
- analysisModel.saveParamValue(ParamKey_lineColor, this.panel1.BackColor.ToArgb().ToString(), (int)Base.Dtryt.Interger, this.menuId);//颜色
- analysisModel.saveParamValue(ParamKey_maxDiameter, numericUpDown3.Value.ToString(), (int)Base.Dtryt.ItemString, this.menuId);//最大卡尺直径
- analysisModel.saveParamValue(ParamKey_minDiameter, numericUpDown4.Value.ToString(), (int)Base.Dtryt.ItemString, this.menuId);//最小卡尺直径
- analysisModel.saveParamValue(ParamKey_CalculatorDecimalDigits, Convert.ToInt32(this.numericUpDown1.Value).ToString(), (int)Base.Dtryt.Interger, this.menuId);
- analysisModel.saveParamValue(ParamKey_OpenWhileExportReport, this.checkBox1.Checked ? "0" : "1", (int)Base.Dtryt.Boolean, this.menuId);//生成报告时打开设置
- }
- /// <summary>
- /// 添加参数改变的监听
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void GrainSizeDialog_Load(object sender, EventArgs e)
- {
- this.binaryClass.loadParams();
- }
- private bool bcBinaryChecked()
- {
- return bc != null && bc.BinaryChecked;
- }
- private bool bcOriginChecked()
- {
- return bc != null && bc.OriginChecked;
- }
- /// <summary>
- /// 参数改变时,重新处理图像
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void bClassBinaryImplFinishAction(object sender, EventArgs e)
- {
- this.documentWorkspace.Refresh();
- }
- ///// <summary>
- ///// 参数改变时,重新处理图像
- ///// </summary>
- ///// <param name="sender"></param>
- ///// <param name="e"></param>
- //private void applyButtonImpl(object sender, EventArgs e)
- //{
- // if (!this.needChange)
- // {
- // this.needChange = true;
- // return;
- // }
- // long start = Cv2.GetTickCount();
- // if (this.listView1.FocusedItem != null && checkBox10.Checked)
- // {
- // //判断是否存在视场,如果存在视场,则把视场提取出来,进行处理
- // if (this.documentWorkspace.GraphicsList.IsExsitView())
- // {
- // this.documentWorkspace.PhaseModels[0].mat = action.PerformProcess(
- // PaintDotNet.Camera.Tools.ToMat(this.documentWorkspace.GetFullSizeWithRegion()),
- // PaintDotNet.Camera.Tools.ToMat(this.bitmap));
- // this.documentWorkspace.PhaseModels[0].color = this.panel2.BackColor.ToArgb();
- // this.documentWorkspace.Refresh();
- // }
- // else
- // {
- // this.documentWorkspace.PhaseModels[0].mat = action.PerformProcess(PaintDotNet.Camera.Tools.ToMat(this.bitmap));
- // this.documentWorkspace.PhaseModels[0].color = this.panel2.BackColor.ToArgb();
- // this.documentWorkspace.Refresh();
- // }
- // }
- // double time = (Cv2.GetTickCount() - start) / Cv2.GetTickFrequency();
- // System.Console.WriteLine("执行时间:" + time);
- //}
- /// <summary>
- /// 显示原图/原图+二值图
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void bcOriginCheckedChanged(object sender, EventArgs e)
- {
- if (!bcOriginChecked())
- {
- if (bcBinaryChecked())
- this.documentWorkspace.PhaseModels[0].choise = true;
- }
- else
- {
- this.documentWorkspace.PhaseModels[0].choise = false;
- this.documentWorkspace.PhaseModels[1].choise = false;
- }
- this.documentWorkspace.Refresh();
- }
- ///// <summary>
- ///// 显示原图/原图+二值图
- ///// </summary>
- ///// <param name="sender"></param>
- ///// <param name="e"></param>
- //private void ShowOrHideOriginPic(object sender, EventArgs e)
- //{
- // if (!checkBox5.Checked)
- // {
- // if (checkBox10.Checked)
- // this.documentWorkspace.PhaseModels[0].choise = true;
- // }
- // else
- // {
- // this.documentWorkspace.PhaseModels[0].choise = false;
- // this.documentWorkspace.PhaseModels[1].choise = false;
- // }
- // this.documentWorkspace.Refresh();
- //}
- #endregion
- private void button_ApplyToAll_Click(object sender, EventArgs e)
- {
- if (this.selectPicture < 0)
- return;
- this.saveDialogParamValues(this.imageList1.Images.Keys[this.selectPicture].ToString());
- binaryClass.saveParams();
- binaryClass.applyToAll(this.imageList1.Images.Keys, this.imageList1.Images.Keys[this.listView1.FocusedItem.Index]);
- //var firstIndex = this.listView1.FocusedItem.Index;
- for (int i = 0; i < listView1.Items.Count; i++)
- {
- if (!this.analysisDict.ContainsKey(this.imageList1.Images.Keys[i]))
- this.analysisDict.Add(this.imageList1.Images.Keys[i], this.analysisDict[getCurrentWorkTag()].cloneListParamModel(this.menuId));
- else
- this.analysisDict[this.imageList1.Images.Keys[i]] = this.analysisDict[getCurrentWorkTag()].cloneListParamModel(this.menuId);
- this.listView1.EnsureVisible(i);
- this.listView1.Items[i].Focused = true;
- this.listView1.Items[i].Selected = true;
- //if (i != firstIndex)
- //{
- // //更新二值图片
- // binaryClass.updateAnalysisData(this.imageList1.Images.Keys[i], i);
- // //...
- // this.startStatistics();
- //}
- }
- }
- #region [脚本录制]
- private 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 "lineWidth":
- value = this.numericUpDown2.Value;
- break;
- case "lineColor":
- value = this.panel1.BackColor.ToArgb();
- break;
- case "maxDiameter":
- value = this.numericUpDown3.Value;
- break;
- case "minDiameter":
- value = this.numericUpDown4.Value;
- break;
- case "CalculatorDecimalDigits":
- value = this.numericUpDown1.Value;
- break;
- case "OpenWhileExportReport":
- value = this.checkBox1.Checked;
- break;
- case "ExportResults":
- value = false;
- break;
- case "ExportReports":
- value = false;
- break;
- case "ExportProjects":
- value = false;
- break;
- }
- return value;
- }
- #endregion
- }
- }
|