|
@@ -236,7 +236,8 @@ namespace PaintDotNet.DedicatedAnalysis.Battery
|
|
|
numericMax.Value = binaryClass.border;
|
|
|
numericHW.Value = Convert.ToDecimal(binaryClass.HW);
|
|
|
numericArea.Value = Convert.ToDecimal(binaryClass.AreaRatio);
|
|
|
-
|
|
|
+ numericBottom.Value = binaryClass.borderBottom;
|
|
|
+ numericNum.Value = binaryClass.numDecimals;
|
|
|
string checkstate = binaryClass.CheckState.ToString();
|
|
|
if (checkstate.Length == 5)
|
|
|
{
|
|
@@ -245,6 +246,15 @@ namespace PaintDotNet.DedicatedAnalysis.Battery
|
|
|
ckHW.Checked = checkstate.Substring(3, 1) == "1" ? true : false;
|
|
|
ckArea.Checked = checkstate.Substring(4, 1) == "1" ? true : false;
|
|
|
}
|
|
|
+ else if (checkstate.Length == 7)
|
|
|
+ {
|
|
|
+ ckMin.Checked = checkstate.Substring(1, 1) == "1" ? true : false;
|
|
|
+ ckMax.Checked = checkstate.Substring(2, 1) == "1" ? true : false;
|
|
|
+ ckHW.Checked = checkstate.Substring(3, 1) == "1" ? true : false;
|
|
|
+ ckArea.Checked = checkstate.Substring(4, 1) == "1" ? true : false;
|
|
|
+ ckBottom.Checked = checkstate.Substring(5, 1) == "1" ? true : false;
|
|
|
+ ckNum.Checked = checkstate.Substring(6, 1) == "1" ? true : false;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
InitCommonButtonEvent();
|
|
@@ -281,7 +291,7 @@ namespace PaintDotNet.DedicatedAnalysis.Battery
|
|
|
|
|
|
private void InclusionsStandardDialog_FormClosing(object sender, FormClosingEventArgs e)
|
|
|
{
|
|
|
- int check = 10000;
|
|
|
+ int check = 1000000;
|
|
|
double minpoint = Convert.ToDouble(numericUpDown11.Value);
|
|
|
int minpointInt = ckMin.Checked ? 1 : 0;
|
|
|
|
|
@@ -294,13 +304,20 @@ namespace PaintDotNet.DedicatedAnalysis.Battery
|
|
|
double AreaRatio = Convert.ToDouble(numericArea.Value);
|
|
|
int AreaRatioInt = ckArea.Checked ? 1 : 0;
|
|
|
|
|
|
-
|
|
|
- check = check + minpointInt * 1000 + borderInt * 100 + HWInt * 10 + AreaRatioInt;
|
|
|
+ int bottom = Convert.ToInt32(numericBottom.Value);
|
|
|
+ int bottomInt = ckBottom.Checked ? 1 : 0;
|
|
|
+
|
|
|
+ int size = Convert.ToInt32(numericNum.Value);
|
|
|
+ int sizeInt = ckNum.Checked ? 1 : 0;
|
|
|
+
|
|
|
+ check = check + minpointInt * 100000 + borderInt * 10000 + HWInt * 1000 + AreaRatioInt * 100 + bottomInt * 10 + sizeInt;
|
|
|
List<int> paramsList = new List<int>() {
|
|
|
Convert.ToInt32(minpoint * 100)
|
|
|
, Convert.ToInt32(border * 100)
|
|
|
, Convert.ToInt32(HW * 100)
|
|
|
- , Convert.ToInt32(AreaRatio * 100),check};
|
|
|
+ , Convert.ToInt32(AreaRatio * 100)
|
|
|
+ , Convert.ToInt32(bottom * 100)
|
|
|
+ , Convert.ToInt32(size),check };
|
|
|
binaryClass.saveParams(paramsList);
|
|
|
}
|
|
|
|
|
@@ -600,7 +617,12 @@ namespace PaintDotNet.DedicatedAnalysis.Battery
|
|
|
if (!ckArea.Checked)
|
|
|
AreaRatio = 0.01;
|
|
|
binaryClass.AreaRatio = AreaRatio;
|
|
|
-
|
|
|
+
|
|
|
+ int bottom = Convert.ToInt32(numericBottom.Value);
|
|
|
+ if (!ckBottom.Checked)
|
|
|
+ bottom = 0;
|
|
|
+ binaryClass.borderBottom = bottom;
|
|
|
+
|
|
|
//二值化集成4
|
|
|
binaryClass.listView1_SelectedIndexChanged(this.bitmap);
|
|
|
// binaryClass.bcDefault();
|
|
@@ -855,6 +877,10 @@ namespace PaintDotNet.DedicatedAnalysis.Battery
|
|
|
List<double> diameterPI = new List<double>() { };
|
|
|
List<double> diameter = new List<double>(){ };
|
|
|
List<double> diameterMax = new List<double>() { };
|
|
|
+
|
|
|
+ //保留小数位数
|
|
|
+ int numDec =Convert.ToInt32( numericNum.Value);
|
|
|
+
|
|
|
for (int i = 0; i < dataList.Count; i++)
|
|
|
{
|
|
|
|
|
@@ -878,11 +904,11 @@ namespace PaintDotNet.DedicatedAnalysis.Battery
|
|
|
diameterMax.Add(maxD * unitLength);
|
|
|
|
|
|
double circle= Convert.ToDouble(dataList[i][8])*0.001;
|
|
|
- dataGridView1.Rows[newPo].Cells[2].Value= Math.Round(dd, 2).ToString();
|
|
|
+ dataGridView1.Rows[newPo].Cells[2].Value= Math.Round(dd, numDec).ToString();
|
|
|
dataGridView1.Rows[newPo].Cells[3].Value = dataList[i][5];
|
|
|
- dataGridView1.Rows[newPo].Cells[4].Value = Math.Round(maxD * unitLength, 2).ToString();
|
|
|
- dataGridView1.Rows[newPo].Cells[5].Value = Math.Round(minD * unitLength, 2).ToString();
|
|
|
- dataGridView1.Rows[newPo].Cells[6].Value = Math.Round(r, 2).ToString();
|
|
|
+ dataGridView1.Rows[newPo].Cells[4].Value = Math.Round(maxD * unitLength, numDec).ToString();
|
|
|
+ dataGridView1.Rows[newPo].Cells[5].Value = Math.Round(minD * unitLength, numDec).ToString();
|
|
|
+ dataGridView1.Rows[newPo].Cells[6].Value = Math.Round(r, numDec).ToString();
|
|
|
}
|
|
|
diameterMax.Sort();
|
|
|
|
|
@@ -911,7 +937,7 @@ namespace PaintDotNet.DedicatedAnalysis.Battery
|
|
|
int newRow = dataGridView2.Rows.Add();
|
|
|
dataGridView2.Rows[newRow].Cells[0].Value = (ind++).ToString();
|
|
|
dataGridView2.Rows[newRow].Cells[1].Value = "平均值";
|
|
|
- dataGridView2.Rows[newRow].Cells[2].Value = Math.Round(total, 2).ToString();
|
|
|
+ dataGridView2.Rows[newRow].Cells[2].Value = Math.Round(total, numDec).ToString();
|
|
|
|
|
|
//int newRow1 = dataGridView2.Rows.Add();
|
|
|
//dataGridView2.Rows[newRow1].Cells[0].Value = (ind++).ToString();
|
|
@@ -931,7 +957,7 @@ namespace PaintDotNet.DedicatedAnalysis.Battery
|
|
|
int newRow7 = dataGridView2.Rows.Add();
|
|
|
dataGridView2.Rows[newRow7].Cells[0].Value = (ind++).ToString();
|
|
|
dataGridView2.Rows[newRow7].Cells[1].Value = "拟圆直径";
|
|
|
- dataGridView2.Rows[newRow7].Cells[2].Value = Math.Round(advR, 2).ToString();
|
|
|
+ dataGridView2.Rows[newRow7].Cells[2].Value = Math.Round(advR, numDec).ToString();
|
|
|
|
|
|
int count = diameter.Count;
|
|
|
int d1= Convert.ToInt32(count * 0.01);
|
|
@@ -952,42 +978,42 @@ namespace PaintDotNet.DedicatedAnalysis.Battery
|
|
|
int newRowMin = dataGridView2.Rows.Add();
|
|
|
dataGridView2.Rows[newRowMin].Cells[0].Value = (ind++).ToString();
|
|
|
dataGridView2.Rows[newRowMin].Cells[1].Value = "Dmin";
|
|
|
- dataGridView2.Rows[newRowMin].Cells[2].Value = Math.Round(diameter[0], 2).ToString();
|
|
|
+ dataGridView2.Rows[newRowMin].Cells[2].Value = Math.Round(diameter[0], numDec).ToString();
|
|
|
|
|
|
|
|
|
int newRowd1 = dataGridView2.Rows.Add();
|
|
|
dataGridView2.Rows[newRowd1].Cells[0].Value = (ind++).ToString();
|
|
|
dataGridView2.Rows[newRowd1].Cells[1].Value = "D1";
|
|
|
- dataGridView2.Rows[newRowd1].Cells[2].Value = Math.Round(diameter[d1], 2).ToString();
|
|
|
+ dataGridView2.Rows[newRowd1].Cells[2].Value = Math.Round(diameter[d1], numDec).ToString();
|
|
|
int newRow25 = dataGridView2.Rows.Add();
|
|
|
dataGridView2.Rows[newRow25].Cells[0].Value = (ind++).ToString();
|
|
|
dataGridView2.Rows[newRow25].Cells[1].Value = "D5";
|
|
|
- dataGridView2.Rows[newRow25].Cells[2].Value = Math.Round(diameter[d5], 2).ToString();
|
|
|
+ dataGridView2.Rows[newRow25].Cells[2].Value = Math.Round(diameter[d5], numDec).ToString();
|
|
|
int newRow3 = dataGridView2.Rows.Add();
|
|
|
dataGridView2.Rows[newRow3].Cells[0].Value = (ind++).ToString();
|
|
|
dataGridView2.Rows[newRow3].Cells[1].Value = "D10";
|
|
|
- dataGridView2.Rows[newRow3].Cells[2].Value = Math.Round(diameter[d10], 2).ToString();
|
|
|
+ dataGridView2.Rows[newRow3].Cells[2].Value = Math.Round(diameter[d10], numDec).ToString();
|
|
|
int newRow4 = dataGridView2.Rows.Add();
|
|
|
dataGridView2.Rows[newRow4].Cells[0].Value = (ind++).ToString();
|
|
|
dataGridView2.Rows[newRow4].Cells[1].Value = "D50";
|
|
|
- dataGridView2.Rows[newRow4].Cells[2].Value = Math.Round(diameter[d50], 2).ToString();
|
|
|
+ dataGridView2.Rows[newRow4].Cells[2].Value = Math.Round(diameter[d50], numDec).ToString();
|
|
|
int newRow5 = dataGridView2.Rows.Add();
|
|
|
dataGridView2.Rows[newRow5].Cells[0].Value = (ind++).ToString();
|
|
|
dataGridView2.Rows[newRow5].Cells[1].Value = "D90";
|
|
|
- dataGridView2.Rows[newRow5].Cells[2].Value = Math.Round(diameter[d90], 2).ToString();
|
|
|
+ dataGridView2.Rows[newRow5].Cells[2].Value = Math.Round(diameter[d90], numDec).ToString();
|
|
|
int newRow6 = dataGridView2.Rows.Add();
|
|
|
dataGridView2.Rows[newRow6].Cells[0].Value = (ind++).ToString();
|
|
|
dataGridView2.Rows[newRow6].Cells[1].Value = "D95";
|
|
|
- dataGridView2.Rows[newRow6].Cells[2].Value = Math.Round(diameter[d95], 2).ToString();
|
|
|
+ dataGridView2.Rows[newRow6].Cells[2].Value = Math.Round(diameter[d95], numDec).ToString();
|
|
|
int newRowd99 = dataGridView2.Rows.Add();
|
|
|
dataGridView2.Rows[newRowd99].Cells[0].Value = (ind++).ToString();
|
|
|
dataGridView2.Rows[newRowd99].Cells[1].Value = "D99";
|
|
|
- dataGridView2.Rows[newRowd99].Cells[2].Value = Math.Round(diameter[d99], 2).ToString();
|
|
|
+ dataGridView2.Rows[newRowd99].Cells[2].Value = Math.Round(diameter[d99], numDec).ToString();
|
|
|
|
|
|
int newRowMax = dataGridView2.Rows.Add();
|
|
|
dataGridView2.Rows[newRowMax].Cells[0].Value = (ind++).ToString();
|
|
|
dataGridView2.Rows[newRowMax].Cells[1].Value = "Dmax";
|
|
|
- dataGridView2.Rows[newRowMax].Cells[2].Value = Math.Round(diameter[diameter.Count - 1], 2).ToString();
|
|
|
+ dataGridView2.Rows[newRowMax].Cells[2].Value = Math.Round(diameter[diameter.Count - 1], numDec).ToString();
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 准备用来处理单个颗粒的选中事件
|
|
@@ -1215,6 +1241,10 @@ namespace PaintDotNet.DedicatedAnalysis.Battery
|
|
|
if (!ckArea.Checked)
|
|
|
AreaRatio = 0.01;
|
|
|
binaryClass.AreaRatio = AreaRatio;
|
|
|
+ int bottom = Convert.ToInt32(numericBottom.Value);
|
|
|
+ if (!ckBottom.Checked)
|
|
|
+ bottom = 0;
|
|
|
+ binaryClass.borderBottom = bottom;
|
|
|
List<List<int>> CircleDate = binaryClass.ForgetCrystal(minpoint);
|
|
|
|
|
|
bindGrid(CircleDate);
|
|
@@ -1660,6 +1690,8 @@ namespace PaintDotNet.DedicatedAnalysis.Battery
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
+ //保留小数位数
|
|
|
+ int numDec = Convert.ToInt32(numericNum.Value);
|
|
|
string name = this.listView1.FocusedItem.Name.Substring(0, this.listView1.FocusedItem.Name.LastIndexOf('.')) ;
|
|
|
SaveFileDialog exe = new SaveFileDialog();
|
|
|
exe.Filter = "Execl files (*.xlsx)|*.xlsx";
|
|
@@ -1803,7 +1835,7 @@ namespace PaintDotNet.DedicatedAnalysis.Battery
|
|
|
for (int r = 0; r < this.dataGridView2.Rows.Count; r++)
|
|
|
{
|
|
|
dataRowName[r + 1] = names[r];
|
|
|
- dataRowValue[r + 1] = Math.Round(values[r], 2).ToString();
|
|
|
+ dataRowValue[r + 1] = Math.Round(values[r], numDec).ToString();
|
|
|
dataRowNone[r + 1] = "";
|
|
|
}
|
|
|
dtb1.Rows.Add(dataRowName);
|