1074 lines
		
	
	
		
			45 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			1074 lines
		
	
	
		
			45 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using HelperDB;
 | ||
| using Newtonsoft.Json;
 | ||
| using AIMSExtension;
 | ||
| using System;
 | ||
| using System.Collections.Generic;
 | ||
| using System.Data;
 | ||
| using System.Drawing;
 | ||
| using System.Linq;
 | ||
| using System.Text;
 | ||
| using System.Windows.Forms;
 | ||
| 
 | ||
| 
 | ||
| namespace DrawGraph
 | ||
| {
 | ||
|     [Serializable, JsonObject(MemberSerialization.OptOut)]
 | ||
|     public class PhysioDataManage : AreaManageBase
 | ||
|     {
 | ||
|         /// <summary>
 | ||
|         /// 监测文本的对象
 | ||
|         /// </summary>
 | ||
|         TextPackObj janCePack = null;
 | ||
|         /// <summary>
 | ||
|         /// 图表的对象
 | ||
|         /// </summary>
 | ||
|         ChartPackObj chartPack = null;
 | ||
|         /// <summary>
 | ||
|         /// 当前图例文本
 | ||
|         /// </summary>
 | ||
|         //string curLegend = "";
 | ||
|         /// <summary>
 | ||
|         /// 当前选中的,手术生理曲线
 | ||
|         /// </summary>
 | ||
|         private PhysioDataConfig curPhysioParam = null;
 | ||
|         /// <summary>
 | ||
|         /// 当前选中的生命体征对象 临时
 | ||
|         /// </summary>
 | ||
|         private PhysioData curPhysioData = null;
 | ||
|         /// <summary>
 | ||
|         /// 当前选中的生命体征对象 未改变前
 | ||
|         /// </summary>
 | ||
|         private PhysioData oldCurPhysioData = null;
 | ||
|         /// <summary>
 | ||
|         /// 悬浮选中的生命体征
 | ||
|         /// </summary>
 | ||
|         private PhysioData selPhysioData = null;
 | ||
|         /// <summary>
 | ||
|         /// 选中点点坐标是否处在可编辑状态
 | ||
|         /// </summary>
 | ||
|         //private bool isEdit = false;
 | ||
|         /// <summary>
 | ||
|         /// 当前手术对象
 | ||
|         /// </summary>
 | ||
|         private OperationRecord myOpeRecord = null;
 | ||
|         /// <summary>
 | ||
|         /// 单例悬浮显示 公用
 | ||
|         /// </summary>
 | ||
|         private TipBox aSyncTip = null;
 | ||
| 
 | ||
| 
 | ||
|         #region 初始化生命体征区域
 | ||
|         public PhysioDataManage()
 | ||
|         {
 | ||
|             init();
 | ||
|         }
 | ||
|         public PhysioDataManage(object _operationRecor, DrawGraph.ZedGraphControl _zedControl, TemplateManage _template, string _name) : base(_operationRecor, _zedControl, _template, _name)
 | ||
|         {
 | ||
|             init();
 | ||
|         }
 | ||
| 
 | ||
|         public void init()
 | ||
|         {
 | ||
|             //监测文本的对象
 | ||
|             janCePack = GetPackObjectOTag("PhysioDataManage_TextPackObj_17") as TextPackObj;
 | ||
|             //图表的对象
 | ||
|             chartPack = GetPackObjectOTag("PhysioDataManage_ChartPackObj_6") as ChartPackObj;
 | ||
|             //自己要用的手术对象
 | ||
|             myOpeRecord = OpeRecord as OperationRecord;
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// 初始画的前置方法
 | ||
|         /// </summary>
 | ||
|         public override void PrepositiveMethod()
 | ||
|         {
 | ||
|             //在这里可以初始化时间軕
 | ||
|             List<PackObjBase> AxisList = PackManage.ListPob.Where<PackObjBase>(s => s is XhAxisPackObj || s is Xd2AxisPackObj).ToList<PackObjBase>();
 | ||
|             foreach (PackObjBase pack in AxisList)
 | ||
|             {
 | ||
|                 AkxisPackObj axis = pack as AkxisPackObj;
 | ||
|                 if (axis != null)
 | ||
|                 {
 | ||
|                     DateTime dt = DateTime.Now.AddMinutes(-DateTime.Now.Minute).AddMinutes(15).AddSeconds(-DateTime.Now.Second).AddMilliseconds(-DateTime.Now.Millisecond);
 | ||
|                     axis.BeginTime = dt; //这是错误的显示时会加1分钟
 | ||
|                 }
 | ||
|             }
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// 初始画的后置方法
 | ||
|         /// </summary>
 | ||
|         public override void FollowUpMethod()
 | ||
|         {
 | ||
|             init();
 | ||
|             initLegend(ZedControl.GraphPane);
 | ||
|             initChart(ZedControl.GraphPane);
 | ||
|         }
 | ||
| 
 | ||
|         public override void clearSelectCouve_Click()
 | ||
|         {
 | ||
|             if (curPhysioParam != null && curPhysioParam.IsClick == true)
 | ||
|             {
 | ||
|                 System.Windows.Forms.DialogResult dr = System.Windows.Forms.MessageBox.Show("你确定要删除当前曲线的所有生理数据吗?", "保存修改", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Information);
 | ||
|                 if (dr == System.Windows.Forms.DialogResult.Yes)
 | ||
|                 {
 | ||
|                     if (curPhysioParam.showStyle == "显示数值")
 | ||
|                     {
 | ||
|                         foreach (PointPair pp in curPhysioParam.APhysioParams)
 | ||
|                         {
 | ||
|                             PhysioData pd = curPhysioParam.PointPairToPhysioData(pp);
 | ||
|                             if (pd != null)
 | ||
|                                 curPhysioParam.delAddObj(pd);
 | ||
|                         }
 | ||
|                     }
 | ||
|                     foreach (PointPair pp in curPhysioParam.APhysioParams)
 | ||
|                     {
 | ||
|                         PhysioData pd = curPhysioParam.PointPairToPhysioData(pp);
 | ||
|                         if (pd != null && pd.Value == curPhysioParam.HighLimit)
 | ||
|                             curPhysioParam.delAddObj(pd);
 | ||
|                     }
 | ||
| 
 | ||
|                     curPhysioParam.DelItems(myOpeRecord.pageBegin, myOpeRecord.lastPageBegin);
 | ||
|                     curPhysioParam.clearAddObj(ZedControl);
 | ||
|                     ZedControl.Refresh();
 | ||
|                 }
 | ||
|             }
 | ||
|             else
 | ||
|             {
 | ||
|                 //PublicMethod.ShowMessage("删除曲线前请先选中曲线!");
 | ||
|             }
 | ||
|         }
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region 重写的事件
 | ||
|         /// <summary>
 | ||
|         /// 鼠标点击画板
 | ||
|         /// </summary>
 | ||
|         /// <param name="sender"></param>
 | ||
|         /// <param name="e"></param>
 | ||
|         public override void MouseDown(ZedGraphControl sender, MouseEventArgs e)
 | ||
|         {
 | ||
|             //if ((OpeRecord != null && status == DoOpeStatus.BEGINOPE) || IsReview)
 | ||
|             if (myOpeRecord != null)
 | ||
|             {
 | ||
|                 //清空选中框
 | ||
|                 myOpeRecord.SAreaObj.setAnasArr(ZedControl, chartPack.RealX, chartPack.RealEndX, myOpeRecord.pageBegin,
 | ||
|                     myOpeRecord.pageBegin.AddMinutes(EVERY_PAGE_TIME_SPAN));
 | ||
|                 myOpeRecord.SAreaObj.Clear();
 | ||
| 
 | ||
|                 //触发可编辑区域的事件
 | ||
|                 double y = Convert.ToDouble(Convert.ToDouble(e.Y) / Convert.ToDouble(ZedControl.Height));
 | ||
|                 double x = Convert.ToDouble(Convert.ToDouble(e.X) / Convert.ToDouble(ZedControl.Width));
 | ||
|                 ZedGraphControl sender1 = sender as ZedGraphControl;
 | ||
| 
 | ||
|                 PointF mousePt = new PointF(e.X, e.Y);
 | ||
|                 GraphPane pane = sender1.MasterPane.FindChartRect(mousePt);
 | ||
|                 //如果在图例范围内
 | ||
|                 if (isLegendArea(sender1, mousePt))
 | ||
|                 {
 | ||
|                     //取得点击位置图例的中文
 | ||
|                     PhysioDataConfig appTemp = reClickParamName(sender1, mousePt);
 | ||
|                     if (appTemp != null)
 | ||
|                     {
 | ||
|                         if (curPhysioParam == null)
 | ||
|                         {
 | ||
|                             appTemp.IsClick = true;
 | ||
|                             curPhysioParam = appTemp;
 | ||
|                             curPhysioParam.PatientId = myOpeRecord.Id.Value;
 | ||
|                             curPhysioParam.onClick(e);
 | ||
|                         }
 | ||
|                         else
 | ||
|                         {
 | ||
|                             if (curPhysioParam.Name == appTemp.Name)
 | ||
|                             {
 | ||
|                                 curPhysioParam.IsClick = false;
 | ||
|                                 curPhysioParam.onClick(e);
 | ||
|                                 curPhysioParam = null;
 | ||
|                             }
 | ||
|                             else
 | ||
|                             {
 | ||
|                                 curPhysioParam.IsClick = false;
 | ||
|                                 curPhysioParam.onClick(e);
 | ||
|                                 appTemp.IsClick = true;
 | ||
|                                 curPhysioParam = appTemp;
 | ||
|                             curPhysioParam.PatientId = myOpeRecord.Id.Value;
 | ||
|                                 curPhysioParam.onClick(e);
 | ||
|                             }
 | ||
|                         }
 | ||
|                     }
 | ||
|                 }
 | ||
|                 //如果点击在麻醉单子范围内
 | ||
|                 if (pane != null)
 | ||
|                 {
 | ||
|                     if (curPhysioParam != null && curPhysioParam.IsClick)
 | ||
|                     {
 | ||
|                         //如果曲线被选中则进行点的操作,反之选中所有点的集合在子范围内画选中框
 | ||
|                         bool isHave = false;
 | ||
| 
 | ||
|                         PhysioData pdTemp = rePD(sender, e);
 | ||
|                         if (pdTemp == null) return;
 | ||
| 
 | ||
|                         foreach (PointPair pp in curPhysioParam.APhysioParams)
 | ||
|                         {
 | ||
|                             curPhysioData = curPhysioParam.PointPairToPhysioData(pp);
 | ||
|                             if (pdTemp.isEquert(curPhysioParam.PointPairToPhysioData(pp)) && curPhysioParam.PointPairToPhysioData(pp).Value != Double.MaxValue)
 | ||
|                             {
 | ||
|                                 isHave = true;
 | ||
|                                 if (AnesOpeStatue == DoAnesOpeStatus.VIEW)
 | ||
|                                 {
 | ||
|                                     curPhysioParam.PointPairToPhysioData(pp).IsClick = true;
 | ||
|                                     curPhysioParam.CurPDIndex = curPhysioParam.indexOf(curPhysioData);
 | ||
|                                     oldCurPhysioData = curPhysioParam.PointPairToPhysioData(pp);
 | ||
| 
 | ||
|                                     //curPhysioParam.delAddObj(oldCurPhysioData);
 | ||
|                                     AnesOpeStatue = DoAnesOpeStatus.MOVEPD;
 | ||
|                                     break;
 | ||
|                                 }
 | ||
|                             }
 | ||
|                         }
 | ||
|                         if (!isHave)
 | ||
|                         {
 | ||
|                             AnesOpeStatue = DoAnesOpeStatus.ADDPD;
 | ||
|                             DateTime insTime = GetRecordTime(DateTime.Parse(pdTemp.RecordTime.ToString("yyyy-MM-dd HH:mm:00.000")));
 | ||
| 
 | ||
|                             curPhysioParam.AddMultipleItem(pdTemp, insTime, collectInterval);
 | ||
|                             AnesOpeStatue = DoAnesOpeStatus.VIEW;
 | ||
|                             //curPhysioParam.AddItem(pdTemp);
 | ||
|                         }
 | ||
|                     }//选中范围设置开始点
 | ||
|                     else
 | ||
|                     {
 | ||
|                         if (AnesOpeStatue == DoAnesOpeStatus.VIEW)
 | ||
|                         {
 | ||
|                             PhysioData pdTemp = rePD(sender, e);
 | ||
|                             if (pdTemp == null) return;
 | ||
|                             AnesOpeStatue = DoAnesOpeStatus.SelectArea;
 | ||
|                             myOpeRecord.SAreaObj.StartPD = pdTemp;
 | ||
|                             myOpeRecord.SAreaObj.StartPDs = rePDs(sender, e);
 | ||
|                         }
 | ||
|                     }
 | ||
|                 }
 | ||
| 
 | ||
|                 //获得指定Tag和指定类型的组件
 | ||
|                 List<PackObjBase> packs = PackManage.ListPob.Where<PackObjBase>(s => s.PackTag == "Operation_AddListEvent" && s is LinesPackObj).ToList<PackObjBase>();
 | ||
|                 foreach (PackObjBase pack in packs)
 | ||
|                 {
 | ||
|                     LinesPackObj linesPack = pack as LinesPackObj;
 | ||
|                     if ((x > linesPack.RealX && x < linesPack.RealEndX) && (y > linesPack.RealY && y < linesPack.RealEndY))
 | ||
|                     {
 | ||
|                         string viewStr = string.Format("PhysioDataManage的MouseDown事件显示的内容:{0}组件,X={1}、Y={2}", pack.PackTag, linesPack.RealX, linesPack.RealY);
 | ||
|                         MessageBox.Show(viewStr);
 | ||
|                     }
 | ||
|                 }
 | ||
|             }
 | ||
|             ZedControl.AxisChange();
 | ||
|             ZedControl.Refresh();
 | ||
|         }
 | ||
|         public override void MouseMove(ZedGraphControl sender, MouseEventArgs e)
 | ||
|         {
 | ||
|             double x = Convert.ToDouble(Convert.ToDouble(e.X) / Convert.ToDouble(sender.Width));
 | ||
|             double y = Convert.ToDouble(Convert.ToDouble(e.Y) / Convert.ToDouble(sender.Height));
 | ||
|             double yP = 18 / Convert.ToDouble(sender.Height);
 | ||
|             string viewStr = "";
 | ||
|             PointF mousePt = new PointF(e.X, e.Y);
 | ||
|             GraphPane pane = sender.MasterPane.FindChartRect(mousePt);
 | ||
|             if (pane != null && aSyncTip != null)
 | ||
|             {
 | ||
|                 List<PhysioData> pdNew = rePDs(sender, e);
 | ||
| 
 | ||
|                 if (pdNew != null && myOpeRecord != null)
 | ||
|                 {
 | ||
|                     PhysioData pdTrue = null;
 | ||
|                     foreach (var item in pdNew)
 | ||
|                     {
 | ||
|                         pdTrue = GetPDOfPhysioParams(item);
 | ||
|                         if (pdTrue != null)
 | ||
|                         {
 | ||
|                             string Name = pdTrue.ppter.Name;
 | ||
|                             if (pdTrue.ppter.Unit != null && pdTrue.ppter.Unit != "") Name += "(" + pdTrue.ppter.Unit + ")";
 | ||
|                             viewStr = Name + ":" + ((float)pdTrue.Value).ToString() + "\n时间:" + pdTrue.RecordTime.ToShortTimeString();
 | ||
|                             break;
 | ||
|                         }
 | ||
|                     }
 | ||
|                     if (viewStr == "" && pdNew.Count > 0)
 | ||
|                     {
 | ||
|                         viewStr = "值:" + Math.Round(pdNew[0].Value, 1).ToString() + "\n时间:" + pdNew[0].RecordTime.ToShortTimeString();
 | ||
|                     }
 | ||
|                 }
 | ||
|                 aSyncTip.ViewStr = viewStr;
 | ||
|                 aSyncTip.Show(x, (y + yP));
 | ||
|             }
 | ||
| 
 | ||
|             switch (AnesOpeStatue)
 | ||
|             {
 | ||
|                 case DoAnesOpeStatus.MOVEPD:
 | ||
|                     if (curPhysioParam != null && curPhysioParam.CurPDIndex != -1)
 | ||
|                     {
 | ||
|                         try
 | ||
|                         {
 | ||
|                             PhysioData pdNew = rePD(sender, e);
 | ||
|                             if (pdNew == null) return;
 | ||
| 
 | ||
|                             int countSim = 0;
 | ||
|                             foreach (PointPair pp in curPhysioParam.APhysioParams)
 | ||
|                             {
 | ||
|                                 PhysioData ppd = curPhysioParam.PointPairToPhysioData(pp);
 | ||
|                                 if (pdNew.isEquert(ppd))
 | ||
|                                 {
 | ||
|                                     countSim++;
 | ||
|                                     break;
 | ||
|                                 }
 | ||
|                             }
 | ||
|                             if (countSim < 2)
 | ||
|                             {
 | ||
|                                 curPhysioParam.onlyModItem(pdNew, oldCurPhysioData);
 | ||
|                             }
 | ||
|                             else
 | ||
|                             {
 | ||
|                                 curPhysioParam.onlyModItem(oldCurPhysioData, oldCurPhysioData);
 | ||
|                                 AnesOpeStatue = DoAnesOpeStatus.VIEW;
 | ||
| 
 | ||
|                                 ZedControl.AxisChange();
 | ||
|                                 ZedControl.Refresh();
 | ||
|                                 return;
 | ||
|                             }
 | ||
|                         }
 | ||
|                         catch
 | ||
|                         {
 | ||
|                             return;
 | ||
|                         }
 | ||
|                     }
 | ||
|                     break;
 | ||
|                 case DoAnesOpeStatus.SelectArea:
 | ||
|                     try
 | ||
|                     {
 | ||
|                         PhysioData pdNew = rePD(sender, e);
 | ||
|                         if (pdNew == null) return;
 | ||
|                         if (AnesOpeStatue == DoAnesOpeStatus.SelectArea)
 | ||
|                         {
 | ||
|                             myOpeRecord.SAreaObj.EndPd = pdNew;
 | ||
|                             myOpeRecord.SAreaObj.EndPds = rePDs(sender, e);
 | ||
|                             myOpeRecord.SAreaObj.Draw();
 | ||
|                         }
 | ||
| 
 | ||
|                     }
 | ||
|                     catch { return; }
 | ||
|                     finally
 | ||
|                     {
 | ||
|                         ZedControl.AxisChange();
 | ||
|                         ZedControl.Refresh();
 | ||
|                     }
 | ||
|                     break;
 | ||
|                 case DoAnesOpeStatus.VIEW:
 | ||
|                     break;
 | ||
|             }
 | ||
|             ZedControl.AxisChange();
 | ||
|             ZedControl.Refresh();
 | ||
|         }
 | ||
|         public override void MouseUp(ZedGraphControl sender, MouseEventArgs e)
 | ||
|         {
 | ||
|             if (OpeRecord == null) return;
 | ||
|             double y = Convert.ToDouble(Convert.ToDouble(e.Y) / Convert.ToDouble(ZedControl.Height));
 | ||
|             double x = Convert.ToDouble(Convert.ToDouble(e.X) / Convert.ToDouble(ZedControl.Width));
 | ||
| 
 | ||
|             if (curPhysioParam != null && curPhysioParam.IsClick == true)
 | ||
|             {
 | ||
|                 try
 | ||
|                 {
 | ||
|                     PhysioData pdNew = rePD(sender, e);
 | ||
|                     if (pdNew == null) return;
 | ||
|                     if (AnesOpeStatue == DoAnesOpeStatus.MOVEPD)
 | ||
|                     {
 | ||
|                         curPhysioParam.ModItem(oldCurPhysioData, pdNew);
 | ||
|                         curPhysioData = null;
 | ||
|                         oldCurPhysioData = null;
 | ||
|                         curPhysioParam.CurPDIndex = -1;
 | ||
|                     }
 | ||
|                 }
 | ||
|                 catch
 | ||
|                 {
 | ||
|                     AnesOpeStatue = DoAnesOpeStatus.VIEW;
 | ||
|                     return;
 | ||
| 
 | ||
|                 }
 | ||
|                 AnesOpeStatue = DoAnesOpeStatus.VIEW;
 | ||
|                 ZedControl.AxisChange();
 | ||
|                 ZedControl.Refresh();
 | ||
|             }
 | ||
|             else
 | ||
|             {
 | ||
|                 if (AnesOpeStatue == DoAnesOpeStatus.SelectArea)
 | ||
|                 {
 | ||
|                     AnesOpeStatue = DoAnesOpeStatus.VIEW;
 | ||
|                 }
 | ||
|             }
 | ||
| 
 | ||
|             return;
 | ||
|         }
 | ||
|         public override void MouseDoubleClick(ZedGraphControl sender, MouseEventArgs e)
 | ||
|         {
 | ||
|             if (myOpeRecord == null) return;//|| IsReadOnly == true
 | ||
|             //只有鼠标左键双击才有效
 | ||
|             if (e.Button == System.Windows.Forms.MouseButtons.Left && e.Clicks == 2)
 | ||
|             {
 | ||
|                 if ((AnesOpeStatue == DoAnesOpeStatus.VIEW || AnesOpeStatue == DoAnesOpeStatus.SelectArea) && curPhysioParam == null)
 | ||
|                 {
 | ||
|                     List<PhysioData> pdTemps = rePDs(sender as ZedGraphControl, e);
 | ||
|                     if (pdTemps != null)
 | ||
|                     {
 | ||
|                         foreach (var pdTemp in pdTemps)
 | ||
|                         {
 | ||
|                             PhysioData pdTrue = GetPDOfPhysioParams(pdTemp);
 | ||
|                             if (pdTrue != null)
 | ||
|                             {
 | ||
|                                 pdTrue.ppter.DelItem(pdTrue);
 | ||
|                             }
 | ||
|                         }
 | ||
|                     }
 | ||
|                 }
 | ||
|                 //if (myOpeRecord != null && AnesOpeStatue == DoAnesOpeStatus.VIEW)
 | ||
|                 //{
 | ||
|                 //    //触发可编辑区域的事件
 | ||
|                 //    double y = Convert.ToDouble(Convert.ToDouble(e.Y) / Convert.ToDouble(zgcAnaesRecord.Height));
 | ||
|                 //    double x = Convert.ToDouble(Convert.ToDouble(e.X) / Convert.ToDouble(zgcAnaesRecord.Width));
 | ||
|                 //    foreach (AddEditArea area in myOpeRecord.AddEditAreaList)
 | ||
|                 //    {
 | ||
|                 //        if ((x > area.X && x < area.X1) && (y > area.Y && y < area.Y1))
 | ||
|                 //        {
 | ||
|                 //            if (area.isDoubleClick)
 | ||
|                 //            {
 | ||
|                 //                area.onClick(e);
 | ||
|                 //                break;
 | ||
|                 //            }
 | ||
|                 //        }
 | ||
|                 //    }
 | ||
|                 //}
 | ||
|             }
 | ||
|         }
 | ||
|         public override void KeyUp(ZedGraphControl sender, KeyEventArgs e)
 | ||
|         {
 | ||
|             if (e.KeyCode == Keys.Delete)
 | ||
|             {
 | ||
|                 if (myOpeRecord != null)
 | ||
|                 {
 | ||
|                     if (AnesOpeStatue == DoAnesOpeStatus.VIEW)
 | ||
|                     {
 | ||
|                         if (myOpeRecord.SAreaObj.Selected)
 | ||
|                         {
 | ||
|                             double startValue = myOpeRecord.SAreaObj.EndPd.Value;
 | ||
|                             double endValue = myOpeRecord.SAreaObj.StartPD.Value;
 | ||
|                             foreach (var item in myOpeRecord.SAreaObj.EndPds)
 | ||
|                             {
 | ||
|                                 if (item.Value < startValue)
 | ||
|                                 {
 | ||
|                                     startValue = item.Value;
 | ||
|                                 }
 | ||
|                             }
 | ||
|                             foreach (var item in myOpeRecord.SAreaObj.StartPDs)
 | ||
|                             {
 | ||
|                                 if (item.Value > endValue)
 | ||
|                                 {
 | ||
|                                     endValue = item.Value;
 | ||
|                                 }
 | ||
|                             }
 | ||
| 
 | ||
|                             List<int> pdTemps = SelectPhysioDataByID(myOpeRecord.Id.Value,
 | ||
|                                 myOpeRecord.SAreaObj.StartPD.RecordTime,
 | ||
|                                 myOpeRecord.SAreaObj.EndPd.RecordTime,
 | ||
|                                startValue, endValue);
 | ||
| 
 | ||
|                             List<PhysioDataConfig> selparameters = new List<PhysioDataConfig>();
 | ||
|                             foreach (PhysioDataConfig addPP in myOpeRecord.addPhysioList)
 | ||
|                             {
 | ||
|                                 bool istrue = false;
 | ||
|                                 foreach (int item in pdTemps)
 | ||
|                                 {
 | ||
|                                     if (item == addPP.Id)
 | ||
|                                     {
 | ||
|                                         istrue = true;
 | ||
|                                         break;
 | ||
|                                     }
 | ||
|                                 }
 | ||
|                                 if (istrue == true)
 | ||
|                                     selparameters.Add(addPP);
 | ||
|                             }
 | ||
|                             if (selparameters.Count <= 0) return;
 | ||
| 
 | ||
|                             frmDeletePhysios frm = new frmDeletePhysios(myOpeRecord.Id.Value,
 | ||
|                                 myOpeRecord.SAreaObj.StartPD.RecordTime,
 | ||
|                                 myOpeRecord.SAreaObj.EndPd.RecordTime,
 | ||
|                                startValue, endValue);
 | ||
|                             frm.selparameters = selparameters; 
 | ||
|                             frm.FormClosed += (a, b) =>
 | ||
|                             {
 | ||
|                                 if (frm.isDelete == true)
 | ||
|                                 {
 | ||
|                                     myOpeRecord.SAreaObj.Clear();
 | ||
|                                     if (myOpeRecord.addPhysioList != null)
 | ||
|                                     {
 | ||
|                                         foreach (PhysioDataConfig item in myOpeRecord.addPhysioList)
 | ||
|                                         {
 | ||
|                                             item.clearAddObj(ZedControl);
 | ||
|                                         }
 | ||
|                                     }
 | ||
|                                     #region 画生理数据
 | ||
|                                     DrawPhysioData();
 | ||
|                                     #endregion
 | ||
|                                 }
 | ||
|                                 else
 | ||
|                                 {
 | ||
|                                     myOpeRecord.SAreaObj.Clear();
 | ||
|                                 }
 | ||
|                             };
 | ||
|                             frm.ShowDialog();
 | ||
| 
 | ||
|                         }
 | ||
|                     }
 | ||
|                 }
 | ||
|             }
 | ||
|         }
 | ||
|         #endregion 重写的事件结束
 | ||
| 
 | ||
|         #region 绑定区域数据
 | ||
|         public override void initChart()
 | ||
|         {
 | ||
|             initChart(ZedControl.GraphPane);
 | ||
|         }
 | ||
|         public override void Bind()
 | ||
|         {
 | ||
|             init();
 | ||
|             //if (myOpeRecord.addPhysioList.Count == 0)
 | ||
|             iniHashCurveList(myOpeRecord.addPhysioList);
 | ||
|             //悬浮tip初始化
 | ||
|             aSyncTip = TipBox.CreateInstance("async");
 | ||
|             aSyncTip.setAnasArr(ZedControl, chartPack.RealX, chartPack.RealEndX, myOpeRecord.pageBegin, myOpeRecord.pageBegin.AddMinutes(EVERY_PAGE_TIME_SPAN));
 | ||
| 
 | ||
|             DrawPhysioData();
 | ||
| 
 | ||
|             AbleEditPackObj ableEdit = template.GetPackObjectOTag<AbleEditPackObj>("PhysioDataManageGoodsBill_AbleEditPackObj_61myOpeRecord_AnesthesiaDoctorAssistant");
 | ||
|             if (ableEdit != null)
 | ||
|             {
 | ||
|                 ableEdit.IsVisible = false;
 | ||
|             }
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// 画生理数据
 | ||
|         /// </summary>
 | ||
|         private void DrawPhysioData()
 | ||
|         {
 | ||
|             DataTable dtPhysioData = getByOpeIDIsPhysioData(myOpeRecord.Id.Value);
 | ||
|             if (dtPhysioData.Rows.Count <= 0)
 | ||
|             {
 | ||
|                 foreach (PhysioDataConfig item in myOpeRecord.addPhysioList)
 | ||
|                 {
 | ||
|                     item.clearAddObj(ZedControl);
 | ||
|                 }
 | ||
|                 return;
 | ||
|             }
 | ||
|             if (dtPhysioData != null && dtPhysioData.Rows.Count > 0)
 | ||
|             {
 | ||
|                 foreach (PhysioDataConfig addPP in myOpeRecord.addPhysioList)
 | ||
|                 {
 | ||
|                     addPP.clearAddObj(ZedControl);
 | ||
|                     if (addPP.IsDefalultShow == false) continue;
 | ||
|                     for (int i = 0; i < dtPhysioData.Rows.Count; i++)
 | ||
|                     {
 | ||
|                         if (dtPhysioData.Rows[i]["Name"].ToString().Equals(addPP.Name.ToString()))
 | ||
|                         {
 | ||
|                             PhysioData pdTemp = new PhysioData();
 | ||
|                             pdTemp.RecordTime = DateTime.Parse(dtPhysioData.Rows[i]["RecordTime"].ToString());
 | ||
|                             pdTemp.Value = Double.Parse(dtPhysioData.Rows[i]["Value"].ToString());
 | ||
|                             pdTemp.YAisx = addPP.YAisx;
 | ||
|                             pdTemp.PhysioDataConfigId = addPP.Id;
 | ||
|                             pdTemp.PatientId = myOpeRecord.Id.Value;
 | ||
|                             addPP.AddPoition(pdTemp);
 | ||
|                         }
 | ||
|                     }
 | ||
|                 }
 | ||
|             }
 | ||
|         }
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region 初始化标题,图注和图表
 | ||
|         /// <summary>
 | ||
|         /// 定义图注释位置
 | ||
|         /// </summary>
 | ||
|         /// <param name="myPane"></param>
 | ||
|         private void initLegend(GraphPane myPane)
 | ||
|         {
 | ||
|             Legend legend = myPane.Legend;
 | ||
|             legend.IsVisible = true;
 | ||
|             legend.Position = LegendPos.Float;//定位图标位置
 | ||
|             legend.Location = new Location(janCePack.RealX, janCePack.RealEndY - 0.02, CoordType.PaneFraction);//只有当Legend的Position属性设置为Float,才可修改其位置 0.87 0.3 
 | ||
|             legend.Border.Width = 0;
 | ||
|             legend.Border.IsVisible = false;  //不显示图标外边框 
 | ||
|             legend.Gap = 2.0f;
 | ||
|             legend.IsHStack = false;
 | ||
|             legend.FontSpec.Size = 7f;
 | ||
|             legend.FontSpec.Fill.IsVisible = false;
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// 将坐标数值对加到相应的曲线上,从而初始化曲线Chart
 | ||
|         /// </summary>
 | ||
|         /// <param name="addPhysioList"></param>
 | ||
|         private void iniHashCurveList(List<PhysioDataConfig> addPhysioList)
 | ||
|         {
 | ||
|             try
 | ||
|             {
 | ||
|                 if (janCePack == null) return;
 | ||
|                 int showvalue = 0;
 | ||
|                 addPhysioList.Clear();
 | ||
|                 ZedControl.GraphPane.CurveList.Clear();
 | ||
|                 //监测区域里的第1根竖线,显示数值时用
 | ||
|                 LinePackObj pack = template.GetPackObjectOTag<LinePackObj>("MonitorManage_LinePackObj_4");
 | ||
| 
 | ||
|                 //加载生命体征图标
 | ||
|                 IList<PhysioDataConfig> dt = PhysioDataConfig.GetAllList();
 | ||
|                 int rowNum = 1;
 | ||
|                 for (int i = 0; i < dt.Count; i++)
 | ||
|                 {
 | ||
|                     PhysioDataConfig pp = dt[i];
 | ||
|                     pp.Click += new PhysioDataConfig.ClickEventHandler(pp_Click);
 | ||
|                     string[] str = pp.Color.Split('.');
 | ||
|                     int A = int.Parse(str[0].ToString());
 | ||
|                     int R = int.Parse(str[1].ToString());
 | ||
|                     int G = int.Parse(str[2].ToString());
 | ||
|                     int B = int.Parse(str[3].ToString());
 | ||
|                     pp.ConveColor = System.Drawing.Color.FromArgb(A, R, G, B);
 | ||
| 
 | ||
|                     if (pp.IsDefalultShow == false)
 | ||
|                     {
 | ||
|                         pp.showStyle = "不显示";
 | ||
|                         pp.IsValid = false;
 | ||
|                     }
 | ||
|                     else
 | ||
|                     {
 | ||
|                         if (pp.ShowImg == true)
 | ||
|                         {
 | ||
|                             pp.showStyle = "显示曲线";
 | ||
|                             pp.IsValid = true;
 | ||
|                         }
 | ||
|                         if (pp.ShowText == true)
 | ||
|                         {
 | ||
|                             pp.showStyle = "显示数值";
 | ||
|                             pp.IsValid = true;
 | ||
|                         }
 | ||
|                     }
 | ||
|                     pp.ClearTagstr(ZedControl);
 | ||
|                     //如果模板管理不为空
 | ||
|                     if (pack != null)// && pack1 == null
 | ||
|                     {
 | ||
|                         if (pp.showStyle.Equals("显示数值"))
 | ||
|                         {
 | ||
|                             double y = pack.RealY + getYPositionByListIndex(showvalue, pack.RealY, pack.RealEndY, 7);
 | ||
|                             ZUtil.DrawText(pp.Name, pack.RealX, y, ZedControl, "PP" + pp.Enname, 5.5f);
 | ||
|                             //ZUtil.DrawText(pp.Unit, pack.RealX + 0.05f, y, ZedControl, "PP" + pp.Enname, 4f);
 | ||
|                             pp.showValue = y + 0.002;
 | ||
|                             showvalue++;
 | ||
|                         }
 | ||
|                     }
 | ||
|                     DateTime DateTimeNow = DateTime.Now;
 | ||
|                     pp.setAnasArr(ZedControl, chartPack.RealX, chartPack.RealEndX, myOpeRecord.pageBegin,
 | ||
|                                         myOpeRecord.pageBegin.AddMinutes(EVERY_PAGE_TIME_SPAN));
 | ||
|                     bool isHave = false;
 | ||
|                     foreach (PhysioDataConfig appTemp in addPhysioList)
 | ||
|                     {
 | ||
|                         if (appTemp.Name.Equals(pp.Name))
 | ||
|                         {
 | ||
|                             isHave = true;
 | ||
|                         }
 | ||
|                     }
 | ||
|                     if (!isHave)
 | ||
|                     {
 | ||
|                         addPhysioList.Add(pp);
 | ||
|                         pp.draw();
 | ||
|                         pp_Click(pp, null);
 | ||
|                     }
 | ||
|                     rowNum++;
 | ||
|                 }
 | ||
|             }
 | ||
|             catch (Exception ex)
 | ||
|             {
 | ||
|                 //异常处理保存
 | ||
|                 throw ex;
 | ||
|             }
 | ||
|         }
 | ||
|         public void pp_Click(object sender, EventArgs e)
 | ||
|         {
 | ||
|             PhysioDataConfig app = (PhysioDataConfig)sender;
 | ||
|             if (app.IsClick)
 | ||
|             {
 | ||
|                 app.curve.Label.FontSpec = new FontSpec("微软雅黑", 5.9f, Color.Red, true, false, true);
 | ||
|                 app.curve.Label.FontSpec.Border.IsVisible = false;
 | ||
|                 app.curve.Label.FontSpec.Fill.IsVisible = false;
 | ||
|             }
 | ||
|             else
 | ||
|             {
 | ||
|                 app.curve.Label.FontSpec = new FontSpec("微软雅黑", 5.8f, Color.Black, false, false, false);
 | ||
|                 app.curve.Label.FontSpec.Border.IsVisible = false;
 | ||
|                 app.curve.Label.FontSpec.Fill.IsVisible = false;
 | ||
|             }
 | ||
|         }
 | ||
| 
 | ||
|         public override void frmInstance_ConfigParam()
 | ||
|         {
 | ||
|             //既然是全局变量,并且在初始化的时候已经定义过了,为什么在此还要重新定义呢?
 | ||
|             //原因:正是因为xmlOpe是全局变量,因此,在整个窗体生命周期都没有发生改变。
 | ||
|             //即在该段时间内驻留内存,及时其他窗体将其信息改变,其操作的XML内容仍然不变。
 | ||
|             //解决办法:重新定义,使XML操作对象发生变化。 
 | ||
|             int showvalue = 0;
 | ||
|             //监测区域里的第1根竖线,显示数值时用 
 | ||
|             LinePackObj pack = template.GetPackObjectOTag<LinePackObj>("MonitorManage_LinePackObj_4");
 | ||
| 
 | ||
|             foreach (var pp in myOpeRecord.addPhysioList)
 | ||
|             {
 | ||
|                 string[] str = pp.Color.Split('.');
 | ||
|                 int A = int.Parse(str[0].ToString());
 | ||
|                 int R = int.Parse(str[1].ToString());
 | ||
|                 int G = int.Parse(str[2].ToString());
 | ||
|                 int B = int.Parse(str[3].ToString());
 | ||
|                 pp.ConveColor = System.Drawing.Color.FromArgb(A, R, G, B);
 | ||
| 
 | ||
|                 if (pp.IsDefalultShow == false)
 | ||
|                 {
 | ||
|                     pp.showStyle = "不显示";
 | ||
|                     pp.IsValid = false;
 | ||
|                 }
 | ||
|                 else
 | ||
|                 {
 | ||
|                     if (pp.ShowImg == true)
 | ||
|                     {
 | ||
|                         pp.showStyle = "显示曲线";
 | ||
|                         pp.IsValid = true;
 | ||
|                     }
 | ||
|                     if (pp.ShowText == true)
 | ||
|                     {
 | ||
|                         pp.showStyle = "显示数值";
 | ||
|                         pp.IsValid = true;
 | ||
|                     }
 | ||
|                 }
 | ||
| 
 | ||
|                 pp.setAnasArr(ZedControl, chartPack.RealX, chartPack.RealEndX, myOpeRecord.pageBegin,
 | ||
|                                  myOpeRecord.pageBegin.AddMinutes(EVERY_PAGE_TIME_SPAN));
 | ||
|                 pp.ClearTagstr(ZedControl);
 | ||
|                 if (pp.showStyle.Equals("显示数值"))
 | ||
|                 {
 | ||
|                     //如果模板管理不为空
 | ||
|                     if (pack != null)
 | ||
|                     {
 | ||
|                         double y = pack.RealY + getYPositionByListIndex(showvalue, pack.RealY, pack.RealEndY, 5);
 | ||
|                         ZUtil.DrawText(pp.Name, pack.RealX, y, ZedControl, "PP" + pp.Enname, 5.5f);
 | ||
|                         pp.showValue = y + 0.002;
 | ||
|                         showvalue++;
 | ||
|                     }
 | ||
|                 }
 | ||
| 
 | ||
|                 ///重新设置曲线属性
 | ||
|                 pp.reSetCurve();
 | ||
|                 break;
 | ||
|             }
 | ||
|         }
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region 设置采集Chart区域的位置
 | ||
|         /// <summary>
 | ||
|         /// 设置采集Chart区域的位置
 | ||
|         /// </summary>
 | ||
|         /// <param name="myPane"></param>
 | ||
|         private void initChart(GraphPane myPane)
 | ||
|         {
 | ||
|             Chart chart = myPane.Chart;
 | ||
|             chart.Fill = new Fill(System.Drawing.Color.White);
 | ||
|             chart.Border.Width = 0.0f;
 | ||
|             chart.IsRectAuto = true;
 | ||
|             float cLeft = (float)(myPane.Rect.Width * chartPack.RealX);
 | ||
|             float cTop = (float)(myPane.Rect.Height * (chartPack.RealY));
 | ||
|             float cWidth = (float)(myPane.Rect.Width * (chartPack.RealEndX - chartPack.RealX));
 | ||
|             float cHeight = (float)(myPane.Rect.Height * (chartPack.RealEndY - chartPack.RealY));
 | ||
|             chart.Rect = new System.Drawing.RectangleF(cLeft, cTop, cWidth, cHeight); //设定中间的图像显示区域chart.Rect = {X = 120.0 Y = 304.5 Width = 576.0 Height = 375.55}
 | ||
| 
 | ||
|             myPane.XAxis.MajorGrid.Color = System.Drawing.Color.Black; //大跨度网格颜色
 | ||
|         }
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region 点击编辑区域后的事件方法
 | ||
|         /// <summary>
 | ||
|         /// 响应可编辑区域的点击事件
 | ||
|         /// </summary>
 | ||
|         /// <param name="sender"></param>
 | ||
|         /// <param name="e"></param>
 | ||
|         public override void editAr_Click(object sender, EventArgs e)
 | ||
|         {
 | ||
|         }
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region 当前区域公用事件方法
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// 从所有曲线里得到相应的点
 | ||
|         /// </summary>
 | ||
|         /// <param name="pdTemp">要查找的物理点</param>
 | ||
|         private PhysioData GetPDOfPhysioParams(PhysioData pdTemp)
 | ||
|         {
 | ||
|             selPhysioData = null;
 | ||
|             foreach (PhysioDataConfig ppter in myOpeRecord.addPhysioList)
 | ||
|             {
 | ||
|                 if (pdTemp.YAisx != ppter.YAisx) continue;
 | ||
|                 foreach (PointPair pp in ppter.APhysioParams)
 | ||
|                 {
 | ||
|                     selPhysioData = ppter.PointPairToPhysioData(pp);
 | ||
|                     if (pdTemp.isEquertTrue(selPhysioData, collectInterval.ToString()))
 | ||
|                     {
 | ||
|                         selPhysioData.ppter = ppter;
 | ||
|                         selPhysioData.PatientId = myOpeRecord.Id.Value;
 | ||
|                         selPhysioData.PhysioDataConfigId = ppter.Id;
 | ||
|                         return selPhysioData;
 | ||
|                     }
 | ||
|                 }
 | ||
|             }
 | ||
|             return null;
 | ||
|         }
 | ||
|         /// <summary>
 | ||
|         /// 得到生命特征泛型集合
 | ||
|         /// </summary>
 | ||
|         /// <param name="sender"></param>
 | ||
|         /// <param name="e"></param>
 | ||
|         /// <returns></returns>
 | ||
|         private List<PhysioData> rePDs(ZedGraphControl sender, MouseEventArgs e)
 | ||
|         {
 | ||
|             List<PhysioData> pdNews = new List<PhysioData>();
 | ||
|             try
 | ||
|             {
 | ||
|                 double x, x2;
 | ||
|                 double[] y;
 | ||
|                 double[] y2;
 | ||
| 
 | ||
|                 PointF mousePt = new PointF(e.X, e.Y);
 | ||
| 
 | ||
|                 ZedGraphControl sender1 = sender as ZedGraphControl;
 | ||
|                 GraphPane pane = sender1.MasterPane.FindChartRect(mousePt);
 | ||
|                 if (pane != null)
 | ||
|                 {
 | ||
|                     pane.ReverseTransform(mousePt, out x, out x2, out y, out y2);
 | ||
|                     XDate xd = new XDate(x);
 | ||
| 
 | ||
|                     PhysioData pdNew = new PhysioData();
 | ||
|                     pdNew.RecordTime = xd.DateTime;
 | ||
|                     PhysioDataConfig physioParam = null;
 | ||
|                     if (curPhysioParam == null)
 | ||
|                     {
 | ||
|                         physioParam = myOpeRecord.addPhysioList[1];
 | ||
|                     }
 | ||
|                     else
 | ||
|                     {
 | ||
|                         physioParam = curPhysioParam;
 | ||
|                     }
 | ||
|                     pdNew.Value = Math.Round(y[physioParam.YAisx], 2);
 | ||
|                     pdNew.YAisx = physioParam.YAisx;
 | ||
|                     pdNew.PhysioDataConfigId = physioParam.Id;
 | ||
|                     pdNew.PatientId = myOpeRecord.Id.Value;
 | ||
|                     pdNew.IsClick = true; 
 | ||
|                     pdNews.Add(pdNew);
 | ||
| 
 | ||
|                     if (y[1].ToString() != "")
 | ||
|                     {
 | ||
|                         PhysioData pdNewY2 = new PhysioData();
 | ||
|                         pdNewY2.RecordTime = xd.DateTime;
 | ||
|                         physioParam = myOpeRecord.addPhysioList.Where(a => a.Name == "氧饱和度").ToList()[0];
 | ||
|                         pdNewY2.Value = Math.Round(y[physioParam.YAisx], 2);
 | ||
|                         pdNewY2.YAisx = physioParam.YAisx;
 | ||
|                         pdNewY2.PhysioDataConfigId = physioParam.Id;
 | ||
|                         pdNewY2.PatientId = myOpeRecord.Id.Value;
 | ||
|                         pdNewY2.IsClick = true; 
 | ||
|                         pdNews.Add(pdNewY2);
 | ||
|                     }
 | ||
|                     if (y[0].ToString() != "")
 | ||
|                     {
 | ||
|                         PhysioData pdNewY2 = new PhysioData();
 | ||
|                         pdNewY2.RecordTime = xd.DateTime;
 | ||
|                         physioParam = myOpeRecord.addPhysioList.Where(a => a.Name == "体温").ToList()[0];
 | ||
|                         pdNewY2.Value = Math.Round(y[physioParam.YAisx], 2);
 | ||
|                         pdNewY2.YAisx = physioParam.YAisx;
 | ||
|                         pdNewY2.PhysioDataConfigId = physioParam.Id;
 | ||
|                         pdNewY2.PatientId = myOpeRecord.Id.Value;
 | ||
|                         pdNewY2.IsClick = true; 
 | ||
|                         pdNews.Add(pdNewY2);
 | ||
|                     }
 | ||
| 
 | ||
|                 }
 | ||
|                 return pdNews;
 | ||
|             }
 | ||
|             catch (Exception)
 | ||
|             {
 | ||
|                 return pdNews;
 | ||
|             }
 | ||
|         }
 | ||
|         /// <summary>
 | ||
|         /// 得到单生命特征对象
 | ||
|         /// </summary>
 | ||
|         /// <param name="sender"></param>
 | ||
|         /// <param name="e">点击鼠标事件的参数</param>
 | ||
|         /// <returns></returns>
 | ||
|         private PhysioData rePD(ZedGraphControl sender, MouseEventArgs e)
 | ||
|         {
 | ||
|             try
 | ||
|             {
 | ||
|                 if (ZedControl == null) return null;
 | ||
| 
 | ||
|                 double x, x2;
 | ||
|                 double[] y;
 | ||
|                 double[] y2;
 | ||
| 
 | ||
|                 PointF mousePt = new PointF(e.X, e.Y);
 | ||
| 
 | ||
|                 GraphPane pane = ZedControl.MasterPane.FindChartRect(mousePt);
 | ||
|                 if (pane == null) return null;
 | ||
|                 pane.ReverseTransform(mousePt, out x, out x2, out y, out y2);
 | ||
|                 XDate xd = new XDate(x);
 | ||
| 
 | ||
|                 PhysioData pdNew = new PhysioData();
 | ||
|                 pdNew.RecordTime = xd.DateTime;
 | ||
|                 PhysioDataConfig physioParam = null;
 | ||
|                 if (curPhysioParam == null)
 | ||
|                 {
 | ||
|                     physioParam = myOpeRecord.addPhysioList[1];
 | ||
|                 }
 | ||
|                 else
 | ||
|                 {
 | ||
|                     physioParam = curPhysioParam;
 | ||
|                 }
 | ||
|                 pdNew.Value = Math.Round(y[physioParam.YAisx], 2);
 | ||
|                 pdNew.PhysioDataConfigId = physioParam.Id;
 | ||
|                 pdNew.PatientId = myOpeRecord.Id.Value;
 | ||
|                 pdNew.IsClick = true;
 | ||
| 
 | ||
|                 return pdNew;
 | ||
|             }
 | ||
|             catch (Exception)
 | ||
|             {
 | ||
|                 return null;
 | ||
|             }
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// 返回控件的点击的Legend的图例文本
 | ||
|         /// </summary>
 | ||
|         /// <param name="zgc"></param>
 | ||
|         /// <param name="mousePt"></param>
 | ||
|         /// <returns></returns>
 | ||
|         private PhysioDataConfig reClickParamName(ZedGraphControl zgc, PointF mousePt)
 | ||
|         {
 | ||
|             PhysioDataConfig appTemp = null;
 | ||
|             Graphics g = zgc.CreateGraphics();
 | ||
|             GraphPane myPane = new GraphPane();
 | ||
|             object nearestObj;
 | ||
|             int ipt;
 | ||
|             zgc.MasterPane.FindNearestPaneObject(mousePt, g, out myPane, out nearestObj, out ipt);
 | ||
|             if (nearestObj is Legend)
 | ||
|             {
 | ||
|                 foreach (PhysioDataConfig Temp in myOpeRecord.addPhysioList)
 | ||
|                 {
 | ||
|                     if (myPane.CurveList[ipt].Tag.ToString().IndexOf(Temp.Name) >= 0)
 | ||
|                     {
 | ||
|                         appTemp = Temp;
 | ||
|                     }
 | ||
|                 }
 | ||
|             }
 | ||
|             return appTemp;
 | ||
|         }
 | ||
|         /// <summary>
 | ||
|         /// 点击时是否在图例范围内
 | ||
|         /// </summary>
 | ||
|         /// <param name="zgc"></param>
 | ||
|         /// <param name="mousePt"></param>
 | ||
|         /// <returns></returns>
 | ||
|         private bool isLegendArea(ZedGraphControl zgc, PointF mousePt)
 | ||
|         {
 | ||
|             Graphics g = zgc.CreateGraphics();
 | ||
|             GraphPane myPane = new GraphPane();
 | ||
|             object nearestObj;
 | ||
|             int ipt;
 | ||
|             zgc.MasterPane.FindNearestPaneObject(mousePt, g, out myPane, out nearestObj, out ipt);
 | ||
|             if (nearestObj is Legend)
 | ||
|             {
 | ||
|                 return true;
 | ||
|             }
 | ||
|             return false;
 | ||
|         }
 | ||
|         /// <summary>
 | ||
|         /// 根据顶部加药序号,确定数值生命体征的纵向位置(以1为单位)
 | ||
|         /// </summary>
 | ||
|         /// <param name="index"></param>
 | ||
|         /// <returns></returns>
 | ||
|         public double getYPositionByListIndex(double index, double yTop, double yBottom, int rowCount)
 | ||
|         {
 | ||
|             double heightT = ZedControl.Height * (yBottom - yTop);
 | ||
|             double setpTemp = heightT / rowCount;
 | ||
|             //求一格在实际高度中的百分比
 | ||
|             double bfb = (setpTemp / heightT);
 | ||
|             //两线之间度*百分比得到一格的百分比高度
 | ||
|             double ygBFB = (yBottom - yTop) * bfb;
 | ||
|             double y = ygBFB * index;
 | ||
|             return y;
 | ||
|         }
 | ||
|         #endregion
 | ||
| 
 | ||
|         public DataTable getByOpeIDIsPhysioData(int operationId)
 | ||
|         {
 | ||
|             string sqlStr = "SELECT [PhysioDataConfig].Name , PhysioData.RecordTime, PhysioData.[Value]   FROM [dbo].[PhysioDataConfig] INNER JOIN  PhysioData ON [PhysioDataConfig].Id = PhysioData.PhysioDataConfigId  where PatientId = " + operationId + " order by PhysioDataConfigId,PhysioData.RecordTime ASC";
 | ||
|             return DBHelper.GetDataTable(sqlStr);
 | ||
|         }
 | ||
|         public List<int> SelectPhysioDataByID(int operationId, DateTime startTime, DateTime endTime, double startValue, double endValue)
 | ||
|         {
 | ||
|             List<int> PhysioDatas = new List<int>();
 | ||
|             string sqlStr = "select * FROM PhysioData  where PatientId = " + operationId + " and [RecordTime] >='" + startTime + "' and  [RecordTime] <='" + endTime + "' and  [Value] >='" + startValue + "' and  [Value] <='" + endValue + "' ";
 | ||
|             DataTable dt = DBHelper.GetDataTable(sqlStr);
 | ||
|             foreach (DataRow dr in dt.Rows)
 | ||
|             {
 | ||
|                 int PhysioDataConfigId = int.Parse(dr["PhysioDataConfigId"].ToString());
 | ||
|                 if (!PhysioDatas.Contains(PhysioDataConfigId))
 | ||
|                     PhysioDatas.Add(PhysioDataConfigId);
 | ||
|             }
 | ||
|             return PhysioDatas;
 | ||
|         }
 | ||
|         public static DateTime GetRecordTime(DateTime pdTemp, int collectInterval = 5)
 | ||
|         {
 | ||
|             DateTime result = Convert.ToDateTime(pdTemp.ToString("yyyy-MM-dd HH:mm:00.000"));
 | ||
|             bool flag = collectInterval == 5;
 | ||
|             if (flag)
 | ||
|             {
 | ||
|                 double num = (double)(pdTemp.Minute % 5);
 | ||
|                 bool flag2 = num > 2.5;
 | ||
|                 if (flag2)
 | ||
|                 {
 | ||
|                     result = result.AddMinutes(5.0 - num);
 | ||
|                 }
 | ||
|                 else
 | ||
|                 {
 | ||
|                     result = result.AddMinutes(0.0 - num);
 | ||
|                 }
 | ||
|             }
 | ||
|             else
 | ||
|             {
 | ||
|                 bool flag3 = collectInterval == 10;
 | ||
|                 if (flag3)
 | ||
|                 {
 | ||
|                     double num2 = (double)(pdTemp.Minute % 10);
 | ||
|                     bool flag4 = num2 > 5.0;
 | ||
|                     if (flag4)
 | ||
|                     {
 | ||
|                         result = result.AddMinutes(10.0 - num2);
 | ||
|                     }
 | ||
|                     else
 | ||
|                     {
 | ||
|                         result = result.AddMinutes(0.0 - num2);
 | ||
|                     }
 | ||
|                 }
 | ||
|             }
 | ||
|             return result;
 | ||
|         }
 | ||
|     }
 | ||
| }
 |