private string BuildAnalyseParamByCollect() { ucSingleDrawImageWnd c = DrawHandle as ucSingleDrawImageWnd; StringBuilder sb = new StringBuilder(); sb.AppendLine("<root>"); sb.AppendLine("<AlgorithmInitParam>"); sb.AppendLine("<AlgorithmType>CrowdAnalyse</AlgorithmType>"); if (c.AnalyseAreaExParam.Count > 0) { sb.AppendLine("<CheckRegion>"); sb.AppendLine("<PointNum>" + c.AnalyseAreaExParam.Count + "</PointNum>"); sb.AppendLine("<PointSet>"); foreach (var item in c.AnalyseAreaExParam) { sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.X + "</X>"); sb.AppendLine("<Y>" + item.Y + "</Y>"); sb.AppendLine("</Point>"); } sb.AppendLine("</PointSet>"); sb.AppendLine("<Area>" + CollectArea.ToString("0.##") + "</Area>"); sb.AppendLine("</CheckRegion>"); } sb.AppendLine("<TimelyReportTimeInterval>" + CollectTimeInterval + "</TimelyReportTimeInterval>"); sb.AppendLine("</AlgorithmInitParam>"); sb.AppendLine("</root>"); return(sb.ToString()); }
private string BuildAnalyseParamByPeopleCount() { ucSingleDrawImageWnd c = DrawHandle as ucSingleDrawImageWnd; StringBuilder sb = new StringBuilder(); sb.AppendLine("<root>"); sb.AppendLine("<AlgorithmInitParam>"); sb.AppendLine("<AlgorithmType>PeopleCount</AlgorithmType>"); if (c.AnalyseAreaExParam.Count > 0) { sb.AppendLine("<CheckRegion>"); sb.AppendLine("<PointNum>" + c.AnalyseAreaExParam.Count + "</PointNum>"); sb.AppendLine("<PointSet>"); foreach (var item in c.AnalyseAreaExParam) { sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.X + "</X>"); sb.AppendLine("<Y>" + item.Y + "</Y>"); sb.AppendLine("</Point>"); } sb.AppendLine("</PointSet>"); sb.AppendLine("</CheckRegion>"); } sb.AppendLine("</AlgorithmInitParam>"); sb.AppendLine("</root>"); return(sb.ToString()); }
private void checkBoxObjRect_CheckedChanged(object sender, EventArgs e) { if (checkBoxObjRect.Checked) { ucSingleDrawImageWnd c = ucSingleDrawImageWnd1; c.SetDrawType(DrawGraphType.GlobaRegion); } }
private void btnNear_Click(object sender, EventArgs e) { ucSingleDrawImageWnd c = DrawHandle as ucSingleDrawImageWnd; if (c == null || WorldSC == null) { return; } c.SetDrawType(DrawGraphType.NearArea); }
private void InOutSideBtn_Click(object sender, EventArgs e) { ucSingleDrawImageWnd c = DrawHandle as ucSingleDrawImageWnd; if (c == null || WorldSC == null) { return; } c.SetDrawType(DrawGraphType.PassRegion); }
private void btnAnalyseRegion_Click(object sender, EventArgs e) { ucSingleDrawImageWnd c = DrawHandle as ucSingleDrawImageWnd; if (c == null || WorldSC == null) { return; } c.SetDrawType(DrawGraphType.AnalyseAreaEx); }
private void checkButton2_Click(object sender, EventArgs e) { ucSingleDrawImageWnd c = DrawHandle as ucSingleDrawImageWnd; if (c == null) { return; } ButtonX barCheckItem = sender as ButtonX; c.SetDrawType((DrawGraphType)barCheckItem.Tag); }
private string BuildAnalyseParamByInOutSideRegion() { //报警和定时上报 是 不相干 ucSingleDrawImageWnd c = DrawHandle as ucSingleDrawImageWnd; if (!CheckInOutSide.Checked) { return(""); } StringBuilder sb = new StringBuilder(); // 闯入闯出 sb.AppendLine("<InOutSideRegion>"); foreach (var item in c.BreakAreaParam) { sb.AppendLine("<Region>"); sb.AppendLine("<ID>" + "0" + "</ID>"); sb.AppendLine("<OutputResult>" + TimeInOutSide.Checked.ToString().ToUpper() + "</OutputResult>"); sb.AppendLine("<TimelyReportTimeInterval>" + InOutSideInput.Text + "</TimelyReportTimeInterval>"); // 正向报警 和 反向报警 上限 sb.AppendLine("<HumanSuperscale>"); sb.AppendLine("<InSide>"); sb.AppendLine("<Enable>" + InSideCheck.Checked.ToString().ToUpper() + "</Enable>"); sb.AppendLine("<UpperLimit>" + InSideUpperLimit.Text + "</UpperLimit>"); sb.AppendLine("<UnitTime>" + InSideUnitTime.Text + "</UnitTime>"); sb.AppendLine("</InSide>"); sb.AppendLine("<OutSide>"); sb.AppendLine("<Enable>" + OutSideCheck.Checked.ToString().ToUpper() + "</Enable>"); sb.AppendLine("<UpperLimit>" + OutSideUpperLimit.Text + "</UpperLimit>"); sb.AppendLine("<UnitTime>" + OutSideUnitTime.Text + "</UnitTime>"); sb.AppendLine("</OutSide>"); sb.AppendLine("</HumanSuperscale>"); //是否判断正向 sb.AppendLine("<InSide>" + AllowInSide.Checked.ToString().ToUpper() + "</InSide>"); //是否判断反向 sb.AppendLine("<OutSide>" + AllowOutSide.Checked.ToString().ToUpper() + "</OutSide>"); sb.AppendLine("<PointNum>" + item.RegionPointList.Count + "</PointNum>"); sb.AppendLine("<PointSet>"); foreach (var pointItem in item.RegionPointList) { sb.AppendLine("<Point>"); sb.AppendLine("<X>" + pointItem.X + "</X>"); sb.AppendLine("<Y>" + pointItem.Y + "</Y>"); sb.AppendLine("</Point>"); } sb.AppendLine("</PointSet>"); sb.AppendLine("</Region>"); break; } sb.AppendLine("</InOutSideRegion>"); return(sb.ToString()); }
private string BuildAnalyseParamByFace() { ucSingleDrawImageWnd c = DrawHandle as ucSingleDrawImageWnd; StringBuilder sb = new StringBuilder(); sb.AppendLine("<root>"); sb.AppendLine("<AlgorithmInitParam>"); sb.AppendLine("<AlgorithmType>Face</AlgorithmType>"); sb.AppendLine("<bGetFeature>" + (GetFeature?1:0) + "</bGetFeature>"); sb.AppendLine("<bGetRace>" + (GetRace ? 1 : 0) + "</bGetRace>"); sb.AppendLine("</AlgorithmInitParam>"); sb.AppendLine("</root>"); return(sb.ToString()); }
private void buttonOK_Click(object sender, EventArgs e) { ucSingleDrawImageWnd c = ucSingleDrawImageWnd1; m_list = c.GlobaRegionParam; Point start0 = m_list[0]; Point start2 = m_list[2]; int width = start2.X - start0.X; int height = start2.Y - start0.Y; paraStr = m_list[0].X.ToString() + "," + m_list[0].Y.ToString() + "," + width.ToString() + "," + height.ToString(); DialogResult = System.Windows.Forms.DialogResult.OK; }
private string BuildAnalyseParamByNearRect() { ucSingleDrawImageWnd c = DrawHandle as ucSingleDrawImageWnd; StringBuilder sb = new StringBuilder(); sb.AppendLine("<NearRect>"); foreach (var item in c.NearAreaParam) { sb.AppendLine("<LTPoint>"); sb.AppendLine("<X>" + item.X + "</X>"); sb.AppendLine("<Y>" + item.Y + "</Y>"); sb.AppendLine("</LTPoint>"); sb.AppendLine("<Width>" + item.Width + "</Width>"); sb.AppendLine("<Height>" + item.Height + "</Height>"); } sb.AppendLine("</NearRect>"); return(sb.ToString()); }
private void spinEdit_WorldSC_EditValueChanged(object sender, EventArgs e) { ucSingleDrawImageWnd c = DrawHandle as ucSingleDrawImageWnd; if (c == null || m_worldSC == null) { return; } DoubleInput edit = sender as DoubleInput; switch (edit.Tag.ToString()) { case "1X": m_worldSC[0].X = Convert.ToInt32(edit.Value); break; case "1Y": m_worldSC[0].Y = Convert.ToInt32(edit.Value); break; case "2X": m_worldSC[1].X = Convert.ToInt32(edit.Value); break; case "2Y": m_worldSC[1].Y = Convert.ToInt32(edit.Value); break; case "3X": m_worldSC[2].X = Convert.ToInt32(edit.Value); break; case "3Y": m_worldSC[2].Y = Convert.ToInt32(edit.Value); break; case "4X": m_worldSC[3].X = Convert.ToInt32(edit.Value); break; case "4Y": m_worldSC[3].Y = Convert.ToInt32(edit.Value); break; case "5X": m_worldSC[4].X = Convert.ToInt32(edit.Value); break; case "5Y": m_worldSC[4].Y = Convert.ToInt32(edit.Value); break; case "6X": m_worldSC[5].X = Convert.ToInt32(edit.Value); break; case "6Y": m_worldSC[5].Y = Convert.ToInt32(edit.Value); break; default: break; } }
private void checkBoxX1_CheckedChanged(object sender, EventArgs e) { ucSingleDrawImageWnd c = DrawHandle as ucSingleDrawImageWnd; if (c == null) { return; } CheckBoxX barCheckItem = sender as CheckBoxX; if (!barCheckItem.Checked) { c.DriveWays[Convert.ToInt32(barCheckItem.Tag) - 11] = false; } else { c.SetDrawType((DrawGraphType)barCheckItem.Tag); c.DriveWays[Convert.ToInt32(barCheckItem.Tag) - 11] = true; } }
private void buttonReset_Click(object sender, EventArgs e) { ucSingleDrawImageWnd c = ucSingleDrawImageWnd1; c.ClearAllGraphs(); }
private string BuildAnalyseParamByBehaviour() { ucSingleDrawImageWnd c = DrawHandle as ucSingleDrawImageWnd; StringBuilder sb = new StringBuilder(); sb.AppendLine("<root>"); sb.AppendLine("<AlgorithmInitParam>"); sb.AppendLine("<AlgorithmType>Behaviour</AlgorithmType>"); // 绘制检测区域 if (c.AnalyseAreaExParam.Count > 0) { sb.AppendLine("<CheckRegion>"); sb.AppendLine("<PointNum>" + c.AnalyseAreaExParam.Count + "</PointNum>"); sb.AppendLine("<PointSet>"); foreach (var item in c.AnalyseAreaExParam) { sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.X + "</X>"); sb.AppendLine("<Y>" + item.Y + "</Y>"); sb.AppendLine("</Point>"); } sb.AppendLine("</PointSet>"); sb.AppendLine("</CheckRegion>"); } sb.AppendLine("<CheckTimeInterval>3</CheckTimeInterval>"); sb.AppendLine("<PasserbyRim>"); //远处行人框 sb.AppendLine(BuildAnalyseParamByFarRect()); // 近处行人框 sb.AppendLine(BuildAnalyseParamByNearRect()); sb.AppendLine("</PasserbyRim>"); // 标定 sb.AppendLine(BuildAnalyseParamBySceneMark()); //奔跑 sb.AppendLine("<Run>"); sb.AppendLine("<OutputResult>" + checkEditCheckRun.Checked.ToString().ToUpper() + "</OutputResult>"); sb.AppendLine("<SpeedLowerLimit>" + RunInput.Text + "</SpeedLowerLimit>"); sb.AppendLine("</Run>"); // 拉横幅 sb.AppendLine("<CarryBanner>"); sb.AppendLine("<OutputResult>" + checkEditCheckCarryBanner.Checked.ToString().ToUpper() + "</OutputResult>"); sb.AppendLine("</CarryBanner>"); // 撒传单 sb.AppendLine("<FlyLeaflet>"); sb.AppendLine("<OutputResult>" + checkEditCheckFlyLeaflet.Checked.ToString().ToUpper() + "</OutputResult>"); sb.AppendLine("</FlyLeaflet>"); // 聚集 sb.AppendLine("<Mass>"); sb.AppendLine("<OutputResult>" + checkEditCheckMass.Checked.ToString().ToUpper() + "</OutputResult>"); sb.AppendLine("<HumanLowerLimit>" + MassInput.Text + "</HumanLowerLimit>"); sb.AppendLine("</Mass>"); //闯入闯出 sb.AppendLine(BuildAnalyseParamByInOutSideRegion()); // 越界线 sb.AppendLine(BuildAnalyseParamByPassLine()); sb.AppendLine("</AlgorithmInitParam>"); sb.AppendLine("</root>"); return(sb.ToString()); }
private string BuildAnalyseParamByPassLine() { ucSingleDrawImageWnd c = DrawHandle as ucSingleDrawImageWnd; if (!checkEditPassLine.Checked) { return(""); } StringBuilder sb = new StringBuilder(); //越界 sb.AppendLine("<BeyondLine>"); foreach (var item in c.PassLineParam) { sb.AppendLine("<Line>"); sb.AppendLine("<ID>" + "0" + "</ID>"); sb.AppendLine("<OutputResult>" + TimePassline.Checked.ToString().ToUpper() + "</OutputResult>"); sb.AppendLine("<TimelyReportTimeInterval>" + InputPassLine.Text + "</TimelyReportTimeInterval>"); // 正向报警 和 反向报警 上限 sb.AppendLine("<HumanSuperscale>"); sb.AppendLine("<PosBeyond>"); sb.AppendLine("<Enable>" + btnCheckPosBeyond.Checked.ToString().ToUpper() + "</Enable>"); sb.AppendLine("<UpperLimit>" + PosBeyondUpperLimit.Text + "</UpperLimit>"); sb.AppendLine("<UnitTime>" + PosBeyondUnitTime.Text + "</UnitTime>"); sb.AppendLine("</PosBeyond>"); sb.AppendLine("<NegBeyond>"); sb.AppendLine("<Enable>" + btnCheckNegBeyond.Checked.ToString().ToUpper() + "</Enable>"); sb.AppendLine("<UpperLimit>" + NegBeyondUpperLimit.Text + "</UpperLimit>"); sb.AppendLine("<UnitTime>" + NegBeyondUnitTime.Text + "</UnitTime>"); sb.AppendLine("</NegBeyond>"); sb.AppendLine("</HumanSuperscale>"); //是否判断正向 sb.AppendLine("<PosBeyond>" + AllowPosBeyond.Checked.ToString().ToUpper() + "</PosBeyond>"); //是否判断反向 sb.AppendLine("<NegBeyond>" + AllowNegBeyond.Checked.ToString().ToUpper() + "</NegBeyond>"); // 越界线 集合 sb.AppendLine("<BeyondLinePointSet>"); sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.PassLineStart.X + "</X>"); sb.AppendLine("<Y>" + item.PassLineStart.Y + "</Y>"); sb.AppendLine("</Point>"); sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.PassLineEnd.X + "</X>"); sb.AppendLine("<Y>" + item.PassLineEnd.Y + "</Y>"); sb.AppendLine("</Point>"); sb.AppendLine("</BeyondLinePointSet>"); sb.AppendLine("<DirectLinePointSet>"); if (item.PassLineType == 0) { sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.DirectLineEnd.X + "</X>"); sb.AppendLine("<Y>" + item.DirectLineEnd.Y + "</Y>"); sb.AppendLine("</Point>"); sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.DirectLineStart.X + "</X>"); sb.AppendLine("<Y>" + item.DirectLineStart.Y + "</Y>"); sb.AppendLine("</Point>"); } else { sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.DirectLineStart.X + "</X>"); sb.AppendLine("<Y>" + item.DirectLineStart.Y + "</Y>"); sb.AppendLine("</Point>"); sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.DirectLineEnd.X + "</X>"); sb.AppendLine("<Y>" + item.DirectLineEnd.Y + "</Y>"); sb.AppendLine("</Point>"); } sb.AppendLine("</DirectLinePointSet>"); sb.AppendLine("</Line>"); break; } sb.AppendLine("</BeyondLine>"); return(sb.ToString()); }
private void buttonX1_Click(object sender, EventArgs e) { ucSingleDrawImageWnd c = DrawHandle as ucSingleDrawImageWnd; c.SetDrawType(DataModel.DrawGraphType.AnalyseAreaEx); }
private string BuildAnalyseParamBySceneMark() { ucSingleDrawImageWnd c = DrawHandle as ucSingleDrawImageWnd; StringBuilder sb = new StringBuilder(); sb.AppendLine("<SceneMark>"); sb.AppendLine("<ImageSC>"); sb.AppendLine("<PointNum>" + c.ImageSC.Count + "</PointNum>"); sb.AppendLine("<PointSet>"); System.Drawing.Point item = c.ImageSC[0]; sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.X + "</X>"); sb.AppendLine("<Y>" + item.Y + "</Y>"); sb.AppendLine("</Point>"); item = c.ImageSC[2]; sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.X + "</X>"); sb.AppendLine("<Y>" + item.Y + "</Y>"); sb.AppendLine("</Point>"); item = c.ImageSC[3]; sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.X + "</X>"); sb.AppendLine("<Y>" + item.Y + "</Y>"); sb.AppendLine("</Point>"); item = c.ImageSC[5]; sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.X + "</X>"); sb.AppendLine("<Y>" + item.Y + "</Y>"); sb.AppendLine("</Point>"); item = c.ImageSC[1]; sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.X + "</X>"); sb.AppendLine("<Y>" + item.Y + "</Y>"); sb.AppendLine("</Point>"); item = c.ImageSC[4]; sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.X + "</X>"); sb.AppendLine("<Y>" + item.Y + "</Y>"); sb.AppendLine("</Point>"); sb.AppendLine("</PointSet>"); sb.AppendLine("</ImageSC>"); sb.AppendLine("<WorldSC>"); sb.AppendLine("<PointNum>" + WorldSC.Length + "</PointNum>"); sb.AppendLine("<PointSet>"); item = WorldSC[0]; sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.X + "</X>"); sb.AppendLine("<Y>" + item.Y + "</Y>"); sb.AppendLine("</Point>"); item = WorldSC[2]; sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.X + "</X>"); sb.AppendLine("<Y>" + item.Y + "</Y>"); sb.AppendLine("</Point>"); item = WorldSC[3]; sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.X + "</X>"); sb.AppendLine("<Y>" + item.Y + "</Y>"); sb.AppendLine("</Point>"); item = WorldSC[5]; sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.X + "</X>"); sb.AppendLine("<Y>" + item.Y + "</Y>"); sb.AppendLine("</Point>"); item = WorldSC[1]; sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.X + "</X>"); sb.AppendLine("<Y>" + item.Y + "</Y>"); sb.AppendLine("</Point>"); item = WorldSC[4]; sb.AppendLine("<Point>"); sb.AppendLine("<X>" + item.X + "</X>"); sb.AppendLine("<Y>" + item.Y + "</Y>"); sb.AppendLine("</Point>"); sb.AppendLine("</PointSet>"); sb.AppendLine("</WorldSC>"); sb.AppendLine("</SceneMark>"); return(sb.ToString()); }