整理图标 图表方法
@ -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);
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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;
|
||||
//}
|
||||
|
||||
@ -90,7 +90,7 @@ namespace DrawGraph
|
||||
{
|
||||
pan.Controls.Clear();
|
||||
int Width = pan.Width;
|
||||
int Height = pan.Height / 3;
|
||||
int Height = pan.Height / 4;
|
||||
List<Panel> panPanels = new List<Panel>();
|
||||
//循环加载数值生命体征
|
||||
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]);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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++;
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -201,7 +201,6 @@
|
||||
<Compile Include="GUtil\EventObj.cs" />
|
||||
<Compile Include="GUtil\CommandManage.cs" />
|
||||
<Compile Include="GUtil\EntityObjectChangeNotifier.cs" />
|
||||
<Compile Include="GUtil\XmlUtil.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Graph\RadarPointList.cs" />
|
||||
<Compile Include="Graph\RollingPointPairList.cs" />
|
||||
@ -220,7 +219,6 @@
|
||||
<Compile Include="Graph\TextObj.cs" />
|
||||
<Compile Include="Graph\TextScale.cs" />
|
||||
<Compile Include="Graph\Types.cs" />
|
||||
<Compile Include="Graph\Util.cs" />
|
||||
<Compile Include="GUtil\BoardUtil.cs" />
|
||||
<Compile Include="GUtil\ClassAttributs.cs" />
|
||||
<Compile Include="GUtil\CodeTableItem.cs" />
|
||||
@ -281,45 +279,22 @@
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources\bg.png" />
|
||||
<EmbeddedResource Include="Resources\Circle.png" />
|
||||
<EmbeddedResource Include="Resources\Close.png" />
|
||||
<EmbeddedResource Include="Resources\cr.png" />
|
||||
<EmbeddedResource Include="Resources\cssj.png" />
|
||||
<EmbeddedResource Include="Resources\Dia.png" />
|
||||
<EmbeddedResource Include="Resources\dmy.png" />
|
||||
<EmbeddedResource Include="Resources\expand1.png" />
|
||||
<EmbeddedResource Include="Resources\expand2.png" />
|
||||
<EmbeddedResource Include="Resources\expand3.png" />
|
||||
<EmbeddedResource Include="Resources\HR.png" />
|
||||
<EmbeddedResource Include="Resources\jxtq.png" />
|
||||
<EmbeddedResource Include="Resources\MAP.png" />
|
||||
<EmbeddedResource Include="Resources\mb.png" />
|
||||
<EmbeddedResource Include="Resources\ms.png" />
|
||||
<EmbeddedResource Include="Resources\mz.png" />
|
||||
<EmbeddedResource Include="Resources\mzjs.png" />
|
||||
<EmbeddedResource Include="Resources\mzks.png" />
|
||||
<EmbeddedResource Include="Resources\ok.png" />
|
||||
<EmbeddedResource Include="Resources\pjy.png" />
|
||||
<EmbeddedResource Include="Resources\Resp.png" />
|
||||
<EmbeddedResource Include="Resources\rssj.png" />
|
||||
<EmbeddedResource Include="Resources\sb.png" />
|
||||
<EmbeddedResource Include="Resources\sb2.png" />
|
||||
<EmbeddedResource Include="Resources\sb3.png" />
|
||||
<EmbeddedResource Include="Resources\SPO2.png" />
|
||||
<EmbeddedResource Include="Resources\SPO2f.png" />
|
||||
<EmbeddedResource Include="Resources\ss.png" />
|
||||
<EmbeddedResource Include="Resources\ss1.png" />
|
||||
<EmbeddedResource Include="Resources\ssjs.png" />
|
||||
<EmbeddedResource Include="Resources\ssks.png" />
|
||||
<EmbeddedResource Include="Resources\sy.png" />
|
||||
<EmbeddedResource Include="Resources\sy2.png" />
|
||||
<EmbeddedResource Include="Resources\sy3.png" />
|
||||
<EmbeddedResource Include="Resources\Sys.png" />
|
||||
<EmbeddedResource Include="Resources\T.png" />
|
||||
<EmbeddedResource Include="Resources\t1.png" />
|
||||
<EmbeddedResource Include="Resources\Temp.png" />
|
||||
<EmbeddedResource Include="Resources\Temp2.png" />
|
||||
<EmbeddedResource Include="Resources\Triangle.png" />
|
||||
<EmbeddedResource Include="Resources\TriangleDown.png" />
|
||||
<EmbeddedResource Include="Resources\xl.png" />
|
||||
<EmbeddedResource Include="Resources\zg.png" />
|
||||
<EmbeddedResource Include="Resources\zy.png" />
|
||||
|
||||
@ -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<string> GetNode(string nodeName)
|
||||
{
|
||||
List<string> result;
|
||||
try
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
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<string> GetNode(string path, string nodeName)
|
||||
{
|
||||
List<string> result;
|
||||
try
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
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<KeyValuePair<string, string>> GetNodePair(string path, string nodeName, string nodeName2)
|
||||
{
|
||||
List<KeyValuePair<string, string>> result;
|
||||
try
|
||||
{
|
||||
List<KeyValuePair<string, string>> list = new List<KeyValuePair<string, string>>();
|
||||
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<string, string>(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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
/// <summary>
|
||||
/// 在Zedgraph上绘图
|
||||
/// </summary>
|
||||
/// <param name="imgObj">已定义好的ImageObj对象</param>
|
||||
/// <param name="zedGraph">ZedGraphControl</param>
|
||||
public static void DrawImage(ImageObj imgObj, ZedGraphControl zedGraph)
|
||||
{
|
||||
zedGraph.MasterPane.GraphObjList.Add(imgObj);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据自定义好的TextObj绘制文字
|
||||
/// </summary>
|
||||
/// <param name="text">已定义的TextObj</param>
|
||||
/// <param name="zedGraph">ZedGraphControl</param>
|
||||
public static void DrawText(TextObj text, ZedGraphControl zedGraph)
|
||||
{
|
||||
zedGraph.MasterPane.GraphObjList.Add(text);
|
||||
}
|
||||
/// <summary>
|
||||
/// 绘制矩形
|
||||
/// </summary>
|
||||
/// <param name="box">已定义的BoxObj对象</param>
|
||||
/// <param name="zedGraph">ZedGraphControl</param>
|
||||
public static void DrawBox(BoxObj box, ZedGraphControl zedGraph)
|
||||
{
|
||||
zedGraph.MasterPane.GraphObjList.Add(box);
|
||||
}
|
||||
/// <summary>
|
||||
/// 画出带标签的线
|
||||
/// </summary>
|
||||
/// <param name="x1">起点X坐标</param>
|
||||
/// <param name="y1">起点Y坐标</param>
|
||||
/// <param name="x2">终点X坐标</param>
|
||||
/// <param name="y2">终点Y坐标</param>
|
||||
/// <param name="zedGraph">ZedGraphControl</param>
|
||||
/// <param name="tag">线标签</param>
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取TextObj字体的相对宽度
|
||||
/// </summary>
|
||||
/// <param name="text"></param>
|
||||
/// <param name="zgc"></param>
|
||||
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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取TextObj字体的相对高度
|
||||
/// </summary>
|
||||
/// <param name="oTxt"></param>
|
||||
/// <param name="baseZed"></param>
|
||||
/// <returns></returns>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -18,6 +18,9 @@ namespace DrawGraph
|
||||
/// </summary>
|
||||
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);
|
||||
|
||||
/// <summary>
|
||||
/// 在ZedGraphControl上添加文字,默认使用宋体9号黑色字体
|
||||
/// </summary>
|
||||
@ -38,26 +41,6 @@ namespace DrawGraph
|
||||
text.Tag = tag;
|
||||
zedGraph.MasterPane.GraphObjList.Add(text);
|
||||
}
|
||||
/// <summary>
|
||||
/// 在ZedGraphControl上添加文字,默认使用宋体9号黑色字体
|
||||
/// </summary>
|
||||
/// <param name="letter">要绘出的文字</param>
|
||||
/// <param name="x">绘制文字的左上起始点x坐标</param>
|
||||
/// <param name="y">绘制文字的左上起始点y坐标</param>
|
||||
/// <param name="zedGraph">ZedGraphControl</param>
|
||||
/// <param name="tag">控件的标签名</param>
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 在ZedGraphControl Chart上添加文字,默认使用宋体5号黑色字体
|
||||
/// </summary>
|
||||
@ -136,11 +118,76 @@ namespace DrawGraph
|
||||
text.Tag = tag;
|
||||
zedGraph.MasterPane.GraphObjList.Add(text);
|
||||
}
|
||||
/// <summary>
|
||||
/// 在ZedGraphControl上添加文字,默认使用宋体9号黑色字体
|
||||
/// </summary>
|
||||
/// <param name="letter">要绘出的文字</param>
|
||||
/// <param name="x">绘制文字的左上起始点x坐标</param>
|
||||
/// <param name="y">绘制文字的左上起始点y坐标</param>
|
||||
/// <param name="zedGraph">ZedGraphControl</param>
|
||||
/// <param name="tag">控件的标签名</param>
|
||||
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);
|
||||
}
|
||||
/// <summary>
|
||||
/// 画出带标签的线
|
||||
/// </summary>
|
||||
/// <param name="x1">起点X坐标</param>
|
||||
/// <param name="y1">起点Y坐标</param>
|
||||
/// <param name="x2">终点X坐标</param>
|
||||
/// <param name="y2">终点Y坐标</param>
|
||||
/// <param name="zedGraph">ZedGraphControl</param>
|
||||
/// <param name="tag">线标签</param>
|
||||
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);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@ -270,6 +318,53 @@ namespace DrawGraph
|
||||
zedGraph.MasterPane.GraphObjList.Add(imgObj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 在Zedgraph上绘图
|
||||
/// </summary>
|
||||
/// <param name="imgObj">已定义好的ImageObj对象</param>
|
||||
/// <param name="zedGraph">ZedGraphControl</param>
|
||||
public static void DrawImage(ImageObj imgObj, ZedGraphControl zedGraph)
|
||||
{
|
||||
zedGraph.MasterPane.GraphObjList.Add(imgObj);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据自定义好的TextObj绘制文字
|
||||
/// </summary>
|
||||
/// <param name="text">已定义的TextObj</param>
|
||||
/// <param name="zedGraph">ZedGraphControl</param>
|
||||
public static void DrawText(TextObj text, ZedGraphControl zedGraph)
|
||||
{
|
||||
zedGraph.MasterPane.GraphObjList.Add(text);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取TextObj字体的相对宽度
|
||||
/// </summary>
|
||||
/// <param name="text"></param>
|
||||
/// <param name="zgc"></param>
|
||||
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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取TextObj字体的相对高度
|
||||
/// </summary>
|
||||
/// <param name="oTxt"></param>
|
||||
/// <param name="baseZed"></param>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 绘制矩形
|
||||
/// </summary>
|
||||
|
||||
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 252 B |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 416 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 369 B |