|
|
@@ -20,12 +20,12 @@ using System.Windows.Forms;
|
|
|
|
|
|
namespace OTSIncAReportGraph.Controls
|
|
|
{
|
|
|
- public enum ParticleClassifyType
|
|
|
- {
|
|
|
- MaterialType=0,
|
|
|
- SizeType=1
|
|
|
+ //public enum ParticleClassifyType
|
|
|
+ //{
|
|
|
+ //MaterialType=0,
|
|
|
+ //SizeType=1
|
|
|
|
|
|
- }
|
|
|
+ //}
|
|
|
public partial class Control_DrawDistrbutionSortImage : UserControl
|
|
|
{
|
|
|
|
|
|
@@ -1505,108 +1505,57 @@ namespace OTSIncAReportGraph.Controls
|
|
|
/// <summary>
|
|
|
/// 颗粒排序图中的颗粒,重新组织显示颗粒排序规则
|
|
|
/// </summary>
|
|
|
- public void GetDistrbutionSortimage_ByQuery(OTSIncAReportApp.OTSSampleReportInfo.ReportCondition sourceGridData)
|
|
|
+ public void GetDistrbutionSortimage_ByQuery(Dictionary<OTS_REPORT_PROP_GRID_ITEMS,ConditionItem> currentConditionValue)
|
|
|
{
|
|
|
- m_list_cgriddataclr = sourceGridData;
|
|
|
- List<string> FLNameList = new List<string>();
|
|
|
- //List<int> FLID = new List<int>() { -1,0, 1, 2, 4, 6, 7, 8, 9 };
|
|
|
- List<int> FLID = new List<int>() { 0, 1, 2, 4, 6, 9, 10 };
|
|
|
- List<string> NameList = new List<string>();
|
|
|
- ParticleClassifyType fltype = ParticleClassifyType.MaterialType;
|
|
|
- //先清除list
|
|
|
+
|
|
|
+ Dictionary<string, List<DisplayParticle>> FLNameList = new System.Collections.Generic.Dictionary<string, List<DisplayParticle>>();
|
|
|
+
|
|
|
m_list_sortparticledistribution.Clear();
|
|
|
- m_old_list_sortparticledistribution.Clear();
|
|
|
+ List<string> NameList = new List<string>();
|
|
|
+
|
|
|
m_f_zoom_record = 1;
|
|
|
|
|
|
|
|
|
//------------------------------------分解结果内容部份------------------------------------
|
|
|
- string display_type = "";
|
|
|
- string con = "";
|
|
|
- var list = sourceGridData.ConditionItemList.Find(s => Convert.ToInt32(s.iItemId) == 4);
|
|
|
- string sort_type = list.itemVal.ToString();
|
|
|
- int _type = list.comboDownList.IndexOf(sort_type);
|
|
|
- switch (_type)
|
|
|
+ //SIZECALMETHOM sizeCalculate_type;
|
|
|
+ //string con = "";
|
|
|
+ var conItem = currentConditionValue[OTS_REPORT_PROP_GRID_ITEMS.IMAGEGRID_DIS_TYPE];
|
|
|
+ if (conItem == null)
|
|
|
{
|
|
|
- case 0:
|
|
|
- fltype = ParticleClassifyType.MaterialType;
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- fltype = ParticleClassifyType.MaterialType; ;
|
|
|
- // break;
|
|
|
- //case 2:
|
|
|
- // fltype = 2;
|
|
|
- display_type = sourceGridData.ConditionItemList.Find(s => Convert.ToInt32(s.iItemId) == 13).itemVal.ToString();
|
|
|
- switch (display_type)
|
|
|
- {
|
|
|
- case "DMAX":
|
|
|
- con = "DMAX";
|
|
|
- break;
|
|
|
- case "DMIN":
|
|
|
- con = "DMIN";
|
|
|
- break;
|
|
|
- case "Area":
|
|
|
- con = "Area";
|
|
|
- break;
|
|
|
- case "FERET":
|
|
|
- con = "DFERET";
|
|
|
- break;
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
+ return;
|
|
|
}
|
|
|
- string path = resultFile.FilePath;
|
|
|
- ParticleData particleData = new ParticleData(path);
|
|
|
- List<Particle> particles = particleData.GetParticleListByCon("", "", "", 0);
|
|
|
+
|
|
|
+ var _type = (IMAGEGRID_DIS_TYPE)conItem.itemVal;
|
|
|
|
|
|
- foreach (DisplayParticle ls_dp in m_list_baseobject)
|
|
|
+ if (_type == IMAGEGRID_DIS_TYPE.CLASSIFY_TYPE)
|
|
|
{
|
|
|
- int dis = 0;
|
|
|
- foreach (Particle particle in particles)
|
|
|
+ foreach (DisplayParticle ls_dp in m_list_baseobject)
|
|
|
{
|
|
|
- //找到对应的颗粒,将分类设置进去
|
|
|
- if (ls_dp.ParticleId == particle.ParticleId && ls_dp.FieldId == particle.FieldId)
|
|
|
+ if (!FLNameList.ContainsKey(ls_dp.TypeName))
|
|
|
{
|
|
|
- if (!FLNameList.Contains(particle.TypeName) && particle.TypeName != "")
|
|
|
- {
|
|
|
- FLNameList.Add(particle.TypeName);
|
|
|
- }
|
|
|
-
|
|
|
- if (fltype == ParticleClassifyType.MaterialType)
|
|
|
- {
|
|
|
- ls_dp.ParticleFL = particle.TypeName.ToString();
|
|
|
- }
|
|
|
- if (fltype == ParticleClassifyType.SizeType)
|
|
|
- {
|
|
|
- if (con == "DMAX")
|
|
|
- ls_dp.ParticleFL = particle.DMAX.ToString();
|
|
|
- if (con == "DMIN")
|
|
|
- ls_dp.ParticleFL = particle.DMIN.ToString();
|
|
|
- if (con == "Area")
|
|
|
- ls_dp.ParticleFL = particle.Area.ToString();
|
|
|
- if (con == "DFERET")
|
|
|
- ls_dp.ParticleFL = particle.FERET.ToString();
|
|
|
- }
|
|
|
- ls_dp.displayState = DisplayState.NORMALDISPLAY;
|
|
|
- dis = 1;
|
|
|
- break;
|
|
|
+ List<DisplayParticle> newParts = new List<DisplayParticle>();
|
|
|
+ newParts.Add(ls_dp);
|
|
|
+ FLNameList.Add(ls_dp.TypeName, newParts);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ FLNameList[ls_dp.TypeName].Add(ls_dp);
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
- if (dis == 0)
|
|
|
+ foreach (var keyvaluePair in FLNameList)
|
|
|
{
|
|
|
- ls_dp.displayState = DisplayState.NODISPLAY;
|
|
|
+ SortParticleDistribution sortparticledistribution = new SortParticleDistribution();
|
|
|
+ sortparticledistribution.RectF = new RectangleF(ClientRectangle.X, ClientRectangle.Y,
|
|
|
+ 800, ClientRectangle.Height);
|
|
|
+ sortparticledistribution.ShowStr = keyvaluePair.Key;//设置分类grid
|
|
|
+ sortparticledistribution.List_DParticle = keyvaluePair.Value;
|
|
|
+ m_list_sortparticledistribution.Add(sortparticledistribution);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
- //if (fltype == 0)
|
|
|
- //{
|
|
|
- // //NameList = new List<string>() { table["partcletype0"].ToString(), table["partcletype1"].ToString(), table["partcletype2"].ToString(), table["partcletype4"].ToString(), table["partcletype6"].ToString(), table["partcletype7"].ToString(), table["partcletype8"].ToString(), table["partcletype9"].ToString(), table["partcletype10"].ToString() };
|
|
|
- // NameList = new List<string>() { resourceTable["partcletype9"].ToString(), resourceTable["partcletype10"].ToString() };
|
|
|
- //}
|
|
|
- if (fltype == ParticleClassifyType.MaterialType)
|
|
|
- {
|
|
|
- NameList = FLNameList;
|
|
|
- }
|
|
|
- if (fltype == ParticleClassifyType.SizeType)
|
|
|
+ else
|
|
|
{
|
|
|
//获取粒级表
|
|
|
string flpath = m_ReportApp.m_DataMgrFun.m_RptConfigFile.FileFolderSize + m_ReportApp.m_DataMgrFun.m_RptConfigFile.PartSizeFile;
|
|
|
@@ -1626,57 +1575,40 @@ namespace OTSIncAReportGraph.Controls
|
|
|
double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
|
|
|
sizeList.Add(d.ToString() + "~MAX");
|
|
|
NameList = sizeList;
|
|
|
- }
|
|
|
- //为颗粒排序图,创建分栏grid
|
|
|
- foreach (string name in NameList)
|
|
|
- {
|
|
|
- SortParticleDistribution sortparticledistribution = new SortParticleDistribution();
|
|
|
- sortparticledistribution.RectF = new RectangleF(ClientRectangle.X, ClientRectangle.Y,
|
|
|
- 800, ClientRectangle.Height);
|
|
|
- sortparticledistribution.ShowStr = name;//设置分类grid
|
|
|
- m_list_sortparticledistribution.Add(sortparticledistribution);
|
|
|
- }
|
|
|
-
|
|
|
- //然后再重新将list_baseobject中的颗粒,分别添加到对应的sortgrid中
|
|
|
- foreach (DisplayParticle ls_dp in m_list_baseobject)
|
|
|
- {
|
|
|
|
|
|
- var sort = m_list_sortparticledistribution;
|
|
|
- for (int i = 0; i < sort.Count; i++)
|
|
|
+ foreach (string name in NameList)
|
|
|
{
|
|
|
- //if (fltype == 0)
|
|
|
- //{
|
|
|
+ SortParticleDistribution sortparticledistribution = new SortParticleDistribution();
|
|
|
+ sortparticledistribution.RectF = new RectangleF(ClientRectangle.X, ClientRectangle.Y,
|
|
|
+ 800, ClientRectangle.Height);
|
|
|
+ sortparticledistribution.ShowStr = name;//设置分类grid
|
|
|
|
|
|
- // if (ls_dp.TypeId == FLID[i])
|
|
|
- // {
|
|
|
- // //将对应的颗粒添加到分栏grid中
|
|
|
- // DisplayParticle sort_dp = ls_dp.Clone() as DisplayParticle;
|
|
|
- // sort_dp.Rect = sort_dp.GetRectFromDSegment();
|
|
|
- // sort[i].List_DParticle.Add(sort_dp);
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // else if (ls_dp.TypeId > 10000)
|
|
|
- // {
|
|
|
- // //将对应的颗粒添加到分栏grid中
|
|
|
- // DisplayParticle sort_dp = ls_dp.Clone() as DisplayParticle;
|
|
|
- // sort_dp.Rect = sort_dp.GetRectFromDSegment();
|
|
|
- // sort[sort.Count - 1].List_DParticle.Add(sort_dp);
|
|
|
- // break;
|
|
|
- // }
|
|
|
- //}
|
|
|
- if (fltype == ParticleClassifyType.MaterialType)
|
|
|
+ m_list_sortparticledistribution.Add(sortparticledistribution);
|
|
|
+ }
|
|
|
+ foreach (DisplayParticle ls_dp in m_list_baseobject)
|
|
|
+ {
|
|
|
+ var sizeCalItem = currentConditionValue[OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE];
|
|
|
+ switch ((SIZECALMETHOM)sizeCalItem.itemVal)
|
|
|
{
|
|
|
- if (ls_dp.TypeName == NameList[i])
|
|
|
- {
|
|
|
- //将对应的颗粒添加到分栏grid中
|
|
|
- DisplayParticle sort_dp = ls_dp.Clone() as DisplayParticle;
|
|
|
- sort_dp.Rect = sort_dp.GetRectFromDSegment();
|
|
|
- sort[i].List_DParticle.Add(sort_dp);
|
|
|
+ case SIZECALMETHOM.DMAX:
|
|
|
+ ls_dp.ParticleFL = ls_dp.objParticleData.DMAX.ToString();
|
|
|
+ break;
|
|
|
+ case SIZECALMETHOM.DMIN:
|
|
|
+ ls_dp.ParticleFL = ls_dp.objParticleData.DMIN.ToString();
|
|
|
+ break;
|
|
|
+ case SIZECALMETHOM.CIRCLE:
|
|
|
+ ls_dp.ParticleFL = Convert.ToString(Math.Sqrt(ls_dp.objParticleData.Area / 3.14159) * 2);
|
|
|
+ break;
|
|
|
+ case SIZECALMETHOM.FERET:
|
|
|
+ ls_dp.ParticleFL = ls_dp.objParticleData.FERET.ToString();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
break;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
- else if (fltype == ParticleClassifyType.SizeType)
|
|
|
+ var sort = m_list_sortparticledistribution;
|
|
|
+ for (int i = 0; i < sort.Count; i++)
|
|
|
{
|
|
|
double min = Convert.ToDouble(NameList[i].Split('~')[0]);
|
|
|
double max = 0;
|
|
|
@@ -1697,9 +1629,78 @@ namespace OTSIncAReportGraph.Controls
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //然后再重新将list_baseobject中的颗粒,分别添加到对应的sortgrid中
|
|
|
+ //foreach (DisplayParticle ls_dp in m_list_baseobject)
|
|
|
+ //{
|
|
|
+
|
|
|
+ // var sort = m_list_sortparticledistribution;
|
|
|
+ // for (int i = 0; i < sort.Count; i++)
|
|
|
+ // {
|
|
|
+ // //if (fltype == 0)
|
|
|
+ // //{
|
|
|
+
|
|
|
+ // // if (ls_dp.TypeId == FLID[i])
|
|
|
+ // // {
|
|
|
+ // // //将对应的颗粒添加到分栏grid中
|
|
|
+ // // DisplayParticle sort_dp = ls_dp.Clone() as DisplayParticle;
|
|
|
+ // // sort_dp.Rect = sort_dp.GetRectFromDSegment();
|
|
|
+ // // sort[i].List_DParticle.Add(sort_dp);
|
|
|
+ // // break;
|
|
|
+ // // }
|
|
|
+ // // else if (ls_dp.TypeId > 10000)
|
|
|
+ // // {
|
|
|
+ // // //将对应的颗粒添加到分栏grid中
|
|
|
+ // // DisplayParticle sort_dp = ls_dp.Clone() as DisplayParticle;
|
|
|
+ // // sort_dp.Rect = sort_dp.GetRectFromDSegment();
|
|
|
+ // // sort[sort.Count - 1].List_DParticle.Add(sort_dp);
|
|
|
+ // // break;
|
|
|
+ // // }
|
|
|
+ // //}
|
|
|
+ // if (fltype == ParticleClassifyType.MaterialType)
|
|
|
+ // {
|
|
|
+ // if (ls_dp.TypeName == NameList[i])
|
|
|
+ // {
|
|
|
+ // //将对应的颗粒添加到分栏grid中
|
|
|
+ // DisplayParticle sort_dp = ls_dp.Clone() as DisplayParticle;
|
|
|
+ // sort_dp.Rect = sort_dp.GetRectFromDSegment();
|
|
|
+ // sort[i].List_DParticle.Add(sort_dp);
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // }
|
|
|
+ // else if (fltype == ParticleClassifyType.SizeType)
|
|
|
+ // {
|
|
|
+ // double min = Convert.ToDouble(NameList[i].Split('~')[0]);
|
|
|
+ // double max = 0;
|
|
|
+ // if (NameList[i].Split('~')[1].ToLower() != "max")
|
|
|
+ // { max = Convert.ToDouble(NameList[i].Split('~')[1]); }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // max = 999;
|
|
|
+ // }
|
|
|
+ // double size = Convert.ToDouble(ls_dp.ParticleFL);
|
|
|
+ // if (size <= max && size >= min)
|
|
|
+ // {
|
|
|
+ // //将对应的颗粒添加到分栏grid中
|
|
|
+ // DisplayParticle sort_dp = ls_dp.Clone() as DisplayParticle;
|
|
|
+ // sort_dp.Rect = sort_dp.GetRectFromDSegment();
|
|
|
+ // sort[i].List_DParticle.Add(sort_dp);
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ //}
|
|
|
|
|
|
//循环分栏grid,对各分栏grid进行摆放
|
|
|
for (int i = 0; i < m_list_sortparticledistribution.Count(); i++)
|
|
|
@@ -2096,7 +2097,7 @@ namespace OTSIncAReportGraph.Controls
|
|
|
|
|
|
Control_DrawDistrbutionSortImage_Load(null, null);
|
|
|
|
|
|
- GetDistrbutionSortimage_ByQuery(m_list_cgriddataclr);
|
|
|
+ GetDistrbutionSortimage_ByQuery(m_ReportApp.m_conditionChoose.m_CurrentConditions);
|
|
|
|
|
|
}
|
|
|
|