public int NewPatientRegister(DTO.PatientInfo pInfo) { try { var zybr = new ZYBR(); var ry = new RY(); var basy = new BASY(); using (DCCbhisDataContext db = new DCCbhisDataContext(GSettings.HisConnStr)) { zybr.ZYH = MakeZyh(); PInfoToEntitys(pInfo, zybr, ry, basy); db.ZYBR.InsertOnSubmit(zybr); db.RY.InsertOnSubmit(ry); db.BASY.InsertOnSubmit(basy); db.SubmitChanges(); } return(zybr.ZYH); } catch (System.Exception ex) { throw new ArgumentException("His入院登记错误:" + ex.Message); } }
private static void PInfoToEntitys(DTO.PatientInfo pInfo, ZYBR zybr, RY ry, BASY basy) { zybr.ZYH = pInfo.HisZyh.Value; zybr.MZDM = (short)pInfo.HisNationCode; zybr.BAH = pInfo.HisZyh.Value; zybr.BRXM = pInfo.Name; zybr.XB = pInfo.Sex; zybr.CSRQ = pInfo.BirthDay; zybr.HYZK = pInfo.Marray; zybr.GJ = "中国"; zybr.SFZH = pInfo.PSN; zybr.mzks = (short)pInfo.oMzDoctor.bm.bmdm; zybr.NL = pInfo.Age; zybr.JSDW = pInfo.AgeUnit; ry.ZYH = pInfo.HisZyh.Value; ry.RYH = pInfo.HisRyh.Value; ry.RYKS = (short)pInfo.oZyDoctor.bm.bmdm; ry.ZYBRLX = (Byte)pInfo.HisZybrlx; ry.RYRQ = pInfo.Ryrq.Value; ry.RYQKDM = 1; ry.YS = (short)pInfo.oZyDoctor.zgdm; ry.CZY = GSettings.OperatorID; ry.RYCH = 1; ry.KSDM = (short)pInfo.oZyDoctor.bm.bmdm; ry.HZ_HZZH = pInfo.NhInfo != null ? pInfo.NhInfo.coopMedCode : null; basy.RYH = pInfo.HisZyh.Value; basy.RYZD_ICD = pInfo.oRyIll.IllCode; basy.RYZD = pInfo.oRyIll.IllDesc; basy.MZZD_YS = (short)pInfo.oMzDoctor.zgdm; }
private void CalcNumSteps() { //double ra = (Math.Abs(RX) + Math.Abs(RY)) / 2; T ra = RX.Abs().Add(RY.Abs()).Divide(2); //double da = Math.Acos(ra / (ra + 0.125 / m_scale)) * 2; T da = ra.Divide(ra.Add(0.125).Divide(m_scale)).Acos().Multiply(2); m_num = (uint)M.PI <T>().Multiply(2).Divide(da).Round().ToInt(); }
public void HideControl() { Visible = false; X.UnBind(); Y.UnBind(); Z.UnBind(); RX.UnBind(); RY.UnBind(); RZ.UnBind(); SX.UnBind(); SY.UnBind(); SZ.UnBind(); }
public void BindBone(SBBone Bone) { NameLabel.Text = Bone.Name; X.Bind(Bone, "X"); Y.Bind(Bone, "Y"); Z.Bind(Bone, "Z"); RX.Bind(Bone, "RX"); RY.Bind(Bone, "RY"); RZ.Bind(Bone, "RZ"); SX.Bind(Bone, "SX"); SY.Bind(Bone, "SY"); SZ.Bind(Bone, "SZ"); }
public Boolean Save() { Boolean Saved = true; try { XmlNode Node; m_Doc.RemoveAll(); Node = m_Doc.CreateXmlDeclaration("1.0", "utf-8", String.Empty); m_Doc.AppendChild(Node); Node = m_Doc.CreateComment(String.Format(" ScpControl Configuration Data. {0} ", DateTime.Now)); m_Doc.AppendChild(Node); Node = m_Doc.CreateWhitespace("\r\n"); m_Doc.AppendChild(Node); Node = m_Doc.CreateNode(XmlNodeType.Element, "ScpControl", null); { CreateTextNode(Node, "Idle", Idle.ToString()); CreateTextNode(Node, "LX", LX.ToString()); CreateTextNode(Node, "LY", LY.ToString()); CreateTextNode(Node, "RX", RX.ToString()); CreateTextNode(Node, "RY", RY.ToString()); CreateTextNode(Node, "LED", LED.ToString()); CreateTextNode(Node, "Rumble", Rumble.ToString()); CreateTextNode(Node, "Triggers", Triggers.ToString()); CreateTextNode(Node, "Latency", Latency.ToString()); CreateTextNode(Node, "DeadL", DeadL.ToString()); CreateTextNode(Node, "DeadR", DeadR.ToString()); CreateTextNode(Node, "Native", Native.ToString()); CreateTextNode(Node, "SSP", SSP.ToString()); CreateTextNode(Node, "Brightness", Brightness.ToString()); CreateTextNode(Node, "Bus", Bus.ToString()); CreateTextNode(Node, "Force", Repair.ToString()); } m_Doc.AppendChild(Node); m_Doc.Save(m_File); } catch { Saved = false; } return(Saved); }
void Start() { Physics.gravity = 19.6f * Vector3.down; Time.timeScale = 0f; selected = Camera.main.GetComponent <CameraController>().center; selectedExists = false; camRayLength = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraController>().camRayLength; if (relativeRotation) { RXinitial = RX.transform.rotation; RYinitial = RY.transform.rotation; RZinitial = RZ.transform.rotation; } X.SetActive(true); Y.SetActive(true); Z.SetActive(true); RX.SetActive(true); RY.SetActive(true); RZ.SetActive(true); X.GetComponentInChildren <Renderer>().material.color = Color.red; Y.GetComponentInChildren <Renderer>().material.color = Color.green; Z.GetComponentInChildren <Renderer>().material.color = Color.blue; RX.GetComponentInChildren <Renderer>().material.color = Color.red; RY.GetComponentInChildren <Renderer>().material.color = Color.green; RZ.GetComponentInChildren <Renderer>().material.color = Color.blue; }
static void vJoyDataPack(float ROLL, float PITCH, float YAW, float THROTTLE, Frame thisFrame, Form1 sender) { //Display raw values sender.rollTXT.Text = ROLL.ToString(); sender.pitchTXT.Text = PITCH.ToString(); sender.yawTXT.Text = YAW.ToString(); sender.heightTXT.Text = THROTTLE.ToString(); //Display raw values sender.rollJOY.Text = RX.ToString(); sender.pitchJOY.Text = RY.ToString(); sender.yawJOY.Text = X.ToString(); sender.heightJOY.Text = Y.ToString(); sender.yawProg.Value = (int)X; sender.rollProg.Value = (int)RX; sender.pitchProg.Value = (int)RY; sender.heightProg.Value = (int)Y; HandValue thisHand = new HandValue(); thisHand.Roll = RX; thisHand.Pitch = RY; thisHand.Yaw = X; thisHand.Height = Y; thisHand.Timestamp = thisFrame.Timestamp; myLog.LogHand(thisHand); if (sender.chartCheckBox.Checked) { if ((thisFrame.Id % 3) == 0) { myCircularBuff.Add(thisHand); } } }
void align_tools() { X.SetActive(mode == "t" & selectedExists); Y.SetActive(mode == "t" & selectedExists); Z.SetActive(mode == "t" & selectedExists); RX.SetActive(mode == "r" & selectedExists); RY.SetActive(mode == "r" & selectedExists); RZ.SetActive(mode == "r" & selectedExists); if (selectedExists) { X.transform.position = selected.transform.position; Y.transform.position = selected.transform.position; Z.transform.position = selected.transform.position; RX.transform.position = selected.transform.position; RY.transform.position = selected.transform.position; RZ.transform.position = selected.transform.position; if (relativeRotation) { RX.transform.rotation = selected.transform.rotation * RXinitial; RY.transform.rotation = selected.transform.rotation * RYinitial; RZ.transform.rotation = selected.transform.rotation * RZinitial; } } }
static void serialCommData_pack(float ROLL, float PITCH, float YAW, float THROTTLE, Frame thisFrame, Form1 sender) { if (sender.serialPort1.IsOpen) { //Display raw values sender.rollTXT.Text = ROLL.ToString(); sender.pitchTXT.Text = PITCH.ToString(); sender.yawTXT.Text = YAW.ToString(); sender.heightTXT.Text = THROTTLE.ToString(); //Display raw values sender.rollJOY.Text = RX.ToString(); sender.pitchJOY.Text = RY.ToString(); sender.yawJOY.Text = X.ToString(); sender.heightJOY.Text = Y.ToString(); sender.yawProg.Value = (int)X; sender.rollProg.Value = (int)RX; sender.pitchProg.Value = (int)RY; sender.heightProg.Value = (int)Y; HandValue thisHand = new HandValue(); thisHand.Roll = RX; thisHand.Pitch = RY; thisHand.Yaw = X; thisHand.Height = Y; thisHand.Timestamp = thisFrame.Timestamp; if (ball_motion) { int Roll_to_send = (int)(((float)(RX >> 7)) / 1.422f); int Pitch_to_send = (int)(((float)(RY >> 7)) / 1.422f); dataOUT[0] = (byte)'$'; dataOUT[1] = (byte)'Y'; dataOUT[2] = (byte)(((Roll_to_send % 1000) / 100) + 48); dataOUT[3] = (byte)(((Roll_to_send % 100) / 10) + 48); dataOUT[4] = (byte)((Roll_to_send % 10) + 48); dataOUT[5] = (byte)'#'; dataOUT[6] = (byte)'$'; dataOUT[7] = (byte)'X'; dataOUT[8] = (byte)(((Pitch_to_send % 1000) / 100) + 48); dataOUT[9] = (byte)(((Pitch_to_send % 100) / 10) + 48); dataOUT[10] = (byte)((Pitch_to_send % 10) + 48); dataOUT[11] = (byte)'#'; } else { //scrittura nella seriale dataOUT[0] = (byte)'$'; dataOUT[1] = 85; uint Roll_to_send = (uint)((float)((uint)RX >> 5) / 1.28f); // CH1 uint Pitch_to_send = (uint)((float)((uint)RY >> 5) / 1.28f); uint Height_to_send = (uint)((float)((uint)Y >> 5) / 1.28f); uint Yaw_to_send = (uint)((float)((uint)X >> 5) / 1.28f); uint arm_disarm = 800; uint Air_mode = 0; uint Flight_mode = (uint)sender.FlightMode; uint CH8 = 0; if (AirMode) { Air_mode = 800; } else { Air_mode = 0; } if (run) { arm_disarm = 0; // armed } else { arm_disarm = 800; // disarmed } dataOUT[2] = (byte)(Roll_to_send >> 2); dataOUT[3] = (byte)((Roll_to_send << 6) | (Pitch_to_send >> 4)); dataOUT[4] = (byte)((Pitch_to_send << 4) | (Height_to_send >> 6)); dataOUT[5] = (byte)((Height_to_send << 2) | (Yaw_to_send >> 8)); dataOUT[6] = (byte)(Yaw_to_send); dataOUT[7] = (byte)(arm_disarm >> 2); dataOUT[8] = (byte)((arm_disarm << 6) | (Air_mode >> 4)); dataOUT[9] = (byte)((Air_mode << 4) | (Flight_mode >> 6)); dataOUT[10] = (byte)((Flight_mode << 2) | (CH8 >> 8)); dataOUT[11] = (byte)(CH8); dataOUT[12] = (byte)'#'; } } }
private static void PInfoToEntitys(DTO.PatientInfo pInfo, ZYBR zybr, RY ry, BASY basy) { zybr.ZYH = pInfo.HisZyh.Value; zybr.MZDM = (short)pInfo.HisNationCode; zybr.BAH = pInfo.HisZyh.Value; zybr.BRXM = pInfo.Name; zybr.XB = pInfo.Sex; zybr.CSRQ = pInfo.BirthDay; zybr.HYZK = pInfo.Marray; zybr.GJ = "中国"; zybr.SFZH = pInfo.PSN; zybr.mzks = (short)pInfo.oMzDoctor.bm.bmdm; zybr.NL = pInfo.Age; zybr.JSDW = pInfo.AgeUnit; ry.ZYH = pInfo.HisZyh.Value; ry.RYH = pInfo.HisRyh.Value; ry.RYKS = (short)pInfo.oZyDoctor.bm.bmdm; ry.ZYBRLX = (Byte)pInfo.HisZybrlx; ry.RYRQ = pInfo.Ryrq.Value; ry.RYQKDM = 1; ry.YS = (short)pInfo.oZyDoctor.zgdm; ry.CZY = GSettings.OperatorID; ry.RYCH = 1; ry.KSDM = (short)pInfo.oZyDoctor.bm.bmdm; ry.HZ_HZZH = pInfo.NhInfo != null ? pInfo.NhInfo.coopMedCode : null; basy.RYH = pInfo.HisZyh.Value; basy.RYZD_ICD = pInfo.oRyIll.IllCode; basy.RYZD = pInfo.oRyIll.IllDesc; basy.MZZD_YS = (short)pInfo.oMzDoctor.zgdm; }
public int NewPatientRegister(DTO.PatientInfo pInfo) { try { var zybr = new ZYBR(); var ry = new RY(); var basy = new BASY(); using (DCCbhisDataContext db = new DCCbhisDataContext(GSettings.HisConnStr)) { zybr.ZYH = MakeZyh(); PInfoToEntitys(pInfo, zybr, ry, basy); db.ZYBR.InsertOnSubmit(zybr); db.RY.InsertOnSubmit(ry); db.BASY.InsertOnSubmit(basy); db.SubmitChanges(); } return zybr.ZYH; } catch (System.Exception ex) { throw new ArgumentException("His入院登记错误:"+ex.Message); } }
public Boolean Save() { Boolean Saved = true; try { XmlNode Node, Entry; m_Xdoc.RemoveAll(); Node = m_Xdoc.CreateXmlDeclaration("1.0", "utf-8", String.Empty); m_Xdoc.AppendChild(Node); Node = m_Xdoc.CreateComment(String.Format(" ScpControl Configuration Data. {0} ", DateTime.Now)); m_Xdoc.AppendChild(Node); Node = m_Xdoc.CreateWhitespace("\r\n"); m_Xdoc.AppendChild(Node); Node = m_Xdoc.CreateNode(XmlNodeType.Element, "ScpControl", null); Entry = m_Xdoc.CreateNode(XmlNodeType.Element, "Idle", null); Entry.InnerText = Idle.ToString(); Node.AppendChild(Entry); Entry = m_Xdoc.CreateNode(XmlNodeType.Element, "LX", null); Entry.InnerText = LX.ToString(); Node.AppendChild(Entry); Entry = m_Xdoc.CreateNode(XmlNodeType.Element, "LY", null); Entry.InnerText = LY.ToString(); Node.AppendChild(Entry); Entry = m_Xdoc.CreateNode(XmlNodeType.Element, "RX", null); Entry.InnerText = RX.ToString(); Node.AppendChild(Entry); Entry = m_Xdoc.CreateNode(XmlNodeType.Element, "RY", null); Entry.InnerText = RY.ToString(); Node.AppendChild(Entry); Entry = m_Xdoc.CreateNode(XmlNodeType.Element, "LED", null); Entry.InnerText = LED.ToString(); Node.AppendChild(Entry); m_Xdoc.AppendChild(Node); m_Xdoc.Save(m_File); } catch { Saved = false; } return(Saved); }