AIMS/AIMSEntity/AreaManage/DrugsManage.cs
2022-08-23 21:12:59 +08:00

160 lines
5.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using DrawGraph;
using DrawGraph.AreaManage;
using DrawGraph.BoardPack;
using DrawGraph.GUtil;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace AIMS.EF
{
[Serializable, JsonObject(MemberSerialization.OptOut)]
public class DrugsManage : AreaManageBase
{
/// <summary>
/// 药品区域
/// </summary>
public RectangleFramePackObj drugPpack;
public LinePackObj H3pack;
public LinePackObj H5pack;
public LinesPackObj lines;
public int RowsCount;
/// <summary>
/// 当前手术对象
/// </summary>
private OperationRecord myOpeRecord = null;
#region
public DrugsManage()
{ init(); }
public DrugsManage(object _operationRecor, ZedGraphControl _zedControl, TemplateManage _template, string _name) : base(_operationRecor, _zedControl, _template, _name)
{ init(); }
public void init()
{
//自己要用的手术对象
myOpeRecord = OpeRecord as OperationRecord;
}
/// <summary>
/// 初始画的后置方法
/// </summary>
public override void FollowUpMethod()
{
lines = template.GetPackObjectOTag<LinesPackObj>("DrugsManage_LinesPackObj_5");
RowsCount =Convert.ToInt32(lines.XPageSpan / lines.XMajorGridStep);
H3pack = template.GetPackObjectOTag<LinePackObj>("DrugsManage_LinePackObj_6");
H5pack = template.GetPackObjectOTag<LinePackObj>("DrugsManage_LinePackObj_9");
drugPpack = template.GetPackObjectOTag<RectangleFramePackObj>("DrugsManage_RectangleFramePackObj_2");
}
#endregion
#region
/// <summary>
/// 鼠标点击画板
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public override void MouseDown(ZedGraphControl sender, MouseEventArgs e)
{
//if (e.Button == System.Windows.Forms.MouseButtons.Left)
//{
// MessageBox.Show(this.GetType().Name + "is Click Left Button");
//}
}
public override void MouseMove(ZedGraphControl sender, MouseEventArgs e)
{
}
public override void MouseUp(ZedGraphControl sender, MouseEventArgs e)
{
}
public override void MouseDoubleClick(ZedGraphControl sender, MouseEventArgs e)
{
}
public override void KeyUp(ZedGraphControl sender, KeyEventArgs e)
{
}
#endregion
#region
public override void Bind()
{
init();
DrawDrug();
}
/// <summary>
/// 画加药
/// </summary>
private void DrawDrug()
{
//try
//{
// foreach (DrugsRecord temp in myOpeRecord.DrugsRecordList)
// {
// if (!isSapDrugs(temp))
// {
// temp.clearAddObj(ZedControl);
// }
// }
// reDrawDrug();
//}
//catch (Exception exp)
//{
// PublicMethod.WriteLog(exp);
//}
}
#endregion
#region
private bool IfInTimeExist(DateTime Begin, DateTime End)
{
DateTime lastime = myOpeRecord.lastPageBegin.AddSeconds(59);
bool b = false;
if (End == null)
{
if (Begin > myOpeRecord.pageBegin && Begin < lastime)
{
b = true;
}
}
else
{
if (Begin >= myOpeRecord.pageBegin && Begin <= lastime)
{
b = true;
}
else if (End >= myOpeRecord.pageBegin && End <= lastime)
{
b = true;
}
else if (Begin < myOpeRecord.pageBegin && End > lastime)
{
b = true;
}
}
return b;
}
/// <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
}
}