private void change_button_Click(object sender, EventArgs e) { button1.Visible = false; _parent._RESET_INACTIVITY(); VIEW_MODE = "Information"; detail_group.Text = VIEW_MODE; detail_list.Items.Clear(); change_button.BackColor = Color.LightBlue; hardware_button.BackColor = Color.FromKnownColor(KnownColor.Control);; software_button.BackColor = Color.FromKnownColor(KnownColor.Control);; if (CHANGES.Count > 0) { int index_value = 1; foreach (string HW in CHANGES) { if (HW.Length > 0) { string detail_line = ""; if (index_value < 10) { detail_line = (CHANGES.Count < 100 ? "0" : "00"); } else if (index_value < 100) { detail_line = (CHANGES.Count < 100 ? "" : "0"); } detail_line = detail_line + index_value.ToString() + ") "; detail_list.Items.Add(detail_line + (HW.Contains("DateStamp") ? (VIEW_TIME_STAMPS ? HW : HW.Substring(0, HW.LastIndexOf("DateStamp") - 2)) : HW)); index_value++; } } } }
/// <summary> /// System ring init method - ran once at boot /// </summary> public static void Init() { HW.Init(); //Thread.Sleep(500); Console.WriteLine("FileSystem service..."); FSService.Init(); Console.WriteLine("Filesystem: " + FSService.Active); if (FSService.Active == true) { for (int i = 1; i < SystemFunctions.IDEs.Length; i++) { new DiskListing(i, SystemFunctions.IDEs[i]); } InstallService.Init(); } SystemCalls MEFAPI = new SystemCalls(); for (int i = 0; i < Kernel.Drivers.Count; i++) { if (Kernel.Drivers[i].Init()) { Console.WriteLine(Kernel.Drivers[i].Name + "' loaded sucessfully"); } else { Console.WriteLine("Failure loading module '" + Kernel.Drivers[i].Name + "'"); Console.ReadKey(); } } }
private void HW_OnSignatureUpdate(PhysLoggerHWSignature oldSignature, PhysLoggerHWSignature newSignature) { if (oldSignature == PhysLoggerHWSignature.Unknown)// new connection signature update { if (newSignature == PhysLoggerHWSignature.PhysLogger1_0) { HW = new PhysLogger1_0HW(); Logger_1_0Attached(); } else if (newSignature == PhysLoggerHWSignature.PhysLogger1_1) { HW = new PhysLogger1_1HW(); Logger_1_1Attached(); } else if (newSignature == PhysLoggerHWSignature.PhysLogger1_2) { HW = new PhysLogger1_2HW(); Logger_1_2Attached(); } OnHWSignatureUpdate.Invoke(HW, new EventArgs()); } else { HW.SignatureReceived(newSignature); } }
public void SetDPS(CharacterCalculationsRetribution calc) { calc.WhiteSkill = White; calc.SealSkill = Seal; calc.SealDotSkill = SealDot; calc.CommandSkill = SoC; calc.JudgementSkill = Judge; calc.TemplarsVerdictSkill = TV; calc.CrusaderStrikeSkill = CS; calc.ConsecrationSkill = Cons; calc.ExorcismSkill = Exo; calc.HolyWrathSkill = HW; calc.HammerOfWrathSkill = HoW; calc.GoakSkill = GoaK; calc.DPSPoints = White.GetDPS() + Seal.GetDPS() + SealDot.GetDPS() + SoC.GetDPS() + Judge.GetDPS() + CS.GetDPS() + TV.GetDPS() + Exo.GetDPS() + HW.GetDPS() + Cons.GetDPS() + HoW.GetDPS() + GoaK.GetDPS() + calc.OtherDPS; }
public String getTempHardware() { String formato = "["; foreach (IHardware HW in computador.Hardware) { HW.Update(); if (HW.HardwareType.Equals(HardwareType.CPU)) { formato += "\n{"; foreach (ISensor Sensor in HW.Sensors) { if (Sensor.SensorType.Equals(SensorType.Temperature)) { if (Sensor.Name.Equals("CPU Package")) { formato += "\n\"Tipo\":\"" + HW.HardwareType.ToString() + "\","; formato += "\n\"Nome\":\"" + HW.Name.ToString() + "\","; formato += "\n\"Temp\":\"" + Sensor.Value.ToString() + "\""; } } } formato += "\n}"; } if (HW.HardwareType.Equals(HardwareType.GpuAti)) { formato += "\n,"; formato += "\n{"; foreach (ISensor Sensor in HW.Sensors) { if (Sensor.SensorType.Equals(SensorType.Temperature)) { formato += "\n\"Tipo\":\"" + HW.HardwareType.ToString() + "\","; formato += "\n\"Nome\":\"" + HW.Name.ToString() + "\","; formato += "\n\"Temp\":\"" + Sensor.Value.ToString() + "\""; } } formato += "\n}"; } if (HW.HardwareType.Equals(HardwareType.GpuNvidia)) { formato += "\n,"; formato += "\n{"; foreach (ISensor Sensor in HW.Sensors) { if (Sensor.SensorType.Equals(SensorType.Temperature)) { formato += "\n\"Tipo\":\"" + HW.HardwareType.ToString() + "\","; formato += "\n\"Nome\":\"" + HW.Name.ToString() + "\","; formato += "\n\"Temp\":\"" + Sensor.Value.ToString() + "\""; } } formato += "\n}"; } } formato += "\n]"; return(formato); }
public void CompilingMethodReference() { long interpretedTotal = 0, compiledTotal = 0; long stime, etime; string interpretedResult = null, compiledResult = null; var testdata = new HW(); var expression = _parser.ParseExpression("Hello()"); // warmup for (var i = 0; i < _count; i++) { interpretedResult = expression.GetValue <string>(testdata); } Log("timing interpreted: "); for (var i = 0; i < _iterations; i++) { stime = DateTime.Now.Ticks; for (var j = 0; j < _count; j++) { interpretedResult = expression.GetValue <string>(testdata); } etime = DateTime.Now.Ticks; var interpretedSpeed = etime - stime; interpretedTotal += interpretedSpeed; Log(interpretedSpeed + "ticks "); } LogLn(); Compile(expression); Log("timing compiled: "); expression.GetValue <string>(testdata); for (var i = 0; i < _iterations; i++) { stime = DateTime.Now.Ticks; for (var j = 0; j < _count; j++) { compiledResult = expression.GetValue <string>(testdata); } etime = DateTime.Now.Ticks; var interpretedSpeed = etime - stime; interpretedTotal += interpretedSpeed; Log(interpretedSpeed + "ticks "); } LogLn(); Assert.Equal(interpretedResult, compiledResult); ReportPerformance("method reference", interpretedTotal, compiledTotal); if (compiledTotal >= interpretedTotal) { throw new Exception("Compiled version is slower than interpreted!"); } }
public void LogMeInPls() { HW.LogMeInHamachi("BudgetDevv", "Dumbass").Should().BeTrue(); HW.LogMeInHamachi("feLix", "tRoll").Should().BeFalse(); HW.LogMeInHamachi("feLix", "Troll").Should().BeTrue(); }
public void RemoveAtShouldWorkWithSizeOne() { var Arr = new int[1] { 1 }; HW.RemoveAt(ref Arr, 0); Arr.Should().BeEquivalentTo(Array.Empty <int>()); }
public void RemoveAtShouldWorkWithSizeTwo() { var Arr = new int[2] { 1, 2 }; HW.RemoveAt(ref Arr, 1); Arr.Should().BeEquivalentTo(new int[] { 1 }); }
public void RemoveAtShouldThrowIfOutOfBounds() { var Arr = new int[1] { 1 }; HW.RemoveAt(ref Arr, 0); Arr.Should().BeEquivalentTo(Array.Empty <int>()); }
public void ShouldBeSorted() { var Arr = new int[4] { 1, 8, 2, 5 }; HW.QuickSort(Arr); Arr.Should().BeInAscendingOrder(); }
public void RemoveAtShouldWork() { var Arr = new int[4] { 1, 2, 5, 8 }; HW.RemoveAt(ref Arr, 1); Arr.Should().BeEquivalentTo(new int[] { 1, 5, 8 }); }
public void RemoveEndShouldWork() { var Arr = new int[4] { 1, 2, 5, 8 }; HW.RemoveEnd(ref Arr); Arr.Should().BeEquivalentTo(new int[] { 1, 2, 5 }); }
public void InsertShouldWork() { var Arr = new int[4] { 1, 2, 5, 8 }; HW.InsertAt(ref Arr, 69, 2); Arr.Should().HaveElementAt(2, 69); }
public void AppendEndShouldWork() { var Arr = new int[4] { 1, 2, 5, 8 }; HW.AppendEnd(ref Arr, 69); Arr.Should().HaveElementAt(4, 69); }
/// <summary> /// 将窗口输入框内容填入货物对象 /// </summary> /// <param name="hw"></param> private void createHW(HW hw) { int number = int.Parse(textBox_HW_NUMBER.Text); double price = double.Parse(textBox_HW_PRICE.Text); //hw.setHW_NAME(textBox_HW_NAME.Text); //hw.setHW_CODE(textBox_HW_CODE.Text); hw.setHW_NUMBER(number); hw.setHW_PRICE(price); hw.setHW_TOTALPRICE(price * number); hw.setCOMMENT(textBox_HW_COMMENT.Text); }
/// <summary> /// 构造函数 /// </summary> public FormOSM_HW_Add() { InitializeComponent(); hw = new HW(); string whereString = "where PID = 43 "; SJZDController.setZD_ComboBox(whereString, comboBox_HW_TYPE); comboBox_HW_TYPE.Enabled = false; //产品列表数据填充 fillProductComboBox(); }
private void loadMarket(string marketId, Holiday holiday) { HolidayWidget2 HW = null; if (!HolidayWidget3.MktHolidays.ContainsKey(marketId)) { HW = new HolidayWidget2(); HolidayWidget3.MktHolidays.Add(marketId, HW); } else { HW = HolidayWidget3.MktHolidays[marketId]; } HW.InsertHoliday(holiday); }
void Logger_1_1Attached() { HW.NewPointReceived += HW_NewPointReceived; HW.OnSignatureUpdate += HW_OnSignatureUpdate; HW.OnCommandSendRequest += HW_OnCommandSendRequest; HW.OnSamplingRateChanged += HW_OnSamplingRateChanged; HW.OnDisconnectRequested += HW_OnDisconnectRequested; var channelHWOpsHW = HW.EnumerateChannelOptions(); // if (dsCollection.Count != channelHWOpsHW.Count) // // This version doesn't support this loggerHW for (int i = 0; i < 4; i++) { dsCollection[i].ChannelOptions.HardwareOptions = channelHWOpsHW[i]; dsCollection[i].ChannelOptions.HardwareOptions.TopParent = dsCollection[i].ChannelOptions; dsCollection[i].ChannelOptions.SoftwareOptions.TopParent = dsCollection[i].ChannelOptions; } }
public Dictionary <ScenType, double[]> GetScen(double[] rdIR, double[] rdEQ) { double[] dscrt = new double[EndMth]; double[] eq = new double[EndMth]; double[] fi = new double[EndMth]; double x = 0.0; double t = 0.0; double discFactor = 0.0; double forward = 0.0; for (int mth = 0; mth < EndMth; mth++) { t = Convert.ToDouble(mth) * dt; forward = Curves.ForwardCurve[mth]; // 적용할인율 if (mth > 0) { x += -HW.a * x * dt + HW.sigma * Math.Sqrt(dt) * rdIR[mth]; } discFactor = x + HW.Alpha(forward, t); // 할인율 시나리오(연속 --> 이산) dscrt[mth] = Math.Exp(discFactor) - 1.0; // 채권, 5년 채권만 편입됨을 가정 double bondSigma = -HW.sigma * HW.B(t, t + 5); fi[mth] = Math.Exp(discFactor - 0.5 * Math.Pow(bondSigma, 2.0) * dt + bondSigma * Math.Sqrt(dt) * rdIR[mth]) - 1.0; // 주식 eq[mth] = Math.Exp((forward - 0.5 * Math.Sqrt(EqSigma)) * dt + EqSigma * Math.Sqrt(EqSigma) * rdEQ[mth]) - 1.0; } var res = new Dictionary <ScenType, double[]>(); res.Add(ScenType.Dscrt, dscrt); res.Add(ScenType.FI, fi); res.Add(ScenType.EQ, eq); return(res); }
/// <summary> /// 实现数据库插入货物数据 /// </summary> /// <param name="hw"></param> /// <returns></returns> private bool addHW(HW hw) { string sql = "insert into OSM_HW(OFFERSHEET_CODE,PRODUCT_ID,HW_NUMBER,HW_PRICE,HW_TOTALPRICE,COMMENT) "; sql += "values('" + hw.getOFFERSHEET_CODE() + "'," + hw.getPRODUCT_ID() + ","; sql += hw.getHW_NUMBER().ToString() + "," + hw.getHW_PRICE().ToString(); sql += "," + hw.getHW_TOTALPRICE().ToString() + ",'" + hw.getCOMMENT() + "')"; AccessDB adb = new AccessDB(); bool isExecuteSucc = adb.SQLExecute(sql); if (isExecuteSucc) { MessageBox.Show("添加成功!", "消息"); } else { MessageBox.Show("添加失败!", "消息"); } return(isExecuteSucc); }
private void NidaleeOnDraw(EventArgs args) { if (Target != null) { Utility.DrawCircle(Target.Position, Target.BoundingRadius, Color.Red, 1, 1); } foreach (var spell in cougarList) { var circle = Config.Item("draw" + spell.Slot.ToString()).GetValue <Circle>(); if (circle.Active && Kitty && !Me.IsDead) { Utility.DrawCircle(Me.Position, spell.Range, circle.Color, 1, 1); } } foreach (var spell in humanList) { var circle = Config.Item("draw" + spell.Slot.ToString()).GetValue <Circle>(); if (circle.Active && !Kitty && !Me.IsDead) { Utility.DrawCircle(Me.Position, spell.Range, circle.Color, 1, 1); } } if (!Config.Item("drawcds").GetValue <bool>()) { return; } var wts = Drawing.WorldToScreen(Me.Position); if (!Kitty) // lets show cooldown timers for the opposite form :) { if (Me.Spellbook.CanUseSpell(SpellSlot.Q) == SpellState.NotLearned) { Drawing.DrawText(wts[0] - 80, wts[1], Color.White, "Q: Null"); } else if (CQ == 0) { Drawing.DrawText(wts[0] - 80, wts[1], Color.White, "Q: Ready"); } else { Drawing.DrawText(wts[0] - 80, wts[1], Color.Orange, "Q: " + CQ.ToString("0.0")); } if (Me.Spellbook.CanUseSpell(SpellSlot.W) == SpellState.NotLearned) { Drawing.DrawText(wts[0] - 30, wts[1] + 30, Color.White, "W: Null"); } else if (CW == 0) { Drawing.DrawText(wts[0] - 30, wts[1] + 30, Color.White, "W: Ready"); } else { Drawing.DrawText(wts[0] - 30, wts[1] + 30, Color.Orange, "W: " + CW.ToString("0.0")); } if (Me.Spellbook.CanUseSpell(SpellSlot.E) == SpellState.NotLearned) { Drawing.DrawText(wts[0], wts[1], Color.White, "E: Null"); } else if (CE == 0) { Drawing.DrawText(wts[0], wts[1], Color.White, "E: Ready"); } else { Drawing.DrawText(wts[0], wts[1], Color.Orange, "E: " + CE.ToString("0.0")); } } else { if (Me.Spellbook.CanUseSpell(SpellSlot.Q) == SpellState.NotLearned) { Drawing.DrawText(wts[0] - 80, wts[1], Color.White, "Q: Null"); } else if (HQ == 0) { Drawing.DrawText(wts[0] - 80, wts[1], Color.White, "Q: Ready"); } else { Drawing.DrawText(wts[0] - 80, wts[1], Color.Orange, "Q: " + HQ.ToString("0.0")); } if (Me.Spellbook.CanUseSpell(SpellSlot.W) == SpellState.NotLearned) { Drawing.DrawText(wts[0] - 30, wts[1] + 30, Color.White, "W: Null"); } else if (HW == 0) { Drawing.DrawText(wts[0] - 30, wts[1] + 30, Color.White, "W: Ready"); } else { Drawing.DrawText(wts[0] - 30, wts[1] + 30, Color.Orange, "W: " + HW.ToString("0.0")); } if (Me.Spellbook.CanUseSpell(SpellSlot.E) == SpellState.NotLearned) { Drawing.DrawText(wts[0], wts[1], Color.White, "E: Null"); } else if (HE == 0) { Drawing.DrawText(wts[0], wts[1], Color.White, "E: Ready"); } else { Drawing.DrawText(wts[0], wts[1], Color.Orange, "E: " + HE.ToString("0.0")); } } }
public void serialChannelControl1_PacketReceived(FivePointNine.Windows.IO.PacketCommandMini command) { HW.ParseCommand(command, DataPort.Channel); }
public void ChangeHWSamplingRate(float frequencyInHz) { HW.ChangeSamplingRate(frequencyInHz); }
private static void NidaleeOnDraw(EventArgs args) { if (Target != null && MainMenu.Item("drawline").GetValue <bool>()) { if (Me.IsDead) { return; } Render.Circle.DrawCircle(Target.Position, Target.BoundingRadius - 50, Color.Yellow); } foreach (var spell in CougarList) { var circle = MainMenu.Item("draw" + spell.Slot).GetValue <Circle>(); if (circle.Active && CougarForm && !Me.IsDead) { Render.Circle.DrawCircle(Me.Position, spell.Range, circle.Color, 2); } } foreach (var spell in HumanList) { var circle = MainMenu.Item("draw" + spell.Slot).GetValue <Circle>(); if (circle.Active && !CougarForm && !Me.IsDead) { Render.Circle.DrawCircle(Me.Position, spell.Range, circle.Color, 2); } } if (!MainMenu.Item("drawcds").GetValue <bool>()) { return; } var wts = Drawing.WorldToScreen(Me.Position); if (!CougarForm) // lets show cooldown timers for the opposite form :) { if (Me.Spellbook.CanUseSpell(SpellSlot.Q) == SpellState.NotLearned) { Drawing.DrawText(wts[0] - 80, wts[1], Color.White, "Q: Null"); } else if (CQ == 0) { Drawing.DrawText(wts[0] - 80, wts[1], Color.White, "Q: Ready"); } else { Drawing.DrawText(wts[0] - 80, wts[1], Color.Orange, "Q: " + CQ.ToString("0.0")); } if (Me.Spellbook.CanUseSpell(SpellSlot.W) == SpellState.NotLearned) { Drawing.DrawText(wts[0] - 30, wts[1] + 30, Color.White, "W: Null"); } else if (CW == 0) { Drawing.DrawText(wts[0] - 30, wts[1] + 30, Color.White, "W: Ready"); } else { Drawing.DrawText(wts[0] - 30, wts[1] + 30, Color.Orange, "W: " + CW.ToString("0.0")); } if (Me.Spellbook.CanUseSpell(SpellSlot.E) == SpellState.NotLearned) { Drawing.DrawText(wts[0], wts[1], Color.White, "E: Null"); } else if (CE == 0) { Drawing.DrawText(wts[0], wts[1], Color.White, "E: Ready"); } else { Drawing.DrawText(wts[0], wts[1], Color.Orange, "E: " + CE.ToString("0.0")); } } else { if (Me.Spellbook.CanUseSpell(SpellSlot.Q) == SpellState.NotLearned) { Drawing.DrawText(wts[0] - 80, wts[1], Color.White, "Q: Null"); } else if (HQ == 0) { Drawing.DrawText(wts[0] - 80, wts[1], Color.White, "Q: Ready"); } else { Drawing.DrawText(wts[0] - 80, wts[1], Color.Orange, "Q: " + HQ.ToString("0.0")); } if (Me.Spellbook.CanUseSpell(SpellSlot.W) == SpellState.NotLearned) { Drawing.DrawText(wts[0] - 30, wts[1] + 30, Color.White, "W: Null"); } else if (HW == 0) { Drawing.DrawText(wts[0] - 30, wts[1] + 30, Color.White, "W: Ready"); } else { Drawing.DrawText(wts[0] - 30, wts[1] + 30, Color.Orange, "W: " + HW.ToString("0.0")); } if (Me.Spellbook.CanUseSpell(SpellSlot.E) == SpellState.NotLearned) { Drawing.DrawText(wts[0], wts[1], Color.White, "E: Null"); } else if (HE == 0) { Drawing.DrawText(wts[0], wts[1], Color.White, "E: Ready"); } else { Drawing.DrawText(wts[0], wts[1], Color.Orange, "E: " + HE.ToString("0.0")); } } }