diff --git a/AIMS/OperationAanesthesia/DrawAnasReordBill.cs b/AIMS/OperationAanesthesia/DrawAnasReordBill.cs index 81ef6c9..de397c0 100644 --- a/AIMS/OperationAanesthesia/DrawAnasReordBill.cs +++ b/AIMS/OperationAanesthesia/DrawAnasReordBill.cs @@ -27,8 +27,8 @@ namespace AIMS.OperationAanesthesia if (reVal) { templateManage.DrawArea(); - DrawGraph.Util.DrawText(AIMSExtension.PublicMethod.GetHospitalName(), 0.385, 0.018, Zgc, DrawGraph.Util.Font16); - DrawGraph.Util.DrawText(" 麻醉记录单", 0.4, 0.04, Zgc, DrawGraph.Util.Font16); + DrawGraph.ZUtil.DrawText(AIMSExtension.PublicMethod.GetHospitalName(), 0.385, 0.018, Zgc, DrawGraph.ZUtil.Font16); + DrawGraph.ZUtil.DrawText(" 麻醉记录单", 0.4, 0.04, Zgc, DrawGraph.ZUtil.Font16); #region 设置界面自适应 //在此处可随时设置板子的属性 @@ -78,8 +78,8 @@ namespace AIMS.OperationAanesthesia if (reVal) { templateManage.DrawArea(); - DrawGraph.Util.DrawText(AIMSExtension.PublicMethod.GetHospitalName(), 0.385, 0.018, Zgc, DrawGraph.Util.Font16); - DrawGraph.Util.DrawText(" 恢复记录单", 0.4, 0.04, Zgc, DrawGraph.Util.Font16); + DrawGraph.ZUtil.DrawText(AIMSExtension.PublicMethod.GetHospitalName(), 0.385, 0.018, Zgc, DrawGraph.ZUtil.Font16); + DrawGraph.ZUtil.DrawText(" 恢复记录单", 0.4, 0.04, Zgc, DrawGraph.ZUtil.Font16); #region 设置界面自适应 //在此处可随时设置板子的属性 @@ -166,8 +166,8 @@ namespace AIMS.OperationAanesthesia if (reVal) { templateManage.DrawArea(); - DrawGraph.Util.DrawText(AIMSExtension.PublicMethod.GetHospitalName(), 0.385, 0.018, Zgc, DrawGraph.Util.Font16); - DrawGraph.Util.DrawText(" 器械清点单", 0.4, 0.04, Zgc, DrawGraph.Util.Font16); + DrawGraph.ZUtil.DrawText(AIMSExtension.PublicMethod.GetHospitalName(), 0.385, 0.018, Zgc, DrawGraph.ZUtil.Font16); + DrawGraph.ZUtil.DrawText(" 器械清点单", 0.4, 0.04, Zgc, DrawGraph.ZUtil.Font16); templateManage.ZedControl.Width = templateManage.ZedControl.Parent.Width - 54; templateManage.ZedControl.Height = (templateManage.ZedControl.Parent.Width - 54) / 8 * 11; @@ -235,8 +235,8 @@ namespace AIMS.OperationAanesthesia if (reVal) { templateManage.DrawArea(); - DrawGraph.Util.DrawText(AIMSExtension.PublicMethod.GetHospitalName(), 0.385, 0.018, Zgc, DrawGraph.Util.Font16); - DrawGraph.Util.DrawText(" 麻 醉 记 录", 0.42, 0.04, Zgc, DrawGraph.Util.Font14); + DrawGraph.ZUtil.DrawText(AIMSExtension.PublicMethod.GetHospitalName(), 0.385, 0.018, Zgc, DrawGraph.ZUtil.Font16); + DrawGraph.ZUtil.DrawText(" 麻 醉 记 录", 0.42, 0.04, Zgc, DrawGraph.ZUtil.Font14); #region 设置界面自适应 //在此处可随时设置板子的属性 @@ -282,8 +282,8 @@ namespace AIMS.OperationAanesthesia if (reVal) { templateManage2.DrawArea(); - DrawGraph.Util.DrawText(AIMSExtension.PublicMethod.GetHospitalName(), 0.385, 0.038, Zgc2, DrawGraph.Util.Font16); - DrawGraph.Util.DrawText(" 麻 醉 记 录", 0.42, 0.065, Zgc2, DrawGraph.Util.Font14); + DrawGraph.ZUtil.DrawText(AIMSExtension.PublicMethod.GetHospitalName(), 0.385, 0.038, Zgc2, DrawGraph.ZUtil.Font16); + DrawGraph.ZUtil.DrawText(" 麻 醉 记 录", 0.42, 0.065, Zgc2, DrawGraph.ZUtil.Font14); templateManage2.ZedControl.Width = templateManage.ZedControl.Width; templateManage2.ZedControl.Height = templateManage.ZedControl.Height; int LocationY = Convert.ToInt32(templateManage2.ZedControl.Height * 0.065); diff --git a/DrawGraph/AreaManage/DrugsManage.cs b/DrawGraph/AreaManage/DrugsManage.cs index 6641cfb..3c440d4 100644 --- a/DrawGraph/AreaManage/DrugsManage.cs +++ b/DrawGraph/AreaManage/DrugsManage.cs @@ -298,9 +298,9 @@ namespace DrawGraph { double height = getYPositionByListIndex(1, lines.RealY, lines.RealEndY, RowsCount) / 2; //double x = H3pack.RealX + 0.003f; - ZUtil.DrawLine(x, zhuy + height, x, y + height, ZedControl, "zhuyDrugs" + temp.Id, Color.Red); - ZUtil.DrawLine(x, zhuy + height, x + 0.0055f, zhuy + height, ZedControl, "zhuyDrugstop" + temp.Id, Color.Red); - ZUtil.DrawLine(x, y + height, x + 0.0055f, y + height, ZedControl, "zhuyDrugsend" + temp.Id, Color.Red); + ZUtil.DrawLine2(x, zhuy + height, x, y + height, ZedControl, "zhuyDrugs" + temp.Id, Color.Red); + ZUtil.DrawLine2(x, zhuy + height, x + 0.0055f, zhuy + height, ZedControl, "zhuyDrugstop" + temp.Id, Color.Red); + ZUtil.DrawLine2(x, y + height, x + 0.0055f, y + height, ZedControl, "zhuyDrugsend" + temp.Id, Color.Red); } private void SetDrug(FactDrug temp, DateTime curTimeTemp, double y) { diff --git a/DrawGraph/AreaManage/InstrumentDataManage.cs b/DrawGraph/AreaManage/InstrumentDataManage.cs index 5fc038d..5c26a66 100644 --- a/DrawGraph/AreaManage/InstrumentDataManage.cs +++ b/DrawGraph/AreaManage/InstrumentDataManage.cs @@ -85,30 +85,30 @@ namespace DrawGraph if (index < ApplianceRecordList.Count) ZUtil.DrawText(ApplianceRecordList[index].ApplianceName, tablePackObj.X + tablePackObj.RealX, y, ZedControl, "ApplianceRecordList" + index, Color.Black, fontsize, false); else - ZUtil.DrawLine1(tablePackObj.X + tablePackObj.RealX, y + chaY, (tablePackObj1.EndX - tablePackObj1.X) / Columns * 1 + tablePackObj1.X + span, y, ZedControl, "ApplianceRecordList" + index, Color.Black); + ZUtil.DrawLine(tablePackObj.X + tablePackObj.RealX, y + chaY, (tablePackObj1.EndX - tablePackObj1.X) / Columns * 1 + tablePackObj1.X + span, y, ZedControl, "ApplianceRecordList" + index, Color.Black); if (index < ApplianceRecordList.Count && ApplianceRecordList[index].OpeFront != null && ApplianceRecordList[index].OpeFront != "" && ApplianceRecordList[index].OpeFront != @"/") ZUtil.DrawText(ApplianceRecordList[index].OpeFront, tablePackObj1.X + tablePackObj.RealX, y, ZedControl, "ApplianceRecordListOpeFront" + index, Color.Black, fontsize, false); else - ZUtil.DrawLine1(tablePackObj1.X + span, y + chaY, (tablePackObj1.EndX - tablePackObj1.X) / Columns * 1 + tablePackObj1.X + span, y, ZedControl, "ApplianceRecordListOpeFront" + index, Color.Black); + ZUtil.DrawLine(tablePackObj1.X + span, y + chaY, (tablePackObj1.EndX - tablePackObj1.X) / Columns * 1 + tablePackObj1.X + span, y, ZedControl, "ApplianceRecordListOpeFront" + index, Color.Black); if (index < ApplianceRecordList.Count && ApplianceRecordList[index].OpeDoing != null && ApplianceRecordList[index].OpeDoing != "" && ApplianceRecordList[index].OpeDoing != @"/") ZUtil.DrawText(ApplianceRecordList[index].OpeDoing, (tablePackObj1.EndX - tablePackObj1.X) / Columns * 1 + tablePackObj1.X + tablePackObj.RealX, y, ZedControl, "ApplianceRecordListOpeDoing" + index, Color.Black, fontsize, false); else - ZUtil.DrawLine1((tablePackObj1.EndX - tablePackObj1.X) / Columns * 1 + tablePackObj1.X + span, y + chaY, (tablePackObj1.EndX - tablePackObj1.X) / Columns * 2 + tablePackObj1.X + span, y, ZedControl, "ApplianceRecordListOpeDoing" + index, Color.Black); + ZUtil.DrawLine((tablePackObj1.EndX - tablePackObj1.X) / Columns * 1 + tablePackObj1.X + span, y + chaY, (tablePackObj1.EndX - tablePackObj1.X) / Columns * 2 + tablePackObj1.X + span, y, ZedControl, "ApplianceRecordListOpeDoing" + index, Color.Black); if (index < ApplianceRecordList.Count && ApplianceRecordList[index].CloseFront != null && ApplianceRecordList[index].CloseFront != "" && ApplianceRecordList[index].CloseFront != @"/") ZUtil.DrawText(ApplianceRecordList[index].CloseFront, (tablePackObj1.EndX - tablePackObj1.X) / Columns * 2 + tablePackObj1.X + tablePackObj.RealX, y, ZedControl, "ApplianceRecordListCloseFront" + index, Color.Black, fontsize, false); else - ZUtil.DrawLine1((tablePackObj1.EndX - tablePackObj1.X) / Columns * 2 + tablePackObj1.X + span, y + chaY, (tablePackObj1.EndX - tablePackObj1.X) / Columns * 3 + tablePackObj1.X + span, y, ZedControl, "ApplianceRecordListCloseFront" + index, Color.Black); + ZUtil.DrawLine((tablePackObj1.EndX - tablePackObj1.X) / Columns * 2 + tablePackObj1.X + span, y + chaY, (tablePackObj1.EndX - tablePackObj1.X) / Columns * 3 + tablePackObj1.X + span, y, ZedControl, "ApplianceRecordListCloseFront" + index, Color.Black); if (index < ApplianceRecordList.Count && ApplianceRecordList[index].CloseLast != null && ApplianceRecordList[index].CloseLast != "" && ApplianceRecordList[index].CloseLast != @"/") ZUtil.DrawText(ApplianceRecordList[index].CloseLast, (tablePackObj1.EndX - tablePackObj1.X) / Columns * 3 + tablePackObj1.X + tablePackObj.RealX, y, ZedControl, "ApplianceRecordListCloseLast" + index, Color.Black, fontsize, false); else - ZUtil.DrawLine1((tablePackObj1.EndX - tablePackObj1.X) / Columns * 3 + tablePackObj1.X + span, y + chaY, (tablePackObj1.EndX - tablePackObj1.X) / Columns * 4 + tablePackObj1.X + span, y, ZedControl, "ApplianceRecordListCloseLast" + index, Color.Black); + ZUtil.DrawLine((tablePackObj1.EndX - tablePackObj1.X) / Columns * 3 + tablePackObj1.X + span, y + chaY, (tablePackObj1.EndX - tablePackObj1.X) / Columns * 4 + tablePackObj1.X + span, y, ZedControl, "ApplianceRecordListCloseLast" + index, Color.Black); if (Columns == 5) if (index < ApplianceRecordList.Count && ApplianceRecordList[index].SkinCloseLast != null && ApplianceRecordList[index].SkinCloseLast != "" && ApplianceRecordList[index].SkinCloseLast != @"/") ZUtil.DrawText(ApplianceRecordList[index].SkinCloseLast, (tablePackObj1.EndX - tablePackObj1.X) / Columns * 4 + tablePackObj1.X + tablePackObj.RealX, y, ZedControl, "ApplianceRecordListSkinCloseLast" + index, Color.Black, fontsize, false); else - ZUtil.DrawLine1((tablePackObj1.EndX - tablePackObj1.X) / Columns * 4 + tablePackObj1.X + span, y + chaY, (tablePackObj1.EndX - tablePackObj1.X) / Columns * 5 + tablePackObj1.X + span, y, ZedControl, "ApplianceRecordListSkinCloseLast" + index, Color.Black); + ZUtil.DrawLine((tablePackObj1.EndX - tablePackObj1.X) / Columns * 4 + tablePackObj1.X + span, y + chaY, (tablePackObj1.EndX - tablePackObj1.X) / Columns * 5 + tablePackObj1.X + span, y, ZedControl, "ApplianceRecordListSkinCloseLast" + index, Color.Black); continue; //} @@ -121,30 +121,30 @@ namespace DrawGraph if (index < ApplianceRecordList.Count) ZUtil.DrawText(ApplianceRecordList[index].ApplianceName, (tablePackObj.EndX - tablePackObj.X) / 2 + tablePackObj.X + tablePackObj.RealX, y, ZedControl, "ApplianceRecordList" + index, Color.Black, fontsize, false); else - ZUtil.DrawLine1((tablePackObj.EndX - tablePackObj.X) / 2 + tablePackObj.X + tablePackObj.RealX, y + chaY, tablePackObj2.X + span, y, ZedControl, "ApplianceRecordList" + index, Color.Black); + ZUtil.DrawLine((tablePackObj.EndX - tablePackObj.X) / 2 + tablePackObj.X + tablePackObj.RealX, y + chaY, tablePackObj2.X + span, y, ZedControl, "ApplianceRecordList" + index, Color.Black); if (index < ApplianceRecordList.Count && ApplianceRecordList[index].OpeFront != null && ApplianceRecordList[index].OpeFront != "" && ApplianceRecordList[index].OpeFront != @"/") ZUtil.DrawText(ApplianceRecordList[index].OpeFront, tablePackObj2.X + tablePackObj.RealX, y, ZedControl, "ApplianceRecordListOpeFront" + index, Color.Black, fontsize, false); else - ZUtil.DrawLine1(tablePackObj2.X + span, y + chaY, (tablePackObj2.EndX - tablePackObj2.X) / Columns * 1 + tablePackObj2.X + span, y, ZedControl, "ApplianceRecordListOpeFront" + index, Color.Black); + ZUtil.DrawLine(tablePackObj2.X + span, y + chaY, (tablePackObj2.EndX - tablePackObj2.X) / Columns * 1 + tablePackObj2.X + span, y, ZedControl, "ApplianceRecordListOpeFront" + index, Color.Black); if (index < ApplianceRecordList.Count && ApplianceRecordList[index].OpeDoing != null && ApplianceRecordList[index].OpeDoing != "" && ApplianceRecordList[index].OpeDoing != @"/") ZUtil.DrawText(ApplianceRecordList[index].OpeDoing, (tablePackObj2.EndX - tablePackObj2.X) / Columns * 1 + tablePackObj2.X + tablePackObj.RealX, y, ZedControl, "ApplianceRecordListOpeDoing" + index, Color.Black, fontsize, false); else - ZUtil.DrawLine1((tablePackObj2.EndX - tablePackObj2.X) / Columns * 1 + tablePackObj2.X + span, y + chaY, (tablePackObj2.EndX - tablePackObj2.X) / Columns * 2 + tablePackObj2.X + span, y, ZedControl, "ApplianceRecordListOpeDoing" + index, Color.Black); + ZUtil.DrawLine((tablePackObj2.EndX - tablePackObj2.X) / Columns * 1 + tablePackObj2.X + span, y + chaY, (tablePackObj2.EndX - tablePackObj2.X) / Columns * 2 + tablePackObj2.X + span, y, ZedControl, "ApplianceRecordListOpeDoing" + index, Color.Black); if (index < ApplianceRecordList.Count && ApplianceRecordList[index].CloseFront != null && ApplianceRecordList[index].CloseFront != "" && ApplianceRecordList[index].CloseFront != @"/") ZUtil.DrawText(ApplianceRecordList[index].CloseFront, (tablePackObj2.EndX - tablePackObj2.X) / Columns * 2 + tablePackObj2.X + tablePackObj.RealX, y, ZedControl, "ApplianceRecordListCloseFront" + index, Color.Black, fontsize, false); else - ZUtil.DrawLine1((tablePackObj2.EndX - tablePackObj2.X) / Columns * 2 + tablePackObj2.X + span, y + chaY, (tablePackObj2.EndX - tablePackObj2.X) / Columns * 3 + tablePackObj2.X + span, y, ZedControl, "ApplianceRecordListCloseFront" + index, Color.Black); + ZUtil.DrawLine((tablePackObj2.EndX - tablePackObj2.X) / Columns * 2 + tablePackObj2.X + span, y + chaY, (tablePackObj2.EndX - tablePackObj2.X) / Columns * 3 + tablePackObj2.X + span, y, ZedControl, "ApplianceRecordListCloseFront" + index, Color.Black); if (index < ApplianceRecordList.Count && ApplianceRecordList[index].CloseLast != null && ApplianceRecordList[index].CloseLast != "" && ApplianceRecordList[index].CloseLast != @"/") ZUtil.DrawText(ApplianceRecordList[index].CloseLast, (tablePackObj2.EndX - tablePackObj2.X) / Columns * 3 + tablePackObj2.X + tablePackObj.RealX, y, ZedControl, "ApplianceRecordListCloseLast" + index, Color.Black, fontsize, false); else - ZUtil.DrawLine1((tablePackObj2.EndX - tablePackObj2.X) / Columns * 3 + tablePackObj2.X + span, y + chaY, (tablePackObj2.EndX - tablePackObj2.X) / Columns * 4 + tablePackObj2.X + span, y, ZedControl, "ApplianceRecordListCloseLast" + index, Color.Black); + ZUtil.DrawLine((tablePackObj2.EndX - tablePackObj2.X) / Columns * 3 + tablePackObj2.X + span, y + chaY, (tablePackObj2.EndX - tablePackObj2.X) / Columns * 4 + tablePackObj2.X + span, y, ZedControl, "ApplianceRecordListCloseLast" + index, Color.Black); if (Columns == 5) if (index < ApplianceRecordList.Count && ApplianceRecordList[index].SkinCloseLast != null && ApplianceRecordList[index].SkinCloseLast != "" && ApplianceRecordList[index].SkinCloseLast != @"/") ZUtil.DrawText(ApplianceRecordList[index].SkinCloseLast, (tablePackObj2.EndX - tablePackObj2.X) / Columns * 4 + tablePackObj2.X + tablePackObj.RealX, y, ZedControl, "ApplianceRecordListSkinCloseLast" + index, Color.Black, fontsize, false); else - ZUtil.DrawLine1((tablePackObj2.EndX - tablePackObj2.X) / Columns * 4 + tablePackObj2.X + span, y + chaY, (tablePackObj2.EndX - tablePackObj2.X) / Columns * 5 + tablePackObj2.X + span, y, ZedControl, "ApplianceRecordListSkinCloseLast" + index, Color.Black); + ZUtil.DrawLine((tablePackObj2.EndX - tablePackObj2.X) / Columns * 4 + tablePackObj2.X + span, y + chaY, (tablePackObj2.EndX - tablePackObj2.X) / Columns * 5 + tablePackObj2.X + span, y, ZedControl, "ApplianceRecordListSkinCloseLast" + index, Color.Black); continue; //} diff --git a/DrawGraph/AreaManage/MonitorManage.cs b/DrawGraph/AreaManage/MonitorManage.cs index f7a321a..65761b9 100644 --- a/DrawGraph/AreaManage/MonitorManage.cs +++ b/DrawGraph/AreaManage/MonitorManage.cs @@ -90,7 +90,7 @@ namespace DrawGraph { pan.Controls.Clear(); int Width = pan.Width; - int Height = pan.Height / 3; + int Height = pan.Height / 4; List panPanels = new List(); //循环加载数值生命体征 for (int x = 0; x < myOpeRecord.PhysioConfigList.Count; x++) @@ -164,7 +164,7 @@ namespace DrawGraph } panPanels.Add(panel); } - for (int i = 2; i >= 0; i--) + for (int i = 3; i >= 0; i--) { pan.Controls.Add(panPanels[i]); } diff --git a/DrawGraph/AreaManage/PhysioDataManage.cs b/DrawGraph/AreaManage/PhysioDataManage.cs index 1963b92..3e50c2f 100644 --- a/DrawGraph/AreaManage/PhysioDataManage.cs +++ b/DrawGraph/AreaManage/PhysioDataManage.cs @@ -556,7 +556,7 @@ namespace DrawGraph } pp.ClearTagstr(ZedControl); //如果模板管理不为空 - if (pack != null && rowNum < 4 && pp.ShowText == true) + if (pack != null && rowNum < 5 && pp.ShowText == true) { double y = pack.RealY + getYPositionByListIndex(YRows, pack.RealY, pack.RealEndY, RowsCount); ZUtil.DrawText(pp.Name, pack.RealX, y, ZedControl, "PP" + pp.Enname, 5.5f); @@ -602,7 +602,7 @@ namespace DrawGraph pp.setAnasArr(ZedControl, chartPack.RealX, chartPack.RealEndX, myOpeRecord.pageBegin, myOpeRecord.pageBegin.AddMinutes(EVERY_PAGE_TIME_SPAN)); pp.ClearTagstr(ZedControl); - if (rowNum < 4) + if (rowNum < 5) { double y = pack.RealY + getYPositionByListIndex(YRows, pack.RealY, pack.RealEndY, RowsCount); ZUtil.DrawText(pp.Name, pack.RealX, y, ZedControl, "PP" + pp.Enname + pp.Id, 5.5f); @@ -669,7 +669,7 @@ namespace DrawGraph myOpeRecord.pageBegin.AddMinutes(EVERY_PAGE_TIME_SPAN)); pp.ClearTagstr(ZedControl); //如果模板管理不为空 - if (pack != null && rowNum < 4 && pp.ShowText == true) + if (pack != null && rowNum < 5 && pp.ShowText == true) { double y = pack.RealY + getYPositionByListIndex(YRows, pack.RealY, pack.RealEndY, RowsCount); ZUtil.DrawText(pp.Name, pack.RealX, y, ZedControl, "PP" + pp.Enname, 5.5f); @@ -695,7 +695,7 @@ namespace DrawGraph pp.setAnasArr(ZedControl, chartPack.RealX, chartPack.RealEndX, myOpeRecord.pageBegin, myOpeRecord.pageBegin.AddMinutes(EVERY_PAGE_TIME_SPAN)); pp.ClearTagstr(ZedControl); - if (pp.ShowText == true && rowNum < 4) + if (pp.ShowText == true && rowNum < 5) { double y = pack.RealY + getYPositionByListIndex(YRows, pack.RealY, pack.RealEndY, RowsCount); ZUtil.DrawText(pp.Name, pack.RealX, y, ZedControl, "PP" + pp.Enname + pp.Id, 5.5f); diff --git a/DrawGraph/AreaManage/SapManage.cs b/DrawGraph/AreaManage/SapManage.cs index f494f33..638c2d0 100644 --- a/DrawGraph/AreaManage/SapManage.cs +++ b/DrawGraph/AreaManage/SapManage.cs @@ -276,9 +276,9 @@ namespace DrawGraph { double height = getYPositionByListIndex(1, sapPpack.RealY, sapPpack.RealEndY, RowsCount) / 2; //double x = H3pack.RealX + 0.003f; - ZUtil.DrawLine(x, zhuy + height, x, y + height, ZedControl, "zhuyDrugs" + temp.Id, Color.Red); - ZUtil.DrawLine(x, zhuy + height, x + 0.0055f, zhuy + height, ZedControl, "zhuyDrugstop" + temp.Id, Color.Red); - ZUtil.DrawLine(x, y + height, x + 0.0055f, y + height, ZedControl, "zhuyDrugsend" + temp.Id, Color.Red); + ZUtil.DrawLine2(x, zhuy + height, x, y + height, ZedControl, "zhuyDrugs" + temp.Id, Color.Red); + ZUtil.DrawLine2(x, zhuy + height, x + 0.0055f, zhuy + height, ZedControl, "zhuyDrugstop" + temp.Id, Color.Red); + ZUtil.DrawLine2(x, y + height, x + 0.0055f, y + height, ZedControl, "zhuyDrugsend" + temp.Id, Color.Red); } private void SetDrug(FactDrug temp, DateTime curTimeTemp, double y) { diff --git a/DrawGraph/BoardPack/AbandonTablePackObj.cs b/DrawGraph/BoardPack/AbandonTablePackObj.cs index 8159706..cc35b99 100644 --- a/DrawGraph/BoardPack/AbandonTablePackObj.cs +++ b/DrawGraph/BoardPack/AbandonTablePackObj.cs @@ -171,19 +171,19 @@ namespace DrawGraph } boxObj.Fill.IsVisible = false; boxObj.ZOrder = ZOrder.B_BehindLegend; - Util.DrawBox(boxObj, this.baseZed); + ZUtil.DrawBox(boxObj, this.baseZed); int num3 = 1; while ((long)num3 < (long)((ulong)this.rows)) { float num4 = this.RealStartY + (float)num3 * ((this.RealEndY - this.RealStartY) / this.rows); - Util.DrawLine((double)this.RealStartX, (double)num4, (double)this.RealEndX, (double)num4, this.baseZed, base.PackTag + "-" + num3.ToString(), boxObj.Border.Color); + ZUtil.DrawLine((double)this.RealStartX, (double)num4, (double)this.RealEndX, (double)num4, this.baseZed, base.PackTag + "-" + num3.ToString(), boxObj.Border.Color); num3++; } int num5 = 1; while ((long)num5 < (long)((ulong)this.columns)) { float num6 = this.RealStartX + (float)num5 * ((this.RealEndX - this.RealStartX) / this.columns); - Util.DrawLine((double)num6, (double)this.RealStartY, (double)num6, (double)this.RealEndY, this.baseZed, base.PackTag + "-" + num5.ToString(), boxObj.Border.Color); + ZUtil.DrawLine((double)num6, (double)this.RealStartY, (double)num6, (double)this.RealEndY, this.baseZed, base.PackTag + "-" + num5.ToString(), boxObj.Border.Color); num5++; } int num7 = 0; @@ -196,7 +196,7 @@ namespace DrawGraph float num10 = this.RealStartY + (float)(num7 + 1) * ((this.RealEndY - this.RealStartY) / this.rows); float num11 = this.RealStartX + (float)(num8 + 1) * ((this.RealEndX - this.RealStartX) / this.columns); float num12 = this.RealStartY + (float)num7 * ((this.RealEndY - this.RealStartY) / this.rows); - Util.DrawLine((double)num9, (double)num10, (double)num11, (double)num12, this.baseZed, base.PackTag + "-" + ((num7 + 1) * (num8 + 1)).ToString(), boxObj.Border.Color); + ZUtil.DrawLine((double)num9, (double)num10, (double)num11, (double)num12, this.baseZed, base.PackTag + "-" + ((num7 + 1) * (num8 + 1)).ToString(), boxObj.Border.Color); num8++; } num7++; diff --git a/DrawGraph/BoardPack/AbleEditPackObj.cs b/DrawGraph/BoardPack/AbleEditPackObj.cs index bfc9edf..f17819b 100644 --- a/DrawGraph/BoardPack/AbleEditPackObj.cs +++ b/DrawGraph/BoardPack/AbleEditPackObj.cs @@ -409,7 +409,7 @@ namespace DrawGraph FileStream fileStream = new FileStream(text, FileMode.Open, FileAccess.Read); Image image = Image.FromStream(fileStream); fileStream.Close(); - Util.DrawImage(new ImageObj(image, (double)base.RealX, (double)base.RealY, (double)(base.RealEndX - base.RealX), (double)(base.RealEndY - base.RealY)) + ZUtil.DrawImage(new ImageObj(image, (double)base.RealX, (double)base.RealY, (double)(base.RealEndX - base.RealX), (double)(base.RealEndY - base.RealY)) { IsVisible = true, ZOrder = ZOrder.A_InFront, diff --git a/DrawGraph/BoardPack/BoxPackObj.cs b/DrawGraph/BoardPack/BoxPackObj.cs index f458cf2..187dc9b 100644 --- a/DrawGraph/BoardPack/BoxPackObj.cs +++ b/DrawGraph/BoardPack/BoxPackObj.cs @@ -75,7 +75,7 @@ namespace DrawGraph boxObj.Fill.IsVisible = true; boxObj.Fill.Color = this.FillColor; boxObj.ZOrder = ZOrder.B_BehindLegend; - Util.DrawBox(boxObj, this.baseZed); + ZUtil.DrawBox(boxObj, this.baseZed); base.Refresh(); } } diff --git a/DrawGraph/BoardPack/DottedLinePackObj.cs b/DrawGraph/BoardPack/DottedLinePackObj.cs index 09d62c9..b37e3fc 100644 --- a/DrawGraph/BoardPack/DottedLinePackObj.cs +++ b/DrawGraph/BoardPack/DottedLinePackObj.cs @@ -43,7 +43,7 @@ namespace DrawGraph { red = Color.Red; } - Util.DrawLine((double)base.RealX, (double)base.RealY, (double)base.RealEndX, (double)base.RealEndY, this.baseZed, base.PackTag, red, DashStyle.Dot); + ZUtil.DrawLine((double)base.RealX, (double)base.RealY, (double)base.RealEndX, (double)base.RealEndY, this.baseZed, base.PackTag, red, DashStyle.Dot); base.Refresh(); } } diff --git a/DrawGraph/BoardPack/DottedLinesPackObj.cs b/DrawGraph/BoardPack/DottedLinesPackObj.cs index 790706d..bd018cf 100644 --- a/DrawGraph/BoardPack/DottedLinesPackObj.cs +++ b/DrawGraph/BoardPack/DottedLinesPackObj.cs @@ -135,7 +135,7 @@ namespace DrawGraph bool flag5 = i < this.lineCount - 1; if (flag5) { - Util.DrawLine((double)num, (double)base.RealY, (double)num, (double)base.RealEndY, this.baseZed, base.PackTag + "-" + i.ToString(), red, DashStyle.Dot); + ZUtil.DrawLine((double)num, (double)base.RealY, (double)num, (double)base.RealEndY, this.baseZed, base.PackTag + "-" + i.ToString(), red, DashStyle.Dot); } } else @@ -147,7 +147,7 @@ namespace DrawGraph bool flag7 = i < this.lineCount - 1; if (flag7) { - Util.DrawLine((double)base.RealX, (double)num2, (double)base.RealEndX, (double)num2, this.baseZed, base.PackTag + "-" + i.ToString(), red, DashStyle.Dot); + ZUtil.DrawLine((double)base.RealX, (double)num2, (double)base.RealEndX, (double)num2, this.baseZed, base.PackTag + "-" + i.ToString(), red, DashStyle.Dot); } } } diff --git a/DrawGraph/BoardPack/ImagePackObj.cs b/DrawGraph/BoardPack/ImagePackObj.cs index 78de393..d8a4dda 100644 --- a/DrawGraph/BoardPack/ImagePackObj.cs +++ b/DrawGraph/BoardPack/ImagePackObj.cs @@ -66,7 +66,7 @@ namespace DrawGraph bool flag3 = this.img == null; if (!flag3) { - Util.DrawImage(new ImageObj(this.img, (double)base.RealX, (double)base.RealY, (double)base.RealEndX, (double)base.RealEndY) + ZUtil.DrawImage(new ImageObj(this.img, (double)base.RealX, (double)base.RealY, (double)base.RealEndX, (double)base.RealEndY) { IsVisible = true, ZOrder = ZOrder.A_InFront, diff --git a/DrawGraph/BoardPack/LinePackObj.cs b/DrawGraph/BoardPack/LinePackObj.cs index 88b1d35..8f9a603 100644 --- a/DrawGraph/BoardPack/LinePackObj.cs +++ b/DrawGraph/BoardPack/LinePackObj.cs @@ -58,7 +58,7 @@ namespace DrawGraph { red = Color.Red; } - Util.DrawLineWidth((double)base.RealX, (double)base.RealY, (double)base.RealEndX, (double)base.RealEndY, this.baseZed, base.PackTag, red, this.LineWidth); + ZUtil.DrawLineWidth((double)base.RealX, (double)base.RealY, (double)base.RealEndX, (double)base.RealEndY, this.baseZed, base.PackTag, red, this.LineWidth); base.Refresh(); } } diff --git a/DrawGraph/BoardPack/LinesPackObj.cs b/DrawGraph/BoardPack/LinesPackObj.cs index c4152e9..25d40e3 100644 --- a/DrawGraph/BoardPack/LinesPackObj.cs +++ b/DrawGraph/BoardPack/LinesPackObj.cs @@ -149,7 +149,7 @@ namespace DrawGraph bool flag5 = i < this.lineCount - 1; if (flag5) { - Util.DrawLineWidth((double)num, (double)base.RealY, (double)num, (double)base.RealEndY, this.baseZed, base.PackTag + "-" + i.ToString(), red, this.LineWidth); + ZUtil.DrawLineWidth((double)num, (double)base.RealY, (double)num, (double)base.RealEndY, this.baseZed, base.PackTag + "-" + i.ToString(), red, this.LineWidth); } } else @@ -161,7 +161,7 @@ namespace DrawGraph bool flag7 = i < this.lineCount - 1; if (flag7) { - Util.DrawLineWidth((double)base.RealX, (double)num2, (double)base.RealEndX, (double)num2, this.baseZed, base.PackTag + "-" + i.ToString(), red, this.LineWidth); + ZUtil.DrawLineWidth((double)base.RealX, (double)num2, (double)base.RealEndX, (double)num2, this.baseZed, base.PackTag + "-" + i.ToString(), red, this.LineWidth); } } } diff --git a/DrawGraph/BoardPack/RectangleFramePackObj.cs b/DrawGraph/BoardPack/RectangleFramePackObj.cs index 4f6ffa8..24c8819 100644 --- a/DrawGraph/BoardPack/RectangleFramePackObj.cs +++ b/DrawGraph/BoardPack/RectangleFramePackObj.cs @@ -73,7 +73,7 @@ namespace DrawGraph } boxObj.Fill.IsVisible = false; boxObj.ZOrder = ZOrder.B_BehindLegend; - Util.DrawBox(boxObj, this.baseZed); + ZUtil.DrawBox(boxObj, this.baseZed); base.Refresh(); } } diff --git a/DrawGraph/BoardPack/RectanglePackObj.cs b/DrawGraph/BoardPack/RectanglePackObj.cs index ae035e1..b19c134 100644 --- a/DrawGraph/BoardPack/RectanglePackObj.cs +++ b/DrawGraph/BoardPack/RectanglePackObj.cs @@ -75,7 +75,7 @@ namespace DrawGraph boxObj.Fill.IsVisible = true; boxObj.Fill.Color = this.FillColor; boxObj.ZOrder = ZOrder.B_BehindLegend; - Util.DrawBox(boxObj, this.baseZed); + ZUtil.DrawBox(boxObj, this.baseZed); base.Refresh(); } } diff --git a/DrawGraph/BoardPack/TablePackObj.cs b/DrawGraph/BoardPack/TablePackObj.cs index 793e89e..8f4942e 100644 --- a/DrawGraph/BoardPack/TablePackObj.cs +++ b/DrawGraph/BoardPack/TablePackObj.cs @@ -101,19 +101,19 @@ namespace DrawGraph } boxObj.Fill.IsVisible = false; boxObj.ZOrder = ZOrder.B_BehindLegend; - Util.DrawBox(boxObj, this.baseZed); + ZUtil.DrawBox(boxObj, this.baseZed); int num3 = 1; while ((long)num3 < (long)((ulong)this.rows)) { float num4 = base.RealY + (float)num3 * ((base.RealEndY - base.RealY) / this.rows); - Util.DrawLine((double)base.RealX, (double)num4, (double)base.RealEndX, (double)num4, this.baseZed, base.PackTag + "-" + num3.ToString(), boxObj.Border.Color); + ZUtil.DrawLine((double)base.RealX, (double)num4, (double)base.RealEndX, (double)num4, this.baseZed, base.PackTag + "-" + num3.ToString(), boxObj.Border.Color); num3++; } int num5 = 1; while ((long)num5 < (long)((ulong)this.columns)) { float num6 = base.RealX + (float)num5 * ((base.RealEndX - base.RealX) / this.columns); - Util.DrawLine((double)num6, (double)base.RealY, (double)num6, (double)base.RealEndY, this.baseZed, base.PackTag + "-" + num5.ToString(), boxObj.Border.Color); + ZUtil.DrawLine((double)num6, (double)base.RealY, (double)num6, (double)base.RealEndY, this.baseZed, base.PackTag + "-" + num5.ToString(), boxObj.Border.Color); num5++; } base.Refresh(); diff --git a/DrawGraph/BoardPack/TextPackObj.cs b/DrawGraph/BoardPack/TextPackObj.cs index 77325d1..70984fc 100644 --- a/DrawGraph/BoardPack/TextPackObj.cs +++ b/DrawGraph/BoardPack/TextPackObj.cs @@ -296,9 +296,9 @@ namespace DrawGraph { base.PackText = base.PackText.Replace("\r", "\u3000").Replace("\n", "\u3000"); TextObj textObj = this.CreateTextObj(base.PackText, base.PackTag); - Util.DrawText(textObj, this.baseZed); - this.width = Util.GetColWidthFraction(textObj, this.baseZed); - this.height = Util.GetColHeightFraction(textObj, this.baseZed); + ZUtil.DrawText(textObj, this.baseZed); + this.width = ZUtil.GetColWidthFraction(textObj, this.baseZed); + this.height = ZUtil.GetColHeightFraction(textObj, this.baseZed); base.EndX = base.X + this.width; base.EndY = base.Y + this.height; } @@ -326,12 +326,12 @@ namespace DrawGraph TextObj textObj2 = this.CreateTextObj(text, base.PackTag + "_" + i.ToString()); try { - float colHeightFraction = Util.GetColHeightFraction(textObj2, this.baseZed); + float colHeightFraction = ZUtil.GetColHeightFraction(textObj2, this.baseZed); bool flag5 = i == 0 && base.X == base.EndX; if (flag5) { - this.width = Util.GetColWidthFraction(textObj2, this.baseZed); - this.height = Util.GetColHeightFraction(textObj2, this.baseZed); + this.width = ZUtil.GetColWidthFraction(textObj2, this.baseZed); + this.height = ZUtil.GetColHeightFraction(textObj2, this.baseZed); } this.height = (float)num - base.RealY + colHeightFraction; bool flag6 = base.X == base.EndX; @@ -346,7 +346,7 @@ namespace DrawGraph } textObj2.Location.X = (double)base.RealX; textObj2.Location.Y = num; - Util.DrawText(textObj2, this.baseZed); + ZUtil.DrawText(textObj2, this.baseZed); } } } @@ -373,9 +373,9 @@ namespace DrawGraph return result; } TextObj text2 = this.CreateTextObj(text.Substring(0, num3), base.PackTag); - float colWidthFraction = Util.GetColWidthFraction(text2, this.baseZed); + float colWidthFraction = ZUtil.GetColWidthFraction(text2, this.baseZed); TextObj text3 = this.CreateTextObj(text.Substring(0, num3 + 1), base.PackTag); - float colWidthFraction2 = Util.GetColWidthFraction(text3, this.baseZed); + float colWidthFraction2 = ZUtil.GetColWidthFraction(text3, this.baseZed); float num4 = base.RealEndX - base.RealX + 0.0002f; bool flag3 = colWidthFraction <= num4 && colWidthFraction2 > num4; if (flag3) @@ -437,7 +437,7 @@ namespace DrawGraph float num = base.RealY + (float)i * this.RowSpan; TextObj textObj = this.CreateTextObj(text, base.PackTag + "_" + i.ToString()); textObj.Location = new Location((double)base.RealX, (double)num, CoordType.PaneFraction); - Util.DrawText(textObj, this.baseZed); + ZUtil.DrawText(textObj, this.baseZed); } } } diff --git a/DrawGraph/DrawGraph.csproj b/DrawGraph/DrawGraph.csproj index aedaf63..8a3a0f1 100644 --- a/DrawGraph/DrawGraph.csproj +++ b/DrawGraph/DrawGraph.csproj @@ -201,7 +201,6 @@ - @@ -220,7 +219,6 @@ - @@ -281,45 +279,22 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DrawGraph/GUtil/XmlUtil.cs b/DrawGraph/GUtil/XmlUtil.cs deleted file mode 100644 index b333ca3..0000000 --- a/DrawGraph/GUtil/XmlUtil.cs +++ /dev/null @@ -1,512 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml; - -namespace DrawGraph -{ - public class XmlUtil - { - private XmlDocument _document = new XmlDocument(); - - private string _xmlPath; - - private string _nodePath; - - public string XmlPath - { - get - { - return this._xmlPath; - } - set - { - this._xmlPath = value; - } - } - - public string NodePath - { - get - { - return this._nodePath; - } - set - { - this._nodePath = value; - } - } - - public XmlUtil(string xmlPath, string nodePath) - { - this._xmlPath = xmlPath; - this._nodePath = nodePath; - this._document.Load(xmlPath); - } - - public XmlUtil(string xmlPath) - { - this._xmlPath = xmlPath; - this._document.Load(xmlPath); - } - - public string Out() - { - return this._document.OuterXml; - } - - public List GetNode(string nodeName) - { - List result; - try - { - List list = new List(); - XmlNodeList elementsByTagName = this._document.GetElementsByTagName(nodeName); - foreach (XmlNode xmlNode in elementsByTagName) - { - list.Add(xmlNode.InnerText); - } - result = list; - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - return result; - } - - public List GetNode(string path, string nodeName) - { - List result; - try - { - List list = new List(); - XmlNodeList xmlNodeList = this._document.SelectNodes(path); - foreach (XmlNode xmlNode in xmlNodeList) - { - list.Add(xmlNode[nodeName].InnerText); - } - result = list; - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - return result; - } - - public List> GetNodePair(string path, string nodeName, string nodeName2) - { - List> result; - try - { - List> list = new List>(); - XmlNodeList xmlNodeList = this._document.SelectNodes(path); - if (xmlNodeList != null) - { - foreach (XmlNode xmlNode in xmlNodeList) - { - XmlElement xmlElement = xmlNode[nodeName]; - if (xmlElement != null) - { - XmlElement xmlElement2 = xmlNode[nodeName2]; - if (xmlElement2 != null) - { - list.Add(new KeyValuePair(xmlElement.InnerText, xmlElement2.InnerText)); - } - } - } - } - result = list; - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - return result; - } - - public string GetNode(int i, int j, string path) - { - string innerText; - try - { - XmlNodeList xmlNodeList = this._document.SelectNodes(path); - innerText = xmlNodeList[i].ChildNodes[j].InnerText; - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - return innerText; - } - - public string GetNode(int i, int j) - { - string innerText; - try - { - XmlNodeList xmlNodeList = this._document.SelectNodes(this._nodePath); - innerText = xmlNodeList[i].ChildNodes[j].InnerText; - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - return innerText; - } - - public string GetNode(int i, string nodePath, string nodeName) - { - string result; - try - { - XmlNodeList xmlNodeList = this._document.SelectNodes(nodePath); - for (int j = 0; j <= xmlNodeList[i].ChildNodes.Count; j++) - { - if (xmlNodeList[i].ChildNodes[j].Name.Equals(nodeName)) - { - result = xmlNodeList[i].ChildNodes[j].InnerText; - return result; - } - } - result = "nofind"; - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - return result; - } - - public string GetNode(string uncleName, string uncleValue, string nodePath, string parentName, string nodeName) - { - string result; - try - { - XmlNodeList xmlNodeList = this._document.SelectNodes(nodePath); - for (int i = 0; i < xmlNodeList.Count; i++) - { - XmlElement xmlElement = (XmlElement)xmlNodeList[i]; - if (xmlElement.GetElementsByTagName(uncleName)[0].InnerText.Equals(uncleValue)) - { - result = (xmlElement.GetElementsByTagName(parentName)[0] as XmlElement).GetElementsByTagName(nodeName)[0].InnerText; - return result; - } - } - result = ""; - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - return result; - } - - public string GetNode(string siblingName, string siblingValue, string nodePath, string nodeName) - { - string result; - try - { - XmlNodeList xmlNodeList = this._document.SelectNodes(nodePath); - for (int i = 0; i < xmlNodeList.Count; i++) - { - XmlElement xmlElement = (XmlElement)xmlNodeList[i]; - string innerText = xmlElement.GetElementsByTagName(siblingName)[0].InnerText; - if (innerText.Equals(siblingValue)) - { - result = xmlElement.GetElementsByTagName(nodeName)[0].InnerText; - return result; - } - } - result = ""; - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - return result; - } - - public string GetNode(int i, string nodeName) - { - string result; - try - { - XmlNodeList xmlNodeList = this._document.SelectNodes(this._nodePath); - for (int j = 0; j <= xmlNodeList[i].ChildNodes.Count; j++) - { - if (xmlNodeList[i].ChildNodes[j].Name.Equals(nodeName)) - { - result = xmlNodeList[i].ChildNodes[j].InnerText; - return result; - } - } - result = "nofind"; - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - return result; - } - - public int Count(string nodeName) - { - int count; - try - { - XmlNodeList elementsByTagName = this._document.GetElementsByTagName(nodeName); - count = elementsByTagName.Count; - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - return count; - } - - public int Count() - { - int count; - try - { - XmlNodeList xmlNodeList = this._document.SelectNodes(this._nodePath); - count = xmlNodeList.Count; - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - return count; - } - - public int CountChilds(int i, string nodeName) - { - int result; - try - { - XmlNodeList elementsByTagName = this._document.GetElementsByTagName(nodeName); - if (elementsByTagName.Count > 0) - { - result = elementsByTagName[i].ChildNodes.Count; - } - else - { - result = 0; - } - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - return result; - } - - public int CountChilds(string nodeName) - { - int result; - try - { - int num = 0; - XmlNodeList elementsByTagName = this._document.GetElementsByTagName(nodeName); - if (elementsByTagName.Count > 0) - { - for (int i = 0; i < elementsByTagName.Count; i++) - { - num += elementsByTagName[i].ChildNodes.Count; - } - result = num; - } - else - { - result = 0; - } - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - return result; - } - - public int SetNode(string nodeName, string newValue) - { - int count; - try - { - XmlNodeList elementsByTagName = this._document.GetElementsByTagName(nodeName); - foreach (XmlNode xmlNode in elementsByTagName) - { - xmlNode.InnerText = newValue; - } - this._document.Save(this._xmlPath); - count = elementsByTagName.Count; - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - return count; - } - - public void SetNode(int i, string nodePath, string nodeName, string newValue) - { - try - { - XmlNodeList xmlNodeList = this._document.SelectNodes(nodePath); - if (xmlNodeList.Count <= 0 || xmlNodeList.Count <= i) - { - throw new Exception("并无此子集"); - } - for (int j = 0; j < xmlNodeList.Item(i).ChildNodes.Count; j++) - { - if (xmlNodeList[i].ChildNodes[j].Name == nodeName) - { - xmlNodeList[i].ChildNodes[j].InnerText = newValue; - } - } - this._document.Save(this._xmlPath); - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - } - - public void SetNode(int i, string nodeName, string newValue) - { - try - { - XmlNodeList xmlNodeList = this._document.SelectNodes(this._nodePath); - if (xmlNodeList.Count > 0 && xmlNodeList.Count > i) - { - for (int j = 0; j < xmlNodeList.Item(i).ChildNodes.Count; j++) - { - if (xmlNodeList.Item(i).ChildNodes.Item(j).Name == nodeName) - { - xmlNodeList.Item(i).ChildNodes.Item(j).InnerText = newValue; - } - } - this._document.Save(this._xmlPath); - } - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - } - - public void InsetNode(string parentName, string nodeName, string nodeVale) - { - XmlNodeList elementsByTagName = this._document.GetElementsByTagName(parentName); - for (int i = 0; i < elementsByTagName.Count; i++) - { - XmlElement xmlElement = this._document.CreateElement(nodeName); - elementsByTagName.Item(i).AppendChild(xmlElement); - xmlElement.InnerText = nodeVale; - } - this._document.Save(this._xmlPath); - } - - public void InsetNode(int i, string parentName, string nodeName, string nodeValue) - { - try - { - XmlNodeList elementsByTagName = this._document.GetElementsByTagName(parentName); - XmlElement xmlElement = this._document.CreateElement(nodeName); - if (elementsByTagName.Count <= 0) - { - throw new Exception("无此节点"); - } - elementsByTagName[i - 1].AppendChild(xmlElement); - xmlElement.InnerText = nodeValue; - this._document.Save(this._xmlPath); - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - } - - public void InsertRootNode(string rootName, string[] nodeName, string[] nodeValue) - { - XmlElement documentElement = this._document.DocumentElement; - XmlElement xmlElement = this._document.CreateElement(rootName); - documentElement.AppendChild(xmlElement); - for (int i = 0; i < nodeName.Length; i++) - { - XmlElement xmlElement2 = this._document.CreateElement(nodeName[i]); - xmlElement.AppendChild(xmlElement2); - xmlElement2.InnerText = nodeValue[i]; - } - this._document.Save(this._xmlPath); - } - - public void InsertNode(string nodePath, string parentName, string[] nodeName, string[] nodeValue) - { - XmlNodeList xmlNodeList = this._document.SelectNodes(nodePath); - XmlElement xmlElement = this._document.CreateElement(parentName); - xmlNodeList[0].AppendChild(xmlElement); - for (int i = 0; i < nodeName.Length; i++) - { - XmlElement xmlElement2 = this._document.CreateElement(nodeName[i]); - xmlElement2.InnerText = nodeValue[i]; - xmlElement.AppendChild(xmlElement2); - } - this._document.Save(this._xmlPath); - } - - public void DeleteNode(string parentName, string nodeName) - { - XmlNodeList elementsByTagName = this._document.GetElementsByTagName(parentName); - foreach (XmlNode xmlNode in elementsByTagName) - { - foreach (XmlNode xmlNode2 in xmlNode.ChildNodes) - { - if (xmlNode2.Name == nodeName) - { - xmlNode.RemoveChild(xmlNode2); - } - } - } - this._document.Save(this._xmlPath); - } - - public void DeleteNode(string parentName) - { - XmlNodeList elementsByTagName = this._document.GetElementsByTagName(parentName); - foreach (XmlNode xmlNode in elementsByTagName) - { - xmlNode.RemoveAll(); - } - this._document.Save(this._xmlPath); - } - - public void DeleteAll() - { - XmlElement documentElement = this._document.DocumentElement; - documentElement.RemoveAll(); - this._document.Save(this._xmlPath); - } - - public bool Save(string xmlName, string rootElement) - { - bool result; - try - { - string filename = Directory.GetCurrentDirectory() + "\\" + xmlName; - XmlDocument xmlDocument = new XmlDocument(); - XmlElement newChild = xmlDocument.CreateElement(rootElement); - xmlDocument.AppendChild(newChild); - xmlDocument.Save(filename); - result = true; - } - catch (XmlException ex) - { - throw new Exception(ex.Message); - } - return result; - } - } -} diff --git a/DrawGraph/Graph/Util.cs b/DrawGraph/Graph/Util.cs deleted file mode 100644 index 93174d8..0000000 --- a/DrawGraph/Graph/Util.cs +++ /dev/null @@ -1,146 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using DrawGraph; -using System.Drawing; -using System.IO; -using System.Reflection; -using System.Resources; -using System.Drawing.Imaging; -using System.Drawing.Drawing2D; - -namespace DrawGraph -{ - public class Util - { - public static FontSpec Font14 = new FontSpec("宋体", 14.0f, Color.Black, true, false, false); - public static FontSpec Font16 = new FontSpec("宋体", 16.0f, Color.Black, true, false, false); - - public static void DrawText(string letter, double x, double y, ZedGraphControl zedGraph, FontSpec font) - { - TextObj text = new TextObj(letter, x, y, CoordType.PaneFraction); - text.FontSpec = font; - text.FontSpec.Border.IsVisible = false; - text.FontSpec.Fill.IsVisible = false; - text.Location.AlignH = AlignH.Left; - text.Location.AlignV = AlignV.Top; - text.ZOrder = ZOrder.A_InFront; - zedGraph.MasterPane.GraphObjList.Add(text); - } - - public static void DrawLine(double x1, double y1, double x2, double y2, ZedGraphControl zedGraph) - { - LineObj line = new LineObj(Color.Gray, x1, y1, x2, y2); - line.IsVisible = true; - line.ZOrder = ZOrder.A_InFront; - line.Location.AlignH = AlignH.Left; - line.Location.AlignV = AlignV.Top; - line.Location.CoordinateFrame = CoordType.PaneFraction; - zedGraph.MasterPane.GraphObjList.Add(line); - } - - public static void DrawLine(double x1, double y1, double x2, double y2, ZedGraphControl zedGraph, string tag, Color LineColor) - { - LineObj lineObj = new LineObj(LineColor, x1, y1, x2, y2); - lineObj.IsVisible = true; - lineObj.ZOrder = ZOrder.A_InFront; - lineObj.Location.AlignH = AlignH.Left; - lineObj.Location.AlignV = AlignV.Top; - lineObj.Location.CoordinateFrame = CoordType.PaneFraction; - lineObj.Tag = tag; - zedGraph.MasterPane.GraphObjList.Add(lineObj); - } - /// - /// 在Zedgraph上绘图 - /// - /// 已定义好的ImageObj对象 - /// ZedGraphControl - public static void DrawImage(ImageObj imgObj, ZedGraphControl zedGraph) - { - zedGraph.MasterPane.GraphObjList.Add(imgObj); - } - /// - /// 根据自定义好的TextObj绘制文字 - /// - /// 已定义的TextObj - /// ZedGraphControl - public static void DrawText(TextObj text, ZedGraphControl zedGraph) - { - zedGraph.MasterPane.GraphObjList.Add(text); - } - /// - /// 绘制矩形 - /// - /// 已定义的BoxObj对象 - /// ZedGraphControl - public static void DrawBox(BoxObj box, ZedGraphControl zedGraph) - { - zedGraph.MasterPane.GraphObjList.Add(box); - } - /// - /// 画出带标签的线 - /// - /// 起点X坐标 - /// 起点Y坐标 - /// 终点X坐标 - /// 终点Y坐标 - /// ZedGraphControl - /// 线标签 - public static void DrawLine(double x1, double y1, double x2, double y2, ZedGraphControl zedGraph, string tag, Color LineColor, DashStyle style = DashStyle.Solid) - { - LineObj line = new LineObj(LineColor, x1, y1, x2, y2); - line.IsVisible = true; - line.ZOrder = ZOrder.B_BehindLegend; - line.Location.AlignH = AlignH.Left; - line.Location.AlignV = AlignV.Top; - line.Location.CoordinateFrame = CoordType.PaneFraction; - line.Tag = tag; - line.Line.Style = style; - zedGraph.MasterPane.GraphObjList.Add(line); - } - - /// - /// 获取TextObj字体的相对宽度 - /// - /// - /// - public static float GetColWidthFraction(TextObj text, ZedGraphControl zgc) - { - GraphPane pane = zgc.GraphPane; - float ratio = pane.CalcScaleFactor(); - Graphics g = zgc.CreateGraphics(); - float absoluteWidth = text.FontSpec.GetWidth(g, text.Text, ratio); - float paneWidth = pane.Rect.Width; - return absoluteWidth / paneWidth; - } - /// - /// 获取TextObj字体的相对高度 - /// - /// - /// - /// - public static float GetColHeightFraction(TextObj text, ZedGraphControl zgc) - { - GraphPane pane = zgc.GraphPane; - float ratio = pane.CalcScaleFactor(); - Graphics g = zgc.CreateGraphics(); - float absoluteHeight = text.FontSpec.GetHeight(ratio); - float paneHeight = pane.Rect.Height; - return absoluteHeight / paneHeight; - } - ///////////////////////////////////////////////////////////////////////// - public static void DrawLineWidth(double x1, double y1, double x2, double y2, ZedGraphControl zedGraph, string tag, Color LineColor, int width = 1) - { - LineObj line = new LineObj(LineColor, x1, y1, x2, y2); - line.IsVisible = true; - line.ZOrder = ZOrder.A_InFront; - line.Location.AlignH = AlignH.Left; - line.Location.AlignV = AlignV.Top; - line.Location.CoordinateFrame = CoordType.PaneFraction; - line.Tag = tag; - line.Line.Style = DashStyle.Solid; - line.Line.Width = width; - zedGraph.MasterPane.GraphObjList.Add(line); - } - } -} diff --git a/DrawGraph/Graph/ZUtil.cs b/DrawGraph/Graph/ZUtil.cs index e0aaa29..f8aab09 100644 --- a/DrawGraph/Graph/ZUtil.cs +++ b/DrawGraph/Graph/ZUtil.cs @@ -18,6 +18,9 @@ namespace DrawGraph /// public class ZUtil { + public static FontSpec Font14 = new FontSpec("宋体", 14.0f, Color.Black, true, false, false); + public static FontSpec Font16 = new FontSpec("宋体", 16.0f, Color.Black, true, false, false); + /// /// 在ZedGraphControl上添加文字,默认使用宋体9号黑色字体 /// @@ -38,26 +41,6 @@ namespace DrawGraph text.Tag = tag; zedGraph.MasterPane.GraphObjList.Add(text); } - /// - /// 在ZedGraphControl上添加文字,默认使用宋体9号黑色字体 - /// - /// 要绘出的文字 - /// 绘制文字的左上起始点x坐标 - /// 绘制文字的左上起始点y坐标 - /// ZedGraphControl - /// 控件的标签名 - public static void DrawDrugText(string letter, double x, double y, ZedGraphControl zedGraph, string tag, Color color, float fontSize = 8.0f) - { - TextObj text = new TextObj(letter, x, y, CoordType.PaneFraction); - text.FontSpec = new FontSpec("微软雅黑", fontSize, color, false, false, false); - text.FontSpec.Border.IsVisible = false; - text.FontSpec.Fill.IsVisible = true; - text.Location.AlignH = AlignH.Left; - text.Location.AlignV = AlignV.Top; - text.ZOrder = ZOrder.B_BehindLegend; - text.Tag = tag; - zedGraph.MasterPane.GraphObjList.Add(text); - } public static void DrawText(string letter, double x, double y, ZedGraphControl zedGraph, string tag, Color fontColor, float fontSize = 8.0f, bool isBold = false) { TextObj text = new TextObj(letter, x, y, CoordType.PaneFraction); @@ -113,7 +96,6 @@ namespace DrawGraph text.Tag = tag; zedGraph.MasterPane.GraphObjList.Add(text); } - /// /// 在ZedGraphControl Chart上添加文字,默认使用宋体5号黑色字体 /// @@ -136,11 +118,76 @@ namespace DrawGraph text.Tag = tag; zedGraph.MasterPane.GraphObjList.Add(text); } + /// + /// 在ZedGraphControl上添加文字,默认使用宋体9号黑色字体 + /// + /// 要绘出的文字 + /// 绘制文字的左上起始点x坐标 + /// 绘制文字的左上起始点y坐标 + /// ZedGraphControl + /// 控件的标签名 + public static void DrawDrugText(string letter, double x, double y, ZedGraphControl zedGraph, string tag, Color color, float fontSize = 8.0f) + { + TextObj text = new TextObj(letter, x, y, CoordType.PaneFraction); + text.FontSpec = new FontSpec("微软雅黑", fontSize, color, false, false, false); + text.FontSpec.Border.IsVisible = false; + text.FontSpec.Fill.IsVisible = true; + text.Location.AlignH = AlignH.Left; + text.Location.AlignV = AlignV.Top; + text.ZOrder = ZOrder.B_BehindLegend; + text.Tag = tag; + zedGraph.MasterPane.GraphObjList.Add(text); + } - public static void DrawLine1(double x1, double y1, double x2, double y2, ZedGraphControl zedGraph, string tag, Color LineColor) + public static void DrawText(string letter, double x, double y, ZedGraphControl zedGraph, FontSpec font) + { + TextObj text = new TextObj(letter, x, y, CoordType.PaneFraction); + text.FontSpec = font; + text.FontSpec.Border.IsVisible = false; + text.FontSpec.Fill.IsVisible = false; + text.Location.AlignH = AlignH.Left; + text.Location.AlignV = AlignV.Top; + text.ZOrder = ZOrder.A_InFront; + zedGraph.MasterPane.GraphObjList.Add(text); + } + + public static void DrawLine(double x1, double y1, double x2, double y2, ZedGraphControl zedGraph, string tag, Color LineColor) + { + LineObj lineObj = new LineObj(LineColor, x1, y1, x2, y2); + lineObj.IsVisible = true; + lineObj.ZOrder = ZOrder.A_InFront; + lineObj.Location.AlignH = AlignH.Left; + lineObj.Location.AlignV = AlignV.Top; + lineObj.Location.CoordinateFrame = CoordType.PaneFraction; + lineObj.Tag = tag; + zedGraph.MasterPane.GraphObjList.Add(lineObj); + } + /// + /// 画出带标签的线 + /// + /// 起点X坐标 + /// 起点Y坐标 + /// 终点X坐标 + /// 终点Y坐标 + /// ZedGraphControl + /// 线标签 + public static void DrawLine(double x1, double y1, double x2, double y2, ZedGraphControl zedGraph, string tag, Color LineColor, DashStyle style = DashStyle.Solid) + { + LineObj line = new LineObj(LineColor, x1, y1, x2, y2); + line.IsVisible = true; + line.ZOrder = ZOrder.B_BehindLegend; + line.Location.AlignH = AlignH.Left; + line.Location.AlignV = AlignV.Top; + line.Location.CoordinateFrame = CoordType.PaneFraction; + line.Tag = tag; + line.Line.Style = style; + zedGraph.MasterPane.GraphObjList.Add(line); + } + + ///////////////////////////////////////////////////////////////////////// + public static void DrawLineWidth(double x1, double y1, double x2, double y2, ZedGraphControl zedGraph, string tag, Color LineColor, int width = 1) { LineObj line = new LineObj(LineColor, x1, y1, x2, y2); - line.Line.Width = 1; line.IsVisible = true; line.ZOrder = ZOrder.A_InFront; line.Location.AlignH = AlignH.Left; @@ -148,10 +195,11 @@ namespace DrawGraph line.Location.CoordinateFrame = CoordType.PaneFraction; line.Tag = tag; line.Line.Style = DashStyle.Solid; + line.Line.Width = width; zedGraph.MasterPane.GraphObjList.Add(line); - } + } - public static void DrawLine(double x1, double y1, double x2, double y2, ZedGraphControl zedGraph, string tag, Color LineColor) + public static void DrawLine2(double x1, double y1, double x2, double y2, ZedGraphControl zedGraph, string tag, Color LineColor) { LineObj line = new LineObj(LineColor, x1, y1, x2, y2); line.Line.Width = 2; @@ -191,12 +239,12 @@ namespace DrawGraph if (x1 != x2 && arrow.IsArrowHead == false) { - DrawLine(x1, y1 + 0.004, x1, y1 - 0.004, zedGraph, "A" + tag, c); - DrawLine(x2, y1 + 0.004, x2, y2 - 0.004, zedGraph, "B" + tag, c); + DrawLine2(x1, y1 + 0.004, x1, y1 - 0.004, zedGraph, "A" + tag, c); + DrawLine2(x2, y1 + 0.004, x2, y2 - 0.004, zedGraph, "B" + tag, c); } else { - DrawLine(x1, y1 + 0.004, x1, y1 - 0.004, zedGraph, "A" + tag, c); + DrawLine2(x1, y1 + 0.004, x1, y1 - 0.004, zedGraph, "A" + tag, c); } } /// @@ -270,6 +318,53 @@ namespace DrawGraph zedGraph.MasterPane.GraphObjList.Add(imgObj); } + /// + /// 在Zedgraph上绘图 + /// + /// 已定义好的ImageObj对象 + /// ZedGraphControl + public static void DrawImage(ImageObj imgObj, ZedGraphControl zedGraph) + { + zedGraph.MasterPane.GraphObjList.Add(imgObj); + } + /// + /// 根据自定义好的TextObj绘制文字 + /// + /// 已定义的TextObj + /// ZedGraphControl + public static void DrawText(TextObj text, ZedGraphControl zedGraph) + { + zedGraph.MasterPane.GraphObjList.Add(text); + } + /// + /// 获取TextObj字体的相对宽度 + /// + /// + /// + public static float GetColWidthFraction(TextObj text, ZedGraphControl zgc) + { + GraphPane pane = zgc.GraphPane; + float ratio = pane.CalcScaleFactor(); + Graphics g = zgc.CreateGraphics(); + float absoluteWidth = text.FontSpec.GetWidth(g, text.Text, ratio); + float paneWidth = pane.Rect.Width; + return absoluteWidth / paneWidth; + } + /// + /// 获取TextObj字体的相对高度 + /// + /// + /// + /// + public static float GetColHeightFraction(TextObj text, ZedGraphControl zgc) + { + GraphPane pane = zgc.GraphPane; + float ratio = pane.CalcScaleFactor(); + Graphics g = zgc.CreateGraphics(); + float absoluteHeight = text.FontSpec.GetHeight(ratio); + float paneHeight = pane.Rect.Height; + return absoluteHeight / paneHeight; + } /// /// 绘制矩形 /// diff --git a/DrawGraph/Resources/Close.png b/DrawGraph/Resources/Close.png deleted file mode 100644 index 58af4ed..0000000 Binary files a/DrawGraph/Resources/Close.png and /dev/null differ diff --git a/DrawGraph/Resources/Dia.png b/DrawGraph/Resources/Dia.png deleted file mode 100644 index c1a269e..0000000 Binary files a/DrawGraph/Resources/Dia.png and /dev/null differ diff --git a/DrawGraph/Resources/HR.png b/DrawGraph/Resources/HR.png deleted file mode 100644 index e5c3112..0000000 Binary files a/DrawGraph/Resources/HR.png and /dev/null differ diff --git a/DrawGraph/Resources/Resp.png b/DrawGraph/Resources/Resp.png deleted file mode 100644 index b283783..0000000 Binary files a/DrawGraph/Resources/Resp.png and /dev/null differ diff --git a/DrawGraph/Resources/SPO2f.png b/DrawGraph/Resources/SPO2f.png deleted file mode 100644 index 089624d..0000000 Binary files a/DrawGraph/Resources/SPO2f.png and /dev/null differ diff --git a/DrawGraph/Resources/Sys.png b/DrawGraph/Resources/Sys.png deleted file mode 100644 index 2924ed6..0000000 Binary files a/DrawGraph/Resources/Sys.png and /dev/null differ diff --git a/DrawGraph/Resources/T.png b/DrawGraph/Resources/T.png deleted file mode 100644 index 0d49f2d..0000000 Binary files a/DrawGraph/Resources/T.png and /dev/null differ diff --git a/DrawGraph/Resources/Temp.png b/DrawGraph/Resources/Temp.png deleted file mode 100644 index 810703d..0000000 Binary files a/DrawGraph/Resources/Temp.png and /dev/null differ diff --git a/DrawGraph/Resources/TriangleDown.png b/DrawGraph/Resources/TriangleDown.png deleted file mode 100644 index c6f2aae..0000000 Binary files a/DrawGraph/Resources/TriangleDown.png and /dev/null differ diff --git a/DrawGraph/Resources/cr.png b/DrawGraph/Resources/cr.png deleted file mode 100644 index 1938918..0000000 Binary files a/DrawGraph/Resources/cr.png and /dev/null differ diff --git a/DrawGraph/Resources/expand1.png b/DrawGraph/Resources/expand1.png deleted file mode 100644 index 27efa35..0000000 Binary files a/DrawGraph/Resources/expand1.png and /dev/null differ diff --git a/DrawGraph/Resources/expand2.png b/DrawGraph/Resources/expand2.png deleted file mode 100644 index 27efa35..0000000 Binary files a/DrawGraph/Resources/expand2.png and /dev/null differ diff --git a/DrawGraph/Resources/expand3.png b/DrawGraph/Resources/expand3.png deleted file mode 100644 index 27efa35..0000000 Binary files a/DrawGraph/Resources/expand3.png and /dev/null differ diff --git a/DrawGraph/Resources/mb.png b/DrawGraph/Resources/mb.png deleted file mode 100644 index de76e05..0000000 Binary files a/DrawGraph/Resources/mb.png and /dev/null differ diff --git a/DrawGraph/Resources/ms.png b/DrawGraph/Resources/ms.png deleted file mode 100644 index 33dca70..0000000 Binary files a/DrawGraph/Resources/ms.png and /dev/null differ diff --git a/DrawGraph/Resources/mz.png b/DrawGraph/Resources/mz.png deleted file mode 100644 index 8a5e61b..0000000 Binary files a/DrawGraph/Resources/mz.png and /dev/null differ diff --git a/DrawGraph/Resources/ok.png b/DrawGraph/Resources/ok.png deleted file mode 100644 index 779ffda..0000000 Binary files a/DrawGraph/Resources/ok.png and /dev/null differ diff --git a/DrawGraph/Resources/pjy.png b/DrawGraph/Resources/pjy.png deleted file mode 100644 index f8328e9..0000000 Binary files a/DrawGraph/Resources/pjy.png and /dev/null differ diff --git a/DrawGraph/Resources/sb.png b/DrawGraph/Resources/sb.png deleted file mode 100644 index f099c0d..0000000 Binary files a/DrawGraph/Resources/sb.png and /dev/null differ diff --git a/DrawGraph/Resources/sb2.png b/DrawGraph/Resources/sb2.png deleted file mode 100644 index 18c4ef1..0000000 Binary files a/DrawGraph/Resources/sb2.png and /dev/null differ diff --git a/DrawGraph/Resources/sb3.png b/DrawGraph/Resources/sb3.png deleted file mode 100644 index 39d9d15..0000000 Binary files a/DrawGraph/Resources/sb3.png and /dev/null differ diff --git a/DrawGraph/Resources/ss.png b/DrawGraph/Resources/ss.png deleted file mode 100644 index 27efa35..0000000 Binary files a/DrawGraph/Resources/ss.png and /dev/null differ diff --git a/DrawGraph/Resources/ss1.png b/DrawGraph/Resources/ss1.png deleted file mode 100644 index c15d340..0000000 Binary files a/DrawGraph/Resources/ss1.png and /dev/null differ