static void initMaze() { foreach (CartPoint c in Barriers) { LabPoint l = Laby[c.x, c.y]; if (l == null) { l = new LabPoint(); } l.barrier = true; Laby[c.x, c.y] = l; } foreach (TreasurePoint t in Treasures) { LabPoint l = Laby[t.x, t.y]; if (l == null) { l = new LabPoint(); } if (l.barrier) { Console.WriteLine("ERROR: " + t.x + "," + t.y + " is barrier and has treasure !"); } l.treasure = t._treasure; Laby[t.x, t.y] = l; } }
static Boolean isValidAndUnvisited(CartPoint pos) { if ((pos.x >= Laby.GetLength(0)) || (pos.x < 0) || (pos.y >= Laby.GetLength(1)) || (pos.y < 0)) { return(false); } LabPoint l = Laby[pos.x, pos.y]; if (l == null) { l = new LabPoint(); } if (l.barrier) { return(false); } if (l.visited) { return(false); } else { l.visited = true; Laby[pos.x, pos.y] = l; return(true); } }
public List <Reportlab> getCiRptlabAggDO(string idpat, int num, CiRptLabItmDO[] itms) { // todo 修改成 检查的 id //return service.findById(id_lab); if (itms == null || itms.Length == 0) { return(null); } string[] srvs = itms.Select(p => p.Id_srv).ToArray(); LabDTO[] labs = qryservice.getLabItms(idpat, num, srvs); if (labs.Count() == 0) { this.ShowAlert("没有符合要求的数据"); return(null); } var lablist = new List <Reportlab>(); int i = 0; foreach (CiRptLabItmDO s2 in itms) { if (s2.Sd_restrptlabtp != "0") { continue; } var lab = new Reportlab(); lab.Name = s2.Name_srv; lab.YUnit = s2.Unit_name; i++; foreach (LabDTO ldo in labs) { if (ldo.Val_rstrptlab == null) { continue; } if (s2.Id_srv.Equals(ldo.Id_srv)) { var p = new LabPoint(); p.Xvalue = ldo.Dt_rptlab; p.Yvalue = Double.Parse(ldo.Val_rstrptlab); p.FlagException = false; lab.AddPoint(p); } } lablist.Add(lab); if (i == 5) { break; } } if (lablist.Count == 0 || lablist.Count < itms.Count()) { this.ShowAlert("结果值的类型不是数值"); return(null); } return(lablist); }
static void collectTreasure(CartPoint pos) { LabPoint l = Laby[pos.x, pos.y]; if (!l.treasure.Equals(' ')) { Console.WriteLine(" Found treasure : " + l.treasure); treasuresFound += l.treasure; l.treasure = ' '; // remove treasure :D } Laby[pos.x, pos.y] = l; }
void xapFormControl1_FormCreated() { string time = cof.GetSystemDateTime().AddDays(-1).ToShortDateString(); //string time = new DateTime().AddDays(-1).ToShortDateString(); //List<LabPoint> pointList=new List<LabPoint>(); //LabPoint point=new LabPoint(); //point.Xvalue #region 第一条折线数据 List <LabPoint> list = new List <LabPoint>(); LabPoint r = new LabPoint(); r.Xvalue = new FDateTime(time + " 03:00:00"); r.Yvalue = 6.0; r.FlagException = true; list.Add(r); LabPoint r1 = new LabPoint(); r1.Xvalue = new FDateTime(time + " 07:30:00"); r1.Yvalue = 5.5; list.Add(r1); LabPoint r2 = new LabPoint(); r2.Xvalue = new FDateTime(time + " 10:00:00"); r2.Yvalue = 8.5; r2.FlagException = true; list.Add(r2); LabPoint r3 = new LabPoint(); r3.Xvalue = new FDateTime(time + " 11:30:00"); r3.Yvalue = 6.1; list.Add(r3); LabPoint r4 = new LabPoint(); r4.Xvalue = new FDateTime(time + " 14:00:00"); r4.Yvalue = 9.5; r4.FlagException = true; list.Add(r4); LabPoint r5 = new LabPoint(); r5.Xvalue = new FDateTime(time + " 17:30:00"); r5.Yvalue = 5.7; list.Add(r5); LabPoint r6 = new LabPoint(); r6.Xvalue = new FDateTime(time + " 20:00:00"); r6.Yvalue = 8.5; r6.FlagException = true; list.Add(r6); LabPoint r7 = new LabPoint(); r7.Xvalue = new FDateTime(time + " 23:00:00"); r7.Yvalue = 6.7; list.Add(r7); #endregion #region 第二条折线数据 List <LabPoint> list1 = new List <LabPoint>(); LabPoint y = new LabPoint(); //r.XName = "一"; y.Xvalue = new FDateTime(time + " 07:55:00"); y.Yvalue = 12; list1.Add(y); LabPoint y1 = new LabPoint(); y1.Xvalue = new FDateTime(time + " 11:50:00"); y1.Yvalue = 6; list1.Add(y1); LabPoint y2 = new LabPoint(); y2.Xvalue = new FDateTime(time + " 17:55:00"); y2.Yvalue = 10; list1.Add(y2); //LabPoint y3 = new LabPoint(); //r7.Xvalue = new FDateTime("2016-12-18 14:47:08"); //r7.Yvalue = 300; //list1.Add(y3); #endregion #region 第一条折线 List <Reportlab> listReList = new List <Reportlab>(); Reportlab cc1 = new Reportlab(); cc1.points = list; //点的集合 cc1.YUnit = "mmlo/L"; cc1.XUnit = "时间"; cc1.Name = "血糖"; listReList.Add(cc1); #endregion #region 第二条折线 Reportlab cc2 = new Reportlab(); cc2.points = list1; cc2.YUnit = "U"; cc2.XUnit = "时间"; cc2.Name = "胰岛素"; listReList.Add(cc2); #endregion lineChart.DataSource = listReList; lineChart.DefaultSelectLine = 0; }