static void TestTypeCheckRemoved_4(object o1) { if (o1 is T6) { return; } T6.Call(); }
private void Clear(object sender, RoutedEventArgs e) { T1.Clear(); T2.Clear(); T3.Clear(); T4.Clear(); T5.Clear(); T6.Clear(); T7.Clear(); T8.Clear(); T9.Clear(); T10.Clear(); T11.Clear(); T12.Clear(); T13.Clear(); T14.Clear(); T15.Clear(); T16.Clear(); T17.Clear(); }
private Dictionary <Tuple <T1, T2, T3, T4, T5, T6>, int> CollectKeys6 <T1, T2, T3, T4, T5, T6>() { Debug.Assert(_keyColumns.Length == 6); var column1 = _dataMap[_keyColumns[0]].UnderlyingList; var column2 = _dataMap[_keyColumns[1]].UnderlyingList; var column3 = _dataMap[_keyColumns[2]].UnderlyingList; var column4 = _dataMap[_keyColumns[3]].UnderlyingList; var column5 = _dataMap[_keyColumns[4]].UnderlyingList; var column6 = _dataMap[_keyColumns[5]].UnderlyingList; var rowCount = _dataMap.MaxRowCount; var result = new Dictionary <Tuple <T1, T2, T3, T4, T5, T6>, int>(rowCount); for (var i = 0; i < rowCount; ++i) { T1 k1 = i >= column1.Count ? TypeTrait <T1> .GetNaN() : (T1)column1[i]; T2 k2 = i >= column2.Count ? TypeTrait <T2> .GetNaN() : (T2)column2[i]; T3 k3 = i >= column3.Count ? TypeTrait <T3> .GetNaN() : (T3)column3[i]; T4 k4 = i >= column4.Count ? TypeTrait <T4> .GetNaN() : (T4)column4[i]; T5 k5 = i >= column5.Count ? TypeTrait <T5> .GetNaN() : (T5)column5[i]; T6 k6 = i >= column6.Count ? TypeTrait <T6> .GetNaN() : (T6)column6[i]; var key = Tuple.Create(k1, k2, k3, k4, k5, k6); try { result.Add(key, i); } catch (ArgumentException ex) { throw new ArgumentException($"Duplicate key values: {key}", ex); } } return(result); }
public static float EaseEvaluate(float time, int mode) { if (time >= 1.0) { return(1.0f); } else if (time <= 0.0) { return(0.0f); } switch (mode) { case 1: return(T1.Evaluate(time)); case 2: return(T2.Evaluate(time)); case 3: return(T3.Evaluate(time)); case 4: return(T4.Evaluate(time)); case 5: return(T5.Evaluate(time)); case 6: return(T6.Evaluate(time)); case 7: return(T7.Evaluate(time)); case 8: return(T8.Evaluate(time)); case 9: return(T9.Evaluate(time)); case 10: return(T10.Evaluate(time)); case 11: return(T11.Evaluate(time)); case 12: return(T12.Evaluate(time)); default: return(time); } }
protected void ImageButton5_Click(object sender, ImageClickEventArgs e) { T.Text = ""; T.Focus(); T1.Text = ""; T1.Focus(); T2.Text = ""; T2.Focus(); T3.Text = ""; T3.Focus(); T4.Text = ""; T4.Focus(); T5.Text = ""; T5.Focus(); T6.Text = ""; T6.Focus(); T7.Text = ""; T7.Focus(); T8.Text = ""; T8.Focus(); T9.Text = ""; T9.Focus(); }
private void Timer_Tick(object sender, EventArgs e) { if (Running == true) { //Lauf ist wurde beendet if (Run == "stopped") { Run = "inactiv"; Console.WriteLine("Run had been finished"); log.Items.Insert(0, "Lauf beendet"); logTime.Items.Insert(0, "--:--"); logTime2.Items.Insert(0, "---"); Console.WriteLine("=========================="); log.Items.Insert(0, "====================="); logTime.Items.Insert(0, "==:=="); logTime2.Items.Insert(0, "==="); //Abfrage von streamdata.php WebClient wc = new WebClient(); string livetiming = wc.DownloadString("http://erzgebirgsschwimmcup.de/Livetiming/streamdata.php"); Console.WriteLine(livetiming); //streamdata auswerten string[] words = livetiming.Split('?'); string lane = "0"; string lane_1_meters = "0"; string lane_2_meters = "0"; string lane_3_meters = "0"; string lane_4_meters = "0"; string lane_1_time = "0"; string lane_2_time = "0"; string lane_3_time = "0"; string lane_4_time = "0"; foreach (string word in words) { string[] words2 = word.Split('#'); foreach (string word2 in words2) { if (word2 == "1") { lane = "1"; } if (word2 == "2") { lane = "2"; } if (word2 == "3") { lane = "3"; } if (word2 == "4") { lane = "4"; } if (word2 == "50" || word2 == "100" || word2 == "200") { if (lane == "1") { lane_1_meters = word2; } if (lane == "2") { lane_2_meters = word2; } if (lane == "3") { lane_3_meters = word2; } if (lane == "4") { lane_4_meters = word2; } } if (lane != "0" || word2 != "1" || word2 != "2" || word2 != "3" || word2 != "4" || word2 != "50" || word2 != "100" || word2 != "200") { if (lane == "1") { lane_1_time = word2; } if (lane == "2") { lane_2_time = word2; } if (lane == "3") { lane_3_time = word2; } if (lane == "4") { lane_4_time = word2; } } } } Console.WriteLine("====================="); Console.WriteLine("Run before:"); Console.WriteLine("====================="); Console.WriteLine("Lane 1:"); Console.WriteLine("Meters: " + lane_1_meters); Console.WriteLine("Time: " + lane_1_time); Console.WriteLine("====================="); Console.WriteLine("Lane 2:"); Console.WriteLine("Meters: " + lane_2_meters); Console.WriteLine("Time: " + lane_2_time); Console.WriteLine("====================="); Console.WriteLine("Lane 3:"); Console.WriteLine("Meters: " + lane_3_meters); Console.WriteLine("Time: " + lane_3_time); Console.WriteLine("====================="); Console.WriteLine("Lane 4:"); Console.WriteLine("Meters: " + lane_4_meters); Console.WriteLine("Time: " + lane_4_time); Console.WriteLine("====================="); //streamdata auswerten string[] words3 = livetiming.Split('#'); Wk_l = "0"; Meters = "0"; int forcount = 0; foreach (string word3 in words3) { forcount++; if (forcount == 1) { Wk_l = word3; } if (forcount == 2) { int forcount2 = 0; string[] words4 = word3.Split('m'); foreach (string word4 in words4) { forcount2++; if (forcount2 == 1) { Meters = word4; } } } } Console.WriteLine(""); Console.WriteLine("WK: " + Wk_l); Console.WriteLine("Strecke: " + Meters + "m"); Console.WriteLine(""); Console.WriteLine("====================="); //Zeiten mit richtigen Metern in Array string StrRuntimes = ""; if (lane_1_meters == Meters) { StrRuntimes = StrRuntimes + "#" + lane_1_time; Console.WriteLine(StrRuntimes); } if (lane_2_meters == Meters) { StrRuntimes = StrRuntimes + "#" + lane_2_time; Console.WriteLine(StrRuntimes); } if (lane_3_meters == Meters) { StrRuntimes = StrRuntimes + "#" + lane_3_time; Console.WriteLine(StrRuntimes); } if (lane_4_meters == Meters) { StrRuntimes = StrRuntimes + "#" + lane_4_time; Console.WriteLine(StrRuntimes); } string[] Runtimes = StrRuntimes.Split('#'); int TimeFast = 10000000; foreach (string Time in Runtimes) { if (!String.IsNullOrEmpty(Time)) { Console.WriteLine("Zeit:"); Console.WriteLine(Time); //Sekunden berechnen string Time_min_str = Time.Substring(0, 2); string Time_sek_str = Time.Substring(3, 2); int Time_min = Int32.Parse(Time_min_str); int Time_sek = Int32.Parse(Time_sek_str); if (Time_min == 1) { Time_sek = Time_sek + 60; } if (Time_min == 02) { Time_sek = Time_sek + 120; } if (Time_min == 03) { Time_sek = Time_sek + 180; } if (Time_sek <= TimeFast) { TimeFast = Time_sek; } } } Run_sek = TimeFast; } //während keinem Lauf if (Run == "inactiv") { //Abfrage, ob Lauf wieder gestartet WebClient wc2 = new WebClient(); string livetimingD = wc2.DownloadString("http://erzgebirgsschwimmcup.de/Livetiming/livetime2.php"); if (livetimingD.Contains("Bahn")) { Run = "started"; } } //wenn Lauf gestartet: if (Run == "started") { Run = "activ"; //Abfrage welche Strecke geschwommen wird WebClient wc3 = new WebClient(); string livetimingD = wc3.DownloadString("http://erzgebirgsschwimmcup.de/Livetiming/streamdata.php"); Console.WriteLine(livetimingD); Console.WriteLine("Run has been started!"); Console.WriteLine(""); log.Items.Insert(0, "Lauf wurde gestartet"); logTime.Items.Insert(0, "00:00"); logTime2.Items.Insert(0, "0"); //Werte aktueller Lauf string distance = Meters; //Szenenwechsel berechnen //für 50m Stecken if (distance == "50") { T1 = Math.Round(Run_sek * 0.3); T2 = Math.Round(Run_sek * 0.7); Time1.Text = T1.ToString(); Time2.Text = T2.ToString(); Time3.Text = " "; Time4.Text = " "; Time5.Text = " "; Time6.Text = " "; Time7.Text = " "; Time8.Text = " "; } if (distance == "100") { T1 = Math.Round(Run_sek * 0.15); T2 = Math.Round(Run_sek * 0.35); T3 = Math.Round(Run_sek * 0.65); T4 = Math.Round(Run_sek * 0.85); Time1.Text = T1.ToString(); Time2.Text = T2.ToString(); Time3.Text = T3.ToString(); Time4.Text = T4.ToString(); Time5.Text = " "; Time6.Text = " "; Time7.Text = " "; Time8.Text = " "; } if (distance == "200") { T1 = Math.Round(Run_sek * 0.075); T2 = Math.Round(Run_sek * 0.175); T3 = Math.Round(Run_sek * 0.325); T4 = Math.Round(Run_sek * 0.425); T5 = Math.Round(Run_sek * 0.575); T6 = Math.Round(Run_sek * 0.675); T7 = Math.Round(Run_sek * 0.825); T8 = Math.Round(Run_sek * 0.925); Time1.Text = T1.ToString(); Time2.Text = T2.ToString(); Time3.Text = T3.ToString(); Time4.Text = T4.ToString(); Time5.Text = T5.ToString(); Time6.Text = T6.ToString(); Time7.Text = T7.ToString(); Time8.Text = T8.ToString(); } Console.WriteLine(Run_sek); log.Items.Insert(0, "Sekunden: " + Run_sek); logTime.Items.Insert(0, "00:00"); logTime2.Items.Insert(0, "0"); progressBar.Maximum = Run_sek; TimeCount = 0; Count = 0; Count2 = 0; clock.Text = "00:00"; //Auslesen streamdata.php für WK WebClient wc = new WebClient(); string livetiming = wc.DownloadString("http://erzgebirgsschwimmcup.de/Livetiming/streamdata.php"); //WK ermitteln string[] words3 = livetiming.Split('#'); Wk_c = "0"; Meters = "0"; int forcount = 0; foreach (string word3 in words3) { forcount++; if (forcount == 1) { Wk_c = word3; } if (forcount == 2) { int forcount2 = 0; string[] words4 = word3.Split('m'); foreach (string word4 in words4) { forcount2++; if (forcount2 == 1) { Meters_c = word4; } } } } Console.WriteLine("WK: " + Wk_c); Console.WriteLine("WK (l): " + Wk_l); WkBox.Text = Wk_c; DistanceBox.Text = Meters_c + "m"; } //während des Laufes: if (Run == "activ") { //timer hochzählen TimeCount = TimeCount + 1; Console.WriteLine(TimeCount); Count = Count + 1; string display; string display2; if (Count >= 60) { Count = 0; Count2++; } if (Count < 10) { display = "0" + Count.ToString(); } else { display = Count.ToString(); } if (Count2 < 10) { display2 = "0" + Count2.ToString(); } else { display2 = Count2.ToString(); } string output = display2 + ":" + display; clock.Text = output; TimeBox.Text = "" + TimeCount; //wenn stichzeiten gleich aktueller Zeit Kamera wechseln if (Wk_c == Wk_l) { if (TimeCount == T1) { Console.WriteLine("Change Scene to webcam 2"); log.Items.Insert(0, "Wechsle Szene zu Webcam 2"); logTime.Items.Insert(0, output); logTime2.Items.Insert(0, TimeCount); //OBS Anweisungen SendKeys.Send("^M"); T1 = 0; } if (TimeCount == T2) { Console.WriteLine("Change Scene to webcam 1"); log.Items.Insert(0, "Wechsle Szene zu Webcam 1"); logTime.Items.Insert(0, output); logTime2.Items.Insert(0, TimeCount); //OBS Anweisungen SendKeys.Send("^N"); T2 = 0; } if (TimeCount == T3) { Console.WriteLine("Change Scene to webcam 2"); log.Items.Insert(0, "Wechsle Szene zu Webcam 2"); logTime.Items.Insert(0, output); logTime2.Items.Insert(0, TimeCount); //OBS Anweisungen SendKeys.Send("^M"); T3 = 0; } if (TimeCount == T4) { Console.WriteLine("Change Scene to webcam 1"); log.Items.Insert(0, "Wechsle Szene zu Webcam 1"); logTime.Items.Insert(0, output); logTime2.Items.Insert(0, TimeCount); //OBS Anweisungen SendKeys.Send("^N"); T4 = 0; } if (TimeCount == T5) { Console.WriteLine("Change Scene to webcam 2"); log.Items.Insert(0, "Wechsle Szene zu Webcam 2"); logTime.Items.Insert(0, output); logTime2.Items.Insert(0, TimeCount); //OBS Anweisungen SendKeys.Send("^M"); T5 = 0; } if (TimeCount == T6) { Console.WriteLine("Change Scene to webcam 1"); log.Items.Insert(0, "Wechsle Szene zu Webcam 1"); logTime.Items.Insert(0, output); logTime2.Items.Insert(0, TimeCount); //OBS Anweisungen SendKeys.Send("^N"); T6 = 0; } if (TimeCount == T7) { Console.WriteLine("Change Scene to webcam 2"); log.Items.Insert(0, "Wechsle Szene zu Webcam 2"); logTime.Items.Insert(0, output); logTime2.Items.Insert(0, TimeCount); //OBS Anweisungen SendKeys.Send("^M"); T7 = 0; } if (TimeCount == T8) { Console.WriteLine("Change Scene to webcam 1"); log.Items.Insert(0, "Wechsle Szene zu Webcam 1"); logTime.Items.Insert(0, output); logTime2.Items.Insert(0, TimeCount); //OBS Anweisungen SendKeys.Send("^N"); T8 = 0; } } //Lauffortschritt in Progressbar if (TimeCount <= Run_sek) { progressBar.Value = TimeCount; } //Abfrage, ob Lauf beendet WebClient wc2 = new WebClient(); string livetimingD = wc2.DownloadString("http://erzgebirgsschwimmcup.de/Livetiming/livetime2.php"); if (!livetimingD.Contains("Bahn")) { Run = "stopped"; } } } else { textBox1.Text = "angehalten"; } }
Public Shared Function Create(Of T1, T2, T3, T4, T5, T6, T7, T8)(item1 As T1, item2 As T2, item3 As T3, item4 As T4, item5 As T5, item6 As T6, item7 As T7, item8 As T8) As (T1, T2, T3, T4, T5, T6, T7, T8)
public void CalculatePerformance(double pressure, double temperature, double velocity, double commandedThrottle) { if (Tt7 == 0) { mainThrottle = commandedThrottle; } else { mainThrottle = Math.Min(commandedThrottle * 1.5, 1.0); abThrottle = Math.Max(commandedThrottle - 0.667, 0); } p0 = pressure * 1000; //freestream t0 = temperature; gamma_c = CalculateGamma(t0, 0); Cp_c = CalculateCp(t0, 0); Cv_c = Cp_c / gamma_c; R_c = Cv_c * (gamma_c - 1); M0 = velocity / Math.Sqrt(gamma_c * R_c * t0); T1 = t0 * (1 + 0.5 * (gamma_c - 1) * M0 * M0); //inlet P1 = p0 * Math.Pow(T1 / t0, gamma_c / (gamma_c - 1)) * TPR; double prat3 = CPR; double prat2 = FPR; double k = FPR / CPR; double p = Math.Pow(k, (gamma_c - 1) / eta_c / gamma_c); for (int i = 0; i < 20; i++) //use iteration to calculate CPR { P2 = prat2 * P1; P3 = prat3 * P1; T2 = T1 * Math.Pow(prat2, (gamma_c - 1) / gamma_c / eta_c); //fan T3 = T1 * Math.Pow(prat3, (gamma_c - 1) / gamma_c / eta_c); //compressor T4 = (Tt4 - T3) * mainThrottle + T3; //burner P4 = P3; ff = Cp_c * (T4 - T3) / (Cp_c * (T4 - T3) + h_f); //fuel fraction Cp_t = CalculateCp(T4, ff); T5 = T4 * TTR; //turbine double x = prat3; prat3 = (1 + ff) * Cp_t * (T4 - T5) / T1 / Cp_c + 1 + BPR; prat3 /= 1 + BPR * p; prat3 = Math.Pow(prat3, eta_c * gamma_c / (gamma_c - 1)); prat2 = k * prat3; if (Math.Abs(x - prat3) < 0.01) { break; } } gamma_t = CalculateGamma(T5, ff);//gas parameters Cp_t = CalculateCp(T5, ff); Cv_t = Cp_t / gamma_t; R_t = Cv_t * (gamma_t - 1); P5 = P4 * Math.Pow((1 - 1 / eta_t * (1 - TTR)), gamma_t / (gamma_t - 1)); if (exhaustMixer && BPR > 0) //exhaust mixer { double Cp6 = (Cp_c * BPR + Cp_t) / (1 + BPR); //Cp of mixed flow -- kind of T6 = T5 * Cp_t / Cp6 * (1 + BPR * Cp_c * T2 / Cp_t / T5) / (1 + BPR); P6 = (P5 + BPR * 0.98 * P2) / (1 + BPR); ff /= (1 + ff + BPR); gamma_t = CalculateGamma(T6, ff);//gas parameters Cp_t = CalculateCp(T6, ff); Cv_t = Cp_t / gamma_t; R_t = Cv_t * (gamma_t - 1); } else { T6 = T5; P6 = P5; } if (Tt7 > 0) { T7 = (Tt7 - T6) * abThrottle * 3 + T6;//afterburner } else { T7 = T6; } P7 = P6; //rayleigh loss? ff_ab = ff + Cp_t * (T7 - T6) / (Cp_t * (T7 - T6) + h_f); //fuel fraction gamma_ab = CalculateGamma(T7, ff_ab); //gas parameters Cp_ab = CalculateCp(T7, ff_ab); Cv_ab = Cp_ab / gamma_ab; R_ab = Cv_ab * (gamma_ab - 1); //Nozzle code is from NASA double P8 = P7; double T8 = T7; double p8, V8, A8; double epr = P8 / P1; double etr = T8 / T1; double area8max = .75 * Math.Sqrt(etr) / epr;//ratio of nozzle area to ref area A8 = area8max * Aref; if (exhaustMixer && BPR > 0) { A8 *= (1 + BPR); } double eair = P8 * Math.Sqrt(gamma_ab / R_ab / T8) * Math.Pow((.5 + .5 * gamma_ab), .5 * (1 + gamma_ab) / (1 - gamma_ab));//corrected mass flow per area mdot = eair * A8; double npr = P8 / p0; double fac1 = (gamma_ab - 1.0) / gamma_ab; V8 = Math.Sqrt(2.0 * R_c / fac1 * T8 * eta_n * (1.0 - Math.Pow(1.0 / npr, fac1))); //exit velocity p8 = (npr <= 1.893) ? p0 : .52828 * P8; thrust = V8 * mdot + (p8 - p0) * A8; if (BPR > 0 && FPR > 1 && exhaustMixer == false) { fac1 = (gamma_c - 1) / gamma_c; //fan thrust from NASA double snpr = P2 / p0; double ues = Math.Sqrt(2.0 * R_c / fac1 * T2 * eta_n * (1.0 - Math.Pow(1.0 / snpr, fac1))); double pfexit = (snpr <= 1.893) ? p0 : .52828 * P2; //exit pressure of fan thrust += BPR * ues * mdot / (1 + ff_ab) + (pfexit - p0) * BPR * Aref; } double netthrust = thrust - mdot / (1 + ff_ab) * (1 + (exhaustMixer ? 0 : BPR)) * (velocity);//ram drag Isp = thrust / (mdot * ff_ab * 9.81); debugstring = ""; debugstring += "TTR:\t" + TTR.ToString("F3") + "\r\n"; debugstring += "CPR:\t" + prat3.ToString("F3") + "\r\n"; debugstring += "M0:\t" + M0.ToString("F3") + "\r\n"; debugstring += "p0: " + p0.ToString("F2") + "\tt0: " + t0.ToString("F2") + "\r\n"; debugstring += "P1: " + P1.ToString("F2") + "\tT1: " + T1.ToString("F2") + "\r\n"; debugstring += "P2: " + P2.ToString("F2") + "\tT2: " + T2.ToString("F2") + "\r\n"; debugstring += "P3: " + P3.ToString("F2") + "\tT3: " + T3.ToString("F2") + "\r\n"; debugstring += "P4: " + P4.ToString("F2") + "\tT4: " + T4.ToString("F2") + "\r\n"; debugstring += "P5: " + P5.ToString("F2") + "\tT5: " + T5.ToString("F2") + "\r\n"; debugstring += "P6: " + P6.ToString("F2") + "\tT6: " + T6.ToString("F2") + "\r\n"; debugstring += "P7: " + P7.ToString("F2") + "\tT7: " + T7.ToString("F2") + "\r\n"; debugstring += "EPR: " + epr.ToString("F2") + "\tETR: " + etr.ToString("F2") + "\r\n"; debugstring += "FF: " + ff.ToString("P") + "\t"; debugstring += "FF_AB: " + ff_ab.ToString("P") + "\r\n"; debugstring += "V8: " + V8.ToString("F2") + "\tA8: " + A8.ToString("F2") + "\r\n"; debugstring += "Thrust: " + (thrust / 1000).ToString("F1") + "\tmdot: " + mdot.ToString("F2") + "\r\n"; debugstring += "NetThrust: " + (netthrust / 1000).ToString("F1") + "\tSFC: " + (3600 / Isp).ToString("F3") + "\r\n"; //Debug.Log(debugstring); }
public void TwoSequencesInChoice() { var particle = new CompositeParticle.Builder(ParticleType.Choice, 0, 1) { new ElementParticle(typeof(T1), 0, 1), new CompositeParticle.Builder(ParticleType.Sequence, 0, 1) { new ElementParticle(typeof(T2), 0, 1), new ElementParticle(typeof(T3), 0, 1), }, new ElementParticle(typeof(T4), 0, 1), new CompositeParticle.Builder(ParticleType.Sequence, 0, 1) { new ElementParticle(typeof(T5), 0, 1), new ElementParticle(typeof(T6), 0, 1), }, }.Compile(); var data = new TestOpenXmlCompositeElement(); var t1 = new T1(); var t2 = new T2(); var t3 = new T3(); var t4 = new T4(); var t5 = new T5(); var t6 = new T6(); Assert.True(particle.Set(data, t1)); Assert.Collection( data, e => Assert.Same(t1, e)); Assert.True(particle.Set(data, t2)); Assert.Collection( data, e => Assert.Same(t2, e)); Assert.True(particle.Set(data, t3)); Assert.Collection( data, e => Assert.Same(t2, e), e => Assert.Same(t3, e)); Assert.True(particle.Set(data, t4)); Assert.Collection( data, e => Assert.Same(t4, e)); Assert.True(particle.Set(data, t5)); Assert.Collection( data, e => Assert.Same(t5, e)); Assert.True(particle.Set(data, t6)); Assert.Collection( data, e => Assert.Same(t5, e), e => Assert.Same(t6, e)); Assert.True(particle.Set(data, t3)); Assert.Collection( data, e => Assert.Same(t3, e)); Assert.True(particle.Set(data, t2)); Assert.Collection( data, e => Assert.Same(t2, e), e => Assert.Same(t3, e)); }
private void StageRev(int page) { WagoIO.Instance.SetListTC(lst, page); T1.StageRev("АВАРИЯ^НОСИТЕЛЯ", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T2.StageRev("", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T3.StageRev("Р по^ПАДАЕТ", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T4.StageRev("СРАБОТАЛ^ТД", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T5.StageRev("", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T6.StageRev("ОТКАЗ^БВС", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T7.StageRev("Pса^ПАДАЕТ", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T8.StageRev("РАЗГЕРМ^СА", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T9.StageRev("РАЗГЕРМ^КЖО", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T10.StageRev("Р400^мм рт ст", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T11.StageRev("СОСТАВ^ВОЗДУХА", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T12.StageRev("РАЗГЕРМ^КНР", new SolidColorBrush(Colors.Red), new SolidColorBrush(Colors.Silver)); T13.StageRev("PАЗГЕРМ^ПОДГОТ", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T14.StageRev("РАЗДЕЛЕН^по ГЦ", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T15.StageRev("ОТКРЫТ^КСД БО", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T16.StageRev("АВАРИЯ^ЦВМ", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T17.StageRev("ПРОГР^РАЗДЕЛЕН", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T18.StageRev("ТД^ПОДКЛ", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T19.StageRev("ПРИЗНАК^СПУСК", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T20.StageRev("СГ^РАЗАРР", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T21.StageRev("РАБОТА^ДПО", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T22.StageRev("СПУСК^ПО ГЦ", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T23.StageRev("ВЫБОР^ДПО", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T24.StageRev("РАБОТА^СКД", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); Block1 = "TC-1"; Block2 = "TC-2"; Block3 = "TC-3"; Block4 = "TC-4"; if (page == 2) { T1.StageRev("БС", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T2.StageRev("БСР", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T3.StageRev("закрутка^СА", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T4.StageRev("ВЫЗОВ НА^СВЯЗЬ", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T5.StageRev("разреш^РРСТ", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T6.StageRev("U мало", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T7.StageRev("ввод^ЗСП", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T8.StageRev("отказ^очист СА", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T9.StageRev("ПОСАДКА", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T10.StageRev("РБ^подкл", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T11.StageRev("отказ^очист БО", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T12.StageRev("останов^КС-020", new SolidColorBrush(Colors.Yellow), new SolidColorBrush(Colors.Silver)); T13.StageRev("БВC^готов", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T14.StageRev("ОСК", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T15.StageRev("ГСО", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T16.StageRev("2 СЕКЦИЯ^НАДДУВА", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T17.StageRev("2 СЕКЦИЯ^КДУ", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T18.StageRev("СА-БО^люк откр", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T19.StageRev("РО АК", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T20.StageRev("ввод^ОСП", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T21.StageRev("подача^O2", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T22.StageRev("РУД", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T23.StageRev("УКВ^передача", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); T24.StageRev("МЕХАН^СОЕДИН", new SolidColorBrush(Colors.Green), new SolidColorBrush(Colors.Silver)); Block1 = "TC-5"; Block2 = "TC-6"; Block3 = "TC-7"; Block4 = "TC-8"; } }
static bool Do6(T6 t) { Nullable<T6> n = new Nullable<T6>(t); return Ensure(n.HasValue && n.Value == t); }
List <CourseModel> SearchCourse(PageInfo pageInfo) { CreateSelect(); var courses = (from c in db.Course_Infos join r in db.Sys_ClassRooms on c.c_room equals r.room_id into T1 from t1 in T1.DefaultIfEmpty() join s in db.Sys_Schools on t1.room_school_id equals s.sys_school_id into T2 from t2 in T2.DefaultIfEmpty() join ty in db.Dic_Course_Types on c.c_type_id equals ty.ct_id into T3 from t3 in T3.DefaultIfEmpty() join tea in db.User_Infos on c.c_teacher_id equals tea.user_id into T4 from t4 in T4.DefaultIfEmpty() join ass in db.User_Infos on c.c_assistant_id equals ass.user_id into T5 from t5 in T5.DefaultIfEmpty() join season in db.Course_Seasons on c.c_cs_id equals season.c_season_id into T6 from t6 in T6.DefaultIfEmpty() join sub in db.Dic_Subjects on c.c_sub_id equals sub.sub_id into T7 from t7 in T7.DefaultIfEmpty() where t1.room_school_id == (pageInfo.school == 0 ? t1.room_school_id : pageInfo.school) orderby new { c.c_cs_id, c.c_sub_id, c.course_name } select new CourseModel { id = c.course_id, assistantName = t5.user_name, cost = c.course_cost, introduce = c.course_introduce, max = c.course_max_num, name = c.course_name, room = c.c_room, roomName = t1.room_id == 0 ? "" : t2.sys_school_name + t1.room_name, season = c.c_cs_id, seasonName = t6.c_season_name, subject = c.c_sub_id, subjectName = t7.sub_name, teacher = c.c_teacher_id, teacherName = t4.user_name, type = c.c_type_id, typeName = t3.ct_name, timeInfo = c.c_time_info }); //.Skip(pagesize*(pageindex-1)).Take(pagesize).ToList(); if (pageInfo.room != 0) { courses = courses.Where(x => x.room == pageInfo.room); } if (pageInfo.season != 0) { courses = courses.Where(x => x.season == pageInfo.season); } if (pageInfo.subject != 0) { courses = courses.Where(x => x.subject == pageInfo.subject); } if (pageInfo.teacher != 0) { courses = courses.Where(x => x.teacher == pageInfo.teacher); } if (pageInfo.type != 0) { courses = courses.Where(x => x.type == pageInfo.type); } if (!string.IsNullOrEmpty(pageInfo.keyword)) { courses = courses.Where(x => x.name.Contains(pageInfo.keyword)); } pageInfo.count = courses.Count(); if (pageInfo.pagesize == 0) { pageInfo.pagesize = 10; } if (pageInfo.pageindex == 0) { pageInfo.pageindex = 1; } pageInfo.pages = (int)Math.Ceiling((decimal)pageInfo.count / pageInfo.pagesize); ViewData["search"] = pageInfo; var list = courses.Skip(pageInfo.pagesize * (pageInfo.pageindex - 1)).Take(pageInfo.pagesize).ToList(); foreach (var course in list) { var time = (from cvt in db.Course_vs_Times where cvt.cvt_course_id == course.id orderby cvt.cvt_time ascending select cvt.cvt_time ).FirstOrDefault(); course.beginDate = time; } return(list); }