public static void Day7Item6() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "视诊 气道无明显分泌物,神志清楚,配合。四肢肌力5级。"; AllNeedUI.Instance.BodyPlanes[8].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public static void Day8Item5() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "呼吸:18次/min"; AllNeedUI.Instance.BodyPlanes[9].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
private static void Day6Item4() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "呼吸:32次/min"; AllNeedUI.Instance.BodyPlanes[7].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public static void Day7Item3() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "血氧饱和度:100%"; AllNeedUI.Instance.BodyPlanes[8].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public static void LongAfterItem1() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "视诊:患者出现双手下垂,持物无力,并伴有麻木感。"; AllNeedUI.Instance.BodyPlanes[11].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public static void LongAfterItem6() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "肌电图检查:双上肢运动神经和感觉神经传导速度有不同程度传导减慢和延长"; AllNeedUI.Instance.BodyPlanes[11].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public static void Day3Item7() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "瞳孔检查:两瞳孔5mm,对光迟钝"; AllNeedUI.Instance.BodyPlanes[4].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public static void Day1Item13() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "视诊:神志不清,GCS评分3+1(T)+5。全身皮肤干燥。未见肌束震颤。双侧病理征(-)。"; AllNeedUI.Instance.BodyPlanes[2].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public static void Day0Item4() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "视诊:神志朦胧,两瞳孔对称,1mm,光反射迟钝。皮肤出汗明显、湿冷,肢体可见阵发性震颤。"; AllNeedUI.Instance.BodyPlanes[1].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public static void Day3Item6() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "突发出现烦躁不安,意欲拔除气管插管,医护人员心理护理不能收效。"; AllNeedUI.Instance.BodyPlanes[4].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public static void Day2Item7() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "视诊:遵嘱活动明显减弱。上肢肢肌力3级,对称。血清下肢肌力3+级,对称,两侧病理征(-)。"; AllNeedUI.Instance.BodyPlanes[3].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public static void Day2Item6() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "患者经血液灌流治疗后,神志转清,经口气管插管呼吸辅助通气"; AllNeedUI.Instance.BodyPlanes[3].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public static void Day2Item1() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "体温:T37.2℃"; AllNeedUI.Instance.BodyPlanes[3].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public static void Day0Item8() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "心率:70次/分。"; AllNeedUI.Instance.BodyPlanes[1].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
private static void Day4Item5() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "血氧饱和度:99%"; AllNeedUI.Instance.BodyPlanes[5].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public void _backgroundWorker_DoWork(object sender, DoWorkEventArgs e) { argument = e.Argument as RecordItem; while (true) { string log = argument.SubDomain + "." + argument.Domain + "을 갱신, "; DateTime time = DateTime.Now; try { string uri = String.Format("{0}&user={1}&auth={2}&domain={3}&record={4}&ft={5}" , YamlProperty.GetInstance.config.SetUser , YamlProperty.GetInstance.userData.User , YamlProperty.GetInstance.userData.Auth , argument.Domain , argument.SubDomain , (DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0)).TotalSeconds.ToString() ); string responseText = RequestWeb(uri); string jsonText = ReadXML(responseText); dynamic dict = JsonConvert.DeserializeObject(jsonText); log += "결과: " + dict.dnszi.status; log += ", 메시지: " + dict.dnszi.msg["#cdata-section"]; } catch (Exception ex) { Logger.GetInstance.AppendErrorLog(ex); log += "결과: 실패, 메시지: 네트워크 오류."; } LogUpdate(log, time); Thread.Sleep(5 * 60 * 1000); } }
private static void Day5Item3() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "血压:180/100mmHg"; AllNeedUI.Instance.BodyPlanes[6].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public static void Day8Item13() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "视诊:神志清楚,呼吸逐渐平稳,配合。"; AllNeedUI.Instance.BodyPlanes[10].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public static void Day0Item6() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "听诊:两肺呼吸音粗,可闻及少许湿罗音,心律齐,肠鸣音5-6次/min。"; AllNeedUI.Instance.BodyPlanes[1].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public static void LongAfterItem4() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "血压检查:血压125/81mmHg"; AllNeedUI.Instance.BodyPlanes[11].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public static void Day8Item10() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "血压:125/81mmHg"; AllNeedUI.Instance.BodyPlanes[10].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
public static void StopRecord(string name) { RecordItem _item = recordDic[name]; _item.stopTime = System.DateTime.Now.Ticks; _item.filePath = _item.filePath.Replace("\\", "/"); string folderPath = _item.filePath.Remove(_item.filePath.LastIndexOf("/")); if (!Directory.Exists(folderPath)) { Directory.CreateDirectory(folderPath); } FileStream fs = new FileStream(recordDic[name].filePath, FileMode.OpenOrCreate, FileAccess.ReadWrite); byte[] buffer = new byte[20480];//20KB int r = fs.Read(buffer, 0, 20480); string s = Encoding.Default.GetString(buffer, 0, r); if (r > 0) { s = s.Remove(0, s.LastIndexOf(",") + 1).Trim(); fs.WriteByte(13); fs.WriteByte(10); } else { s = "0"; } float _totalTime = ((float)(recordDic[name].stopTime - recordDic[name].startTime)) / 10000000; byte[] buffer2 = Encoding.Default.GetBytes(name + "\t,\t" + _totalTime + "\t,\t" + (float.Parse(s) + _totalTime)); fs.Write(buffer2, 0, buffer2.Length); fs.Close(); }
public static void Day8Item12() { GameObject go = RecordItem.Init(); go.GetComponent <RecordItem>().Text.text = "护士反馈:患者阵发性头晕、视物模糊、双影等现象,伴有胸部不适感。"; AllNeedUI.Instance.BodyPlanes[10].GetComponent <RectTransform>().sizeDelta += new Vector2(0, 45); }
//初始化函数 private async void VMInit() { IsProgressRingVisible = true; IsCheck = false; IsGrdPwdsListVisible = false; IsUcItemDetailVisible = false; ModifyCmd = new RelayCommand(new Action(ModifyData)); BackCmd = new RelayCommand(new Action(Back)); AddCmd = new RelayCommand(new Action(AddData)); string str = await FileManager.RecoverAsync(SaveType.LocalState); if (str.StartsWith("-")) { RightPwdMd5 = EncryptHelper.PwdEncrypt("123"); } else { RightPwdMd5 = FileManager.GetCode(str); } RecordList = new List <RecordItem>(); Records = new ObservableCollection <AlphaKeyGroup <RecordItem> >(); RecordItemMemory = new RecordItem(); RecordItemToModify = new RecordItem(); IsBackVisible = false; Title = "主页"; IsProgressRingVisible = false; }
public static RecordData FromJson(JObject json) { RecordData recordData = new RecordData(); var volumeJson = (JObject)json.GetValue(VOLUME_KEY); var symbolsTradedJson = (JObject)json.GetValue(SYMBOLS_TRADED_KEY); var routedVolumeJson = (JObject)json.GetValue(ROUTED_VOLUME_KEY); var notionalJson = (JObject)json.GetValue(NOTIONAL_KEY); if (volumeJson != null) { recordData.VolumeRecord = RecordItem <long> .FromJson(volumeJson, "Volume"); } if (symbolsTradedJson != null) { recordData.RecordSymbolsTraded = RecordItem <long> .FromJson(symbolsTradedJson, "Symbols Traded"); } if (routedVolumeJson != null) { recordData.RecordRoutedVolume = RecordItem <long> .FromJson(routedVolumeJson, "Routed Volume"); } if (notionalJson != null) { recordData.RecordNotional = RecordItem <decimal> .FromJson(notionalJson, "Notional"); } return(recordData); }
//删除条目, public async void DeleteData(RecordItem recordItem) { int index = RecordList.FindIndex(r => r.WebSite == recordItem.WebSite && r.Account == recordItem.Account); RecordList.RemoveAt(index); await BackupAsync(SaveType.LocalState); }
//复制条目 private void CopyRecordItem(RecordItem copyFrom, RecordItem copyTo) { copyTo.WebSite = copyFrom.WebSite; copyTo.Account = copyFrom.Account; copyTo.Pwd = copyFrom.Pwd; copyTo.Note = copyFrom.Note; }
//添加新条目,如果没有相同网站和相同账号,添加之,并保存,并显示列表。 public async void AddData() { if (string.IsNullOrEmpty(RecordItemToModify.WebSite)) { RecordItemToModify.WebSite = "错误!网站名称不能为空"; return; } int index = RecordList.FindIndex(r => r.WebSite == RecordItemToModify.WebSite && r.Account == RecordItemToModify.Account); if (index > -1) { RecordItemToModify.WebSite = "错误!已存在当前网站"; RecordItemToModify.Account = "错误!已存在当前账户"; } else { RecordItem r = new RecordItem(); CopyRecordItem(RecordItemToModify, r); RecordList.Add(r); string titleStr = await BackupAsync(SaveType.LocalState); if (titleStr.StartsWith("-")) { Title = titleStr.Substring(1); } else { Title = "收藏列表"; } IsUcItemDetailVisible = false; IsGrdPwdsListVisible = true; IsBackVisible = false; IsListVisible = true; } }
void InitializeViewModel() { Title = "Ubicación"; Catalogs.InitEntities(); Entities = Catalogs.Entities; if (!String.IsNullOrEmpty(Settings.CurrentRecordItem)) { RecordItem item = JsonConvert.DeserializeObject <RecordItem>(Settings.CurrentRecordItem); LocationDetails = item.LocationDetails; if (item.Entity != null) { SelectedEntity = Catalogs.GetEntityValue(item.Entity); } if (item.Municipality != null) { SelectedMunicipality = Catalogs.GetMunicipalityValue(item.Municipality); } if (item.Locality != null) { SelectedLocality = Catalogs.GetLocalityValue(item.Locality); } } NextCommand = new Command(async() => await Next()); }
public void TestRecords() { Interpreter interp = new Interpreter(); interp.Run("[ 2 'tacos' ] [ 'count' 'type' ] REC"); Assert.AreEqual(1, interp.stack.Count); RecordItem rec = (RecordItem)interp.StackPop(); // Get value interp.StackPush(rec); interp.Run("'type' REC@"); Assert.AreEqual(1, interp.stack.Count); dynamic val = interp.StackPop(); Assert.AreEqual("tacos", val.StringValue); // Set value interp.StackPush(rec); interp.Run("'burritos' 'type' REC!"); StringItem typeValue = (StringItem)rec.GetValue("type"); Assert.AreEqual("burritos", typeValue.StringValue); // Set value interp.StackPush(rec); interp.Run("'tostadas' 'type' <REC!"); typeValue = (StringItem)rec.GetValue("type"); Assert.AreEqual("tostadas", typeValue.StringValue); Assert.AreEqual(1, interp.stack.Count); }
public int AddRecord(byte[] data, int offset, int numBytes) { CheckOpen("addRecord"); byte[] buf = new byte[numBytes]; if (numBytes != 0) { Array.Copy(data, offset, buf, 0, numBytes); } RecordItem ri = new RecordItem(nextRecordId++, buf); records.Add(ri); WriteToDisk(isoStorage, this.storeFile); return ri.id; }
private void ReadFromDisk(System.IO.IsolatedStorage.IsolatedStorageFile iso, string storeFile) { DataInputStream dis = FileUtils.ReadIsolatedStorageFileToDataInput(iso, storeFile); try { string header = dis.ReadUTF(); if (!header.Equals(HEADER)) { throw new Exception("Store file header mismatch: " + header); } nextRecordId = dis.ReadInt(); int size = dis.ReadInt(); records.Clear(); for (int i = 0; i < size; i++) { long pSize = dis.ReadLong(); int pId = dis.ReadInt(); byte[] buffer = new byte[pSize]; dis.Read(buffer); RecordItem ri = new RecordItem(pId, buffer); records.Add(ri); } } catch (Exception e) { throw new Exception("ERROR reading store from disk (" + storeFile + "): " + e.StackTrace); } finally { if (dis != null) { dis.Close(); dis = null; } } }
private void BestPOpen_UpdateByLS(RecordItem rec, decimal avg, decimal highPrice, decimal lowPrice, decimal openPrice, long openVolume, StockList.StockInformation stockInfo) { try { if (rec != null) { rec.Fields("avg").Text = avg; rec.Fields("high").Text = highPrice; rec.Fields("low").Text = lowPrice; rec.Fields("avg").FontColor = Utilities.ComparePriceCFColor(avg, stockInfo); rec.Fields("high").FontColor = Utilities.ComparePriceCFColor(highPrice, stockInfo); rec.Fields("low").FontColor = Utilities.ComparePriceCFColor(lowPrice, stockInfo); if (openPrice > -1m) { rec.Fields("ovolume1").Text = openVolume; rec.Fields("open1").Text = openPrice; Color fontColor = Utilities.ComparePriceCFColor(openPrice, stockInfo); rec.Fields("open1").FontColor = fontColor; rec.Fields("ovolume1").FontColor = fontColor; } } } catch (Exception ex) { this.ShowError("BestProjectedOpenPriceUpdateByLS", ex); } }
/// <summary> /// 期货交易工作线程 /// </summary> /// <param name="para"></param> public void FutureTradeSubThreadProc(object para) { string ErrorMsg = string.Empty; //令该线程为前台线程 Thread.CurrentThread.IsBackground = true; DateTime lastmessagetime = DateTime.Now; TradeParaPackage _tpp = (TradeParaPackage)para; //当前线程编号 int _threadNo = _tpp._threadNo; if(_threadNo == 0) { //默认0号期货交易线程即测试线程 BROKER = TEST_BROKER; INVESTOR = TEST_INVESTOR; ADDRESS = TEST_ADDRESS; PASSWORD = TEST_PASSWORD; } sublog.LogEvent("线程 :" + _threadNo.ToString() + " 开始执行"); //用作发送心跳包的时间标记 DateTime _markedTime = DateTime.Now; //控制期货交易线程执行 bool _threadRunControl = true; while (_threadRunControl) { //初始化完成前,不接收实际交易 queue_future_excuteThread.SetThreadBusy(_threadNo); _client.Connect(); //状态 DISCONNECTED -> CONNECTED while (status != FutureTradeThreadStatus.CONNECTED) { Thread.Sleep(10); } _client.ReqUserLogin(); //状态 CONNECTED -> LOGIN while (status != FutureTradeThreadStatus.LOGIN) { Thread.Sleep(10); } while (true) { Thread.Sleep(10); if ((DateTime.Now - GlobalHeartBeat.GetGlobalTime()).TotalMinutes > 10) { sublog.LogEvent("线程 :" + _threadNo.ToString() + "心跳停止 , 最后心跳 : " + GlobalHeartBeat.GetGlobalTime().ToString()); _threadRunControl = false; break; } if (lastmessagetime.Second != DateTime.Now.Second) { KeyValuePair<string, object> message1 = new KeyValuePair<string, object>("THREAD_FUTURE_TRADE_WORKER", (object)_threadNo); queue_system_status.GetQueue().Enqueue((object)message1); } if (queue_future_excuteThread.GetQueue(_threadNo).Count < 2) { queue_future_excuteThread.SetThreadFree(_threadNo); status = FutureTradeThreadStatus.FREE; } else { status = FutureTradeThreadStatus.BUSY; } if (queue_future_excuteThread.GetQueue(_threadNo).Count > 0) { List<TradeOrderStruct> trades = (List<TradeOrderStruct>)queue_future_excuteThread.FutureExcuteQueue[_threadNo].Dequeue(); if (trades == null) continue; if (trades.Count > 0) { sublog.LogEvent("线程 :" + _threadNo.ToString() + " 执行交易数量 : " + trades.Count); } if (trades.Count == 0) { continue; } foreach (TradeOrderStruct order in trades) { CTP_CLI.CThostFtdcInputOrderField_M args = new CThostFtdcInputOrderField_M(); //填写委托参数 args.BrokerID = BROKER; args.InvestorID = INVESTOR; args.InstrumentID = order.cSecurityCode; args.Direction = Convert.ToByte(order.cTradeDirection); args.CombOffsetFlag_0 = Convert.ToByte(order.cOffsetFlag); args.VolumeTotalOriginal = Convert.ToInt16(order.nSecurityAmount); args.LimitPrice = Convert.ToDouble(order.dOrderPrice); args.OrderRef = order.OrderRef.ToString(); args.OrderPriceType =Convert.ToByte(order.cOrderPriceType); args.CombHedgeFlag_0 = Convert.ToByte('1'); args.MinVolume = 1; args.ContingentCondition = Convert.ToByte('1'); args.TimeCondition = Convert.ToByte('3'); args.VolumeCondition = Convert.ToByte('1'); args.ForceCloseReason = Convert.ToByte('0'); args.IsAutoSuspend = 0; args.UserForceClose = 0; //提交报单委托 //步骤完成后线程任务结束 //返回工作交由回调函数处理 _client.OrderInsert(args); //创建记录 RecordItem item = new RecordItem(); item.AveragePrice = 0; item.Code = order.cSecurityCode; item.CombOffsetFlag = Convert.ToInt16(order.cOffsetFlag); item.OrderRef = order.OrderRef; item.OrderStatus = 0; item.OrderSysID = "0"; item.Orientation = order.cTradeDirection; item.Price = Convert.ToDecimal(order.dOrderPrice); item.Status = TradeDealStatus.ORDERING; item.StrategyId = order.belongStrategy; item.Type = "1"; item.VolumeTotalOriginal = item.VolumeTotal = Convert.ToInt32(order.nSecurityAmount); item.VolumeTraded = 0; TradeRecord.GetInstance().CreateOrder(order.OrderRef, item); } } } } }