commit
a4b697ff0b
@ -16,6 +16,11 @@ using System.Threading;
|
|||||||
|
|
||||||
namespace PhysFormuler
|
namespace PhysFormuler
|
||||||
{
|
{
|
||||||
|
public static class Numbers
|
||||||
|
{
|
||||||
|
public static float I, U, R, q, A, S, p, l, t;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Логика взаимодействия для MainWindow.xaml
|
/// Логика взаимодействия для MainWindow.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -26,13 +31,6 @@ namespace PhysFormuler
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Log(string s)
|
|
||||||
{
|
|
||||||
Console.WriteLine(s);
|
|
||||||
Logger.Items.Add(s);
|
|
||||||
Thread.Sleep(100);
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool IsReady(TextBox box,string type)
|
private bool IsReady(TextBox box,string type)
|
||||||
{
|
{
|
||||||
if(type != "T")
|
if(type != "T")
|
||||||
@ -64,234 +62,267 @@ namespace PhysFormuler
|
|||||||
|
|
||||||
private void Update(string type)
|
private void Update(string type)
|
||||||
{
|
{
|
||||||
try
|
|
||||||
{
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case "U":
|
case "U":
|
||||||
if (IsReady(U,type))
|
if (!Math.Round(Numbers.U, 4).Equals(U.Text) && IsReady(U, type)) Numbers.U = (float)Convert.ToDouble(U.Text);
|
||||||
|
if (!Math.Round(Numbers.R, 4).Equals(R.Text) && IsReady(R, type)) Numbers.R = (float)Convert.ToDouble(R.Text);
|
||||||
|
if (!Math.Round(Numbers.I, 4).Equals(I.Text) && IsReady(I, type)) Numbers.I = (float)Convert.ToDouble(I.Text);
|
||||||
|
if (!Math.Round(Numbers.q, 4).Equals(q.Text) && IsReady(q, type)) Numbers.q = (float)Convert.ToDouble(q.Text);
|
||||||
|
if (!Math.Round(Numbers.A, 4).Equals(A.Text) && IsReady(A, type)) Numbers.A = (float)Convert.ToDouble(A.Text);
|
||||||
|
if (IsReady(U,type))
|
||||||
{
|
{
|
||||||
if (IsReady(R, type))
|
if (IsReady(R, type))
|
||||||
{
|
{
|
||||||
I.Text = Math.Round(Convert.ToDouble(U.Text) / Convert.ToDouble(R.Text),4).ToString();
|
Numbers.I = Numbers.U / Numbers.R;
|
||||||
Log(U.Text + " В / " + R.Text + " Ом = " + I.Text + " А");
|
I.Text = Math.Round(Numbers.I, 4).ToString();
|
||||||
}
|
}
|
||||||
if (IsReady(I, type))
|
if (IsReady(I, type))
|
||||||
{
|
{
|
||||||
R.Text = Math.Round(Convert.ToDouble(U.Text) / Convert.ToDouble(I.Text),4).ToString();
|
Numbers.R = Numbers.U / Numbers.I;
|
||||||
Log(U.Text + " В / " + I.Text + " А = " + R.Text + " Ом");
|
R.Text = Math.Round(Numbers.R, 4).ToString();
|
||||||
}
|
}
|
||||||
if (IsReady(q, type))
|
if (IsReady(q, type))
|
||||||
{
|
{
|
||||||
A.Text = Math.Round(Convert.ToDouble(U.Text) * Convert.ToDouble(q.Text),4).ToString();
|
Numbers.A = Numbers.U * Numbers.q;
|
||||||
Log(U.Text + " В * " + q.Text + " Кл = " + A.Text + " А");
|
A.Text = Math.Round(Numbers.A, 4).ToString();
|
||||||
}
|
}
|
||||||
if (IsReady(A, type))
|
if (IsReady(A, type))
|
||||||
{
|
{
|
||||||
q.Text = Math.Round(Convert.ToDouble(A.Text) / Convert.ToDouble(U.Text),4).ToString();
|
Numbers.q = Numbers.A / Numbers.U;
|
||||||
Log(A.Text + " А / " + U.Text + " В = " + q.Text + " Кл");
|
q.Text = Math.Round(Numbers.q, 4).ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "R":
|
case "R":
|
||||||
if(IsReady(R, type))
|
if (!Math.Round(Numbers.U, 4).Equals(U.Text) && IsReady(U, type)) Numbers.U = (float)Convert.ToDouble(U.Text);
|
||||||
|
if (!Math.Round(Numbers.R, 4).Equals(R.Text) && IsReady(R, type)) Numbers.R = (float)Convert.ToDouble(R.Text);
|
||||||
|
if (!Math.Round(Numbers.I, 4).Equals(I.Text) && IsReady(I, type)) Numbers.I = (float)Convert.ToDouble(I.Text);
|
||||||
|
if (!Math.Round(Numbers.S, 4).Equals(S.Text) && IsReady(S, type)) Numbers.S = (float)Convert.ToDouble(S.Text);
|
||||||
|
if (!Math.Round(Numbers.p, 4).Equals(p.Text) && IsReady(p, type)) Numbers.p = (float)Convert.ToDouble(p.Text);
|
||||||
|
if (!Math.Round(Numbers.l, 4).Equals(l.Text) && IsReady(l, type)) Numbers.l = (float)Convert.ToDouble(l.Text);
|
||||||
|
if (IsReady(R, type))
|
||||||
{
|
{
|
||||||
if(IsReady(U, type))
|
if(IsReady(U, type))
|
||||||
{
|
{
|
||||||
I.Text = Math.Round(Convert.ToDouble(U.Text) / Convert.ToDouble(R.Text),4).ToString();
|
Numbers.I = Numbers.U / Numbers.R;
|
||||||
Log(U.Text + " В / " + R.Text + " Ом = " + I.Text + " А");
|
I.Text = Math.Round(Numbers.I, 4).ToString();
|
||||||
}
|
}
|
||||||
if(IsReady(I, type))
|
if(IsReady(I, type))
|
||||||
{
|
{
|
||||||
U.Text = Math.Round(Convert.ToDouble(I.Text) * Convert.ToDouble(R.Text),4).ToString();
|
Numbers.U = Numbers.I * Numbers.R;
|
||||||
Log(I.Text + " А * " + R.Text + " Ом = " + U.Text + " В");
|
U.Text = Math.Round(Numbers.U, 4).ToString();
|
||||||
}
|
}
|
||||||
if(IsReady(S,type))
|
if(IsReady(S,type))
|
||||||
{
|
{
|
||||||
if(IsReady(p,type))
|
if(IsReady(p,type))
|
||||||
{
|
{
|
||||||
l.Text = Math.Round(Convert.ToDouble(R.Text) * Convert.ToDouble(S.Text) / Convert.ToDouble(p.Text),4).ToString();
|
Numbers.l = Numbers.R * Numbers.S / Numbers.p;
|
||||||
Log(R.Text + " Ом * " + S.Text +" мм^2 / " + p.Text + " Ом*м = " + l.Text + " м");
|
l.Text = Math.Round(Numbers.l, 4).ToString();
|
||||||
}
|
}
|
||||||
if(IsReady(l,type))
|
if(IsReady(l,type))
|
||||||
{
|
{
|
||||||
p.Text = Math.Round(Convert.ToDouble(R.Text) * Convert.ToDouble(S.Text) / Convert.ToDouble(l.Text),4).ToString();
|
Numbers.p = Numbers.R * Numbers.S / Numbers.l;
|
||||||
Log(R.Text + " Ом * " + S.Text + " мм^2 / " + l.Text + " м = " + p.Text + " Ом*м");
|
p.Text = Math.Round(Numbers.p, 4).ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(IsReady(p,type))
|
if(IsReady(p,type))
|
||||||
{
|
{
|
||||||
if(IsReady(l,type))
|
if(IsReady(l,type))
|
||||||
{
|
{
|
||||||
S.Text = Math.Round(Convert.ToDouble(p.Text) * Convert.ToDouble(l.Text) / Convert.ToDouble(R.Text),4).ToString();
|
Numbers.S = Numbers.p * Numbers.l / Numbers.R;
|
||||||
Log(p.Text + " Ом*м * " + l.Text + " м / " + R.Text + " Ом = " + S.Text + " мм^2");
|
S.Text = Math.Round(Numbers.S, 4).ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "I":
|
case "I":
|
||||||
if(IsReady(I, type))
|
if (!Math.Round(Numbers.I, 4).Equals(I.Text) && IsReady(I, type)) Numbers.I = (float)Convert.ToDouble(I.Text);
|
||||||
|
if (!Math.Round(Numbers.R, 4).Equals(R.Text) && IsReady(R, type)) Numbers.R = (float)Convert.ToDouble(R.Text);
|
||||||
|
if (!Math.Round(Numbers.U, 4).Equals(U.Text) && IsReady(U, type)) Numbers.U = (float)Convert.ToDouble(U.Text);
|
||||||
|
if (!Math.Round(Numbers.q, 4).Equals(q.Text) && IsReady(q, type)) Numbers.q = (float)Convert.ToDouble(q.Text);
|
||||||
|
if (!Math.Round(Numbers.t, 4).Equals(t.Text) && IsReady(t, type)) Numbers.t = (float)Convert.ToDouble(t.Text);
|
||||||
|
if (IsReady(I, type))
|
||||||
{
|
{
|
||||||
if (IsReady(R, type))
|
if (IsReady(R, type))
|
||||||
{
|
{
|
||||||
U.Text = Math.Round(Convert.ToDouble(I.Text) * Convert.ToDouble(R.Text),4).ToString();
|
Numbers.U = Numbers.I * Numbers.R;
|
||||||
Log(I.Text + " А * " + R.Text + " Ом = " + U.Text + " В");
|
U.Text = Math.Round(Numbers.U, 4).ToString();
|
||||||
}
|
}
|
||||||
if (IsReady(U, type))
|
if (IsReady(U, type))
|
||||||
{
|
{
|
||||||
R.Text = Math.Round(Convert.ToDouble(U.Text) / Convert.ToDouble(I.Text),4).ToString();
|
Numbers.R = Numbers.U / Numbers.I;
|
||||||
Log(U.Text + " В / " + I.Text + " А = " + R.Text + " Ом");
|
R.Text = Math.Round(Numbers.R, 4).ToString();
|
||||||
}
|
}
|
||||||
if(IsReady(q, type))
|
if(IsReady(q, type))
|
||||||
{
|
{
|
||||||
t.Text = Math.Round(Convert.ToDouble(q.Text) / Convert.ToDouble(I.Text),4).ToString();
|
Numbers.t = Numbers.q / Numbers.I;
|
||||||
Log(q.Text + " Кл / " + I.Text + " А = " + t.Text + " Сек");
|
t.Text = Math.Round(Numbers.t, 4).ToString();
|
||||||
}
|
}
|
||||||
if(IsReady(t, type))
|
if(IsReady(t, type))
|
||||||
{
|
{
|
||||||
q.Text = Math.Round(Convert.ToDouble(I.Text) * Convert.ToDouble(t.Text),4).ToString();
|
Numbers.q = Numbers.I * Numbers.t;
|
||||||
Log(I.Text + " А * " + t.Text + " Сек = " + q.Text + " Кл");
|
q.Text = Math.Round(Numbers.q, 4).ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "q":
|
case "q":
|
||||||
if(IsReady(q, type))
|
if (!Math.Round(Numbers.U, 4).Equals(U.Text) && IsReady(U, type)) Numbers.U = (float)Convert.ToDouble(U.Text);
|
||||||
|
if (!Math.Round(Numbers.q, 4).Equals(q.Text) && IsReady(q, type)) Numbers.q = (float)Convert.ToDouble(q.Text);
|
||||||
|
if (!Math.Round(Numbers.I, 4).Equals(I.Text) && IsReady(I, type)) Numbers.I = (float)Convert.ToDouble(I.Text);
|
||||||
|
if (!Math.Round(Numbers.t, 4).Equals(t.Text) && IsReady(t, type)) Numbers.t = (float)Convert.ToDouble(t.Text);
|
||||||
|
if (!Math.Round(Numbers.A, 4).Equals(A.Text) && IsReady(A, type)) Numbers.A = (float)Convert.ToDouble(A.Text);
|
||||||
|
if (IsReady(q, type))
|
||||||
{
|
{
|
||||||
if(IsReady(U, type))
|
if(IsReady(U, type))
|
||||||
{
|
{
|
||||||
A.Text = Math.Round(Convert.ToDouble(U.Text) * Convert.ToDouble(q.Text),4).ToString();
|
Numbers.A = Numbers.U * Numbers.q;
|
||||||
Log(U.Text + " В * " + q.Text + " Кл = " + A.Text + " Дж");
|
A.Text = Math.Round(Numbers.A, 4).ToString();
|
||||||
}
|
}
|
||||||
if(IsReady(I, type))
|
if(IsReady(I, type))
|
||||||
{
|
{
|
||||||
t.Text = Math.Round(Convert.ToDouble(q.Text) / Convert.ToDouble(I.Text),4).ToString();
|
Numbers.t = Numbers.q / Numbers.I;
|
||||||
Log(q.Text + " Кл / " + I.Text + " А = " + t.Text + " Сек");
|
t.Text = Math.Round(Numbers.t, 4).ToString();
|
||||||
}
|
}
|
||||||
if(IsReady(t, type))
|
if(IsReady(t, type))
|
||||||
{
|
{
|
||||||
I.Text = Math.Round(Convert.ToDouble(q.Text) / Convert.ToDouble(t.Text),4).ToString();
|
Numbers.I = Numbers.q / Numbers.t;
|
||||||
Log(q.Text + " Кл / " + t.Text + " Сек = " + I.Text + " А");
|
I.Text = Math.Round(Numbers.I, 4).ToString();
|
||||||
}
|
}
|
||||||
if(IsReady(A, type))
|
if(IsReady(A, type))
|
||||||
{
|
{
|
||||||
U.Text = Math.Round(Convert.ToDouble(A.Text) * Convert.ToDouble(q.Text),4).ToString();
|
Numbers.U = Numbers.A * Numbers.q;
|
||||||
Log(A.Text + " Дж * " + q.Text + " Кл = " + U.Text + " В");
|
U.Text = Math.Round(Numbers.U, 4).ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "A":
|
case "A":
|
||||||
if(IsReady(A, type))
|
if (!Math.Round(Numbers.A, 4).Equals(A.Text) && IsReady(A, type)) Numbers.A = (float)Convert.ToDouble(A.Text);
|
||||||
|
if (!Math.Round(Numbers.U, 4).Equals(U.Text) && IsReady(U, type)) Numbers.U = (float)Convert.ToDouble(U.Text);
|
||||||
|
if (!Math.Round(Numbers.q, 4).Equals(q.Text) && IsReady(q, type)) Numbers.q = (float)Convert.ToDouble(q.Text);
|
||||||
|
if (IsReady(A, type))
|
||||||
{
|
{
|
||||||
if(IsReady(U, type))
|
if(IsReady(U, type))
|
||||||
{
|
{
|
||||||
q.Text = Math.Round(Convert.ToDouble(A.Text) / Convert.ToDouble(U.Text),4).ToString();
|
Numbers.q = Numbers.A / Numbers.U;
|
||||||
Log(A.Text + " Дж / " + U.Text + " В = " + q.Text + " Кл");
|
q.Text = Math.Round(Numbers.q, 4).ToString();
|
||||||
}
|
}
|
||||||
if(IsReady(q, type))
|
if(IsReady(q, type))
|
||||||
{
|
{
|
||||||
U.Text = Math.Round(Convert.ToDouble(A.Text) * Convert.ToDouble(q.Text),4).ToString();
|
Numbers.U = Numbers.A * Numbers.q;
|
||||||
Log(A.Text + " Дж * " + q.Text + " Кл = " + U.Text + " В");
|
U.Text = Math.Round(Numbers.U, 4).ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "t":
|
case "t":
|
||||||
if(IsReady(t, type))
|
if (!Math.Round(Numbers.I, 4).Equals(I.Text) && IsReady(I, type)) Numbers.I = (float)Convert.ToDouble(I.Text);
|
||||||
|
if (!Math.Round(Numbers.t, 4).Equals(t.Text) && IsReady(t, type)) Numbers.t = (float)Convert.ToDouble(t.Text);
|
||||||
|
if (!Math.Round(Numbers.q, 4).Equals(q.Text) && IsReady(q, type)) Numbers.q = (float)Convert.ToDouble(q.Text);
|
||||||
|
if (IsReady(t, type))
|
||||||
{
|
{
|
||||||
if(IsReady(I, type))
|
if(IsReady(I, type))
|
||||||
{
|
{
|
||||||
q.Text = Math.Round(Convert.ToDouble(I.Text) * Convert.ToDouble(t.Text),4).ToString();
|
Numbers.q = Numbers.I * Numbers.t;
|
||||||
Log(I.Text + " А * " + t.Text + " Сек = " + q.Text + " Кл");
|
q.Text = Math.Round(Numbers.q, 4).ToString();
|
||||||
}
|
}
|
||||||
if(IsReady(q, type))
|
if(IsReady(q, type))
|
||||||
{
|
{
|
||||||
I.Text = Math.Round(Convert.ToDouble(q.Text) / Convert.ToDouble(t.Text),4).ToString();
|
Numbers.I = Numbers.q / Numbers.t;
|
||||||
Log(q.Text + " Кл / " + t.Text + " Сек = " + I.Text + " А");
|
I.Text = Math.Round(Numbers.I, 4).ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "p":
|
case "p":
|
||||||
if(IsReady(p,type))
|
if (!Math.Round(Numbers.p, 4).Equals(p.Text) && IsReady(p, type)) Numbers.p = (float)Convert.ToDouble(p.Text);
|
||||||
|
if (!Math.Round(Numbers.l, 4).Equals(l.Text) && IsReady(l, type)) Numbers.l = (float)Convert.ToDouble(l.Text);
|
||||||
|
if (!Math.Round(Numbers.S, 4).Equals(S.Text) && IsReady(S, type)) Numbers.S = (float)Convert.ToDouble(S.Text);
|
||||||
|
if (!Math.Round(Numbers.R, 4).Equals(R.Text) && IsReady(R, type)) Numbers.R = (float)Convert.ToDouble(R.Text);
|
||||||
|
if (IsReady(p,type))
|
||||||
{
|
{
|
||||||
if(IsReady(l,type))
|
if(IsReady(l,type))
|
||||||
{
|
{
|
||||||
if(IsReady(S,type))
|
if(IsReady(S,type))
|
||||||
{
|
{
|
||||||
R.Text = Math.Round(Convert.ToDouble(p.Text) * Convert.ToDouble(l.Text) / Convert.ToDouble(S.Text),4).ToString();
|
Numbers.R = Numbers.p * Numbers.l / Numbers.S;
|
||||||
Log(p.Text + " Кл * " + l.Text + " м / " + S.Text + " мм^2 = " + R.Text + " Ом");
|
R.Text = Math.Round(Numbers.R, 4).ToString();
|
||||||
}
|
}
|
||||||
if(IsReady(R,type))
|
if(IsReady(R,type))
|
||||||
{
|
{
|
||||||
S.Text = Math.Round(Convert.ToDouble(p.Text) * Convert.ToDouble(l.Text) / Convert.ToDouble(R.Text),4).ToString();
|
Numbers.S = Numbers.p * Numbers.l / Numbers.R;
|
||||||
Log(p.Text + " Кл * " + l.Text + " м / " + R.Text + " Ом = " + S.Text + " мм^2");
|
S.Text = Math.Round(Numbers.S, 4).ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(IsReady(R,type))
|
if(IsReady(R,type))
|
||||||
{
|
{
|
||||||
if(IsReady(S,type))
|
if(IsReady(S,type))
|
||||||
{
|
{
|
||||||
l.Text = Math.Round(Convert.ToDouble(R.Text) * Convert.ToDouble(S.Text) / Convert.ToDouble(p.Text),4).ToString();
|
Numbers.l = Numbers.R * Numbers.S / Numbers.p;
|
||||||
Log(R.Text + " Ом * " + S.Text + " мм^2 / " + p.Text + " Кл = " + l.Text + " м");
|
l.Text = Math.Round(Numbers.l, 4).ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "l":
|
case "l":
|
||||||
if(IsReady(l,type))
|
if (!Math.Round(Numbers.p, 4).Equals(p.Text) && IsReady(p, type)) Numbers.p = (float)Convert.ToDouble(p.Text);
|
||||||
|
if (!Math.Round(Numbers.l, 4).Equals(l.Text) && IsReady(l, type)) Numbers.l = (float)Convert.ToDouble(l.Text);
|
||||||
|
if (!Math.Round(Numbers.S, 4).Equals(S.Text) && IsReady(S, type)) Numbers.S = (float)Convert.ToDouble(S.Text);
|
||||||
|
if (!Math.Round(Numbers.R, 4).Equals(R.Text) && IsReady(R, type)) Numbers.R = (float)Convert.ToDouble(R.Text);
|
||||||
|
if (IsReady(l,type))
|
||||||
{
|
{
|
||||||
if(IsReady(p,type))
|
if(IsReady(p,type))
|
||||||
{
|
{
|
||||||
if(IsReady(S,type))
|
if(IsReady(S,type))
|
||||||
{
|
{
|
||||||
R.Text = Math.Round(Convert.ToDouble(p.Text) * Convert.ToDouble(l.Text) / Convert.ToDouble(S.Text),4).ToString();
|
Numbers.R = Numbers.p * Numbers.l / Numbers.S;
|
||||||
Log(p.Text + " Кл * " + l.Text + " м / " + S.Text + " мм^2 = " + R.Text + " Ом");
|
R.Text = Math.Round(Numbers.R, 4).ToString();
|
||||||
}
|
}
|
||||||
if(IsReady(R,type))
|
if(IsReady(R,type))
|
||||||
{
|
{
|
||||||
S.Text = Math.Round(Convert.ToDouble(p.Text) * Convert.ToDouble(l.Text) / Convert.ToDouble(R.Text),4).ToString();
|
Numbers.S = Numbers.p * Numbers.l / Numbers.R;
|
||||||
Log(p.Text + " Кл * " + l.Text + " м / " + R.Text + " Ом = " + S.Text + " мм^2");
|
S.Text = Math.Round(Numbers.S, 4).ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(IsReady(R,type))
|
if(IsReady(R,type))
|
||||||
{
|
{
|
||||||
if(IsReady(S,type))
|
if(IsReady(S,type))
|
||||||
{
|
{
|
||||||
p.Text = Math.Round(Convert.ToDouble(R.Text) * Convert.ToDouble(S.Text) / Convert.ToDouble(l.Text),4).ToString();
|
Numbers.p = Numbers.R * Numbers.S / Numbers.l;
|
||||||
Log(R.Text + " Ом * " + S.Text + " мм^2 / " + l.Text + " м = " + p.Text + " Кл");
|
p.Text = Math.Round(Numbers.p, 4).ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "S":
|
case "S":
|
||||||
if(IsReady(S,type))
|
if (!Math.Round(Numbers.p, 4).Equals(p.Text) && IsReady(p, type)) Numbers.p = (float)Convert.ToDouble(p.Text);
|
||||||
|
if (!Math.Round(Numbers.l, 4).Equals(l.Text) && IsReady(l, type)) Numbers.l = (float)Convert.ToDouble(l.Text);
|
||||||
|
if (!Math.Round(Numbers.S, 4).Equals(S.Text) && IsReady(S, type)) Numbers.S = (float)Convert.ToDouble(S.Text);
|
||||||
|
if (!Math.Round(Numbers.R, 4).Equals(R.Text) && IsReady(R, type)) Numbers.R = (float)Convert.ToDouble(R.Text);
|
||||||
|
if (IsReady(S,type))
|
||||||
{
|
{
|
||||||
if(IsReady(p,type))
|
if(IsReady(p,type))
|
||||||
{
|
{
|
||||||
if(IsReady(l,type))
|
if(IsReady(l,type))
|
||||||
{
|
{
|
||||||
R.Text = Math.Round(Convert.ToDouble(p.Text) * Convert.ToDouble(l.Text) / Convert.ToDouble(S.Text),4).ToString();
|
Numbers.R = Numbers.p * Numbers.l / Numbers.S;
|
||||||
Log(p.Text + " Кл * " + l.Text + " м / " + S.Text + " мм^2 = " + R.Text + " Ом");
|
R.Text = Math.Round(Numbers.R, 4).ToString();
|
||||||
}
|
}
|
||||||
if(IsReady(R,type))
|
if(IsReady(R,type))
|
||||||
{
|
{
|
||||||
l.Text = Math.Round(Convert.ToDouble(R.Text) * Convert.ToDouble(S.Text) / Convert.ToDouble(p.Text),4).ToString();
|
Numbers.l = Numbers.R * Numbers.S / Numbers.p;
|
||||||
Log(R.Text + " Ом * " + S.Text + " мм^2 / " + p.Text + " Кл = " + l.Text + " м");
|
l.Text = Math.Round(Numbers.l, 4).ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(IsReady(R,type))
|
if(IsReady(R,type))
|
||||||
{
|
{
|
||||||
if(IsReady(l,type))
|
if(IsReady(l,type))
|
||||||
{
|
{
|
||||||
p.Text = Math.Round(Convert.ToDouble(R.Text) * Convert.ToDouble(S.Text) / Convert.ToDouble(l.Text),4).ToString();
|
Numbers.p = Numbers.R * Numbers.S / Numbers.l;
|
||||||
Log(R.Text + " Ом * " + S.Text + " мм^2 / " + l.Text + " м = " + p.Text + " Кл");
|
p.Text = Math.Round(Numbers.p, 4).ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TC(object sender, TextChangedEventArgs e)
|
private void TC(object sender, TextChangedEventArgs e)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "BC7C2D608DE8DFDBE203A54118EB5EE369C484E3"
|
#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "207B856E591731B90719928E80E005EA9BC4B229A156467084A5BA966B3C05AF"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// Этот код создан программой.
|
// Этот код создан программой.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "BC7C2D608DE8DFDBE203A54118EB5EE369C484E3"
|
#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "207B856E591731B90719928E80E005EA9BC4B229A156467084A5BA966B3C05AF"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// Этот код создан программой.
|
// Этот код создан программой.
|
||||||
|
Binary file not shown.
@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "CC0A0916C214BEC2ABB76527EE89F66AC08038FC"
|
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "C940A7EC1C1F318B915586DB854312BE5B4E31302B1570EA55356EFCBCA6ED7F"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// Этот код создан программой.
|
// Этот код создан программой.
|
||||||
@ -120,6 +120,14 @@ namespace PhysFormuler {
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
|
|
||||||
|
#line 71 "..\..\MainWindow.xaml"
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
||||||
|
internal System.Windows.Controls.ListBox Logger;
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
|
||||||
private bool _contentLoaded;
|
private bool _contentLoaded;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -240,6 +248,9 @@ namespace PhysFormuler {
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
return;
|
return;
|
||||||
|
case 11:
|
||||||
|
this.Logger = ((System.Windows.Controls.ListBox)(target));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
this._contentLoaded = true;
|
this._contentLoaded = true;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "CC0A0916C214BEC2ABB76527EE89F66AC08038FC"
|
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "C940A7EC1C1F318B915586DB854312BE5B4E31302B1570EA55356EFCBCA6ED7F"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// Этот код создан программой.
|
// Этот код создан программой.
|
||||||
@ -120,6 +120,14 @@ namespace PhysFormuler {
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
|
|
||||||
|
#line 71 "..\..\MainWindow.xaml"
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
||||||
|
internal System.Windows.Controls.ListBox Logger;
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
|
||||||
private bool _contentLoaded;
|
private bool _contentLoaded;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -240,6 +248,9 @@ namespace PhysFormuler {
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
return;
|
return;
|
||||||
|
case 11:
|
||||||
|
this.Logger = ((System.Windows.Controls.ListBox)(target));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
this._contentLoaded = true;
|
this._contentLoaded = true;
|
||||||
}
|
}
|
||||||
|
@ -13,3 +13,18 @@ C:\Users\Илья\Source\Repos\Dev_PhysFormuler\PhysFormuler\obj\Debug\PhysFormu
|
|||||||
C:\Users\Илья\Source\Repos\Dev_PhysFormuler\PhysFormuler\obj\Debug\PhysFormuler.csproj.CoreCompileInputs.cache
|
C:\Users\Илья\Source\Repos\Dev_PhysFormuler\PhysFormuler\obj\Debug\PhysFormuler.csproj.CoreCompileInputs.cache
|
||||||
C:\Users\Илья\Source\Repos\Dev_PhysFormuler\PhysFormuler\obj\Debug\PhysFormuler.exe
|
C:\Users\Илья\Source\Repos\Dev_PhysFormuler\PhysFormuler\obj\Debug\PhysFormuler.exe
|
||||||
C:\Users\Илья\Source\Repos\Dev_PhysFormuler\PhysFormuler\obj\Debug\PhysFormuler.pdb
|
C:\Users\Илья\Source\Repos\Dev_PhysFormuler\PhysFormuler\obj\Debug\PhysFormuler.pdb
|
||||||
|
C:\Users\Илья\Source\Repos\PhysFormuler\bin\Debug\PhysFormuler.exe.config
|
||||||
|
C:\Users\Илья\Source\Repos\PhysFormuler\bin\Debug\PhysFormuler.exe
|
||||||
|
C:\Users\Илья\Source\Repos\PhysFormuler\bin\Debug\PhysFormuler.pdb
|
||||||
|
C:\Users\Илья\Source\Repos\PhysFormuler\obj\Debug\PhysFormuler.csprojAssemblyReference.cache
|
||||||
|
C:\Users\Илья\Source\Repos\PhysFormuler\obj\Debug\MainWindow.g.cs
|
||||||
|
C:\Users\Илья\Source\Repos\PhysFormuler\obj\Debug\App.g.cs
|
||||||
|
C:\Users\Илья\Source\Repos\PhysFormuler\obj\Debug\PhysFormuler_MarkupCompile.cache
|
||||||
|
C:\Users\Илья\Source\Repos\PhysFormuler\obj\Debug\PhysFormuler_MarkupCompile.lref
|
||||||
|
C:\Users\Илья\Source\Repos\PhysFormuler\obj\Debug\MainWindow.baml
|
||||||
|
C:\Users\Илья\Source\Repos\PhysFormuler\obj\Debug\PhysFormuler.g.resources
|
||||||
|
C:\Users\Илья\Source\Repos\PhysFormuler\obj\Debug\PhysFormuler.Properties.Resources.resources
|
||||||
|
C:\Users\Илья\Source\Repos\PhysFormuler\obj\Debug\PhysFormuler.csproj.GenerateResource.cache
|
||||||
|
C:\Users\Илья\Source\Repos\PhysFormuler\obj\Debug\PhysFormuler.csproj.CoreCompileInputs.cache
|
||||||
|
C:\Users\Илья\Source\Repos\PhysFormuler\obj\Debug\PhysFormuler.exe
|
||||||
|
C:\Users\Илья\Source\Repos\PhysFormuler\obj\Debug\PhysFormuler.pdb
|
||||||
|
Binary file not shown.
@ -1,4 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
FC:\Users\Илья\Source\Repos\Dev_PhysFormuler\PhysFormuler\MainWindow.xaml;;
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
|
|
||||||
FC:\Users\Илья\Source\Repos\Dev_PhysFormuler\PhysFormuler\MainWindow.xaml;;
|
FC:\Users\Илья\Source\Repos\PhysFormuler\MainWindow.xaml;;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "BC7C2D608DE8DFDBE203A54118EB5EE369C484E3"
|
#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "207B856E591731B90719928E80E005EA9BC4B229A156467084A5BA966B3C05AF"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// Этот код создан программой.
|
// Этот код создан программой.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "BC7C2D608DE8DFDBE203A54118EB5EE369C484E3"
|
#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "207B856E591731B90719928E80E005EA9BC4B229A156467084A5BA966B3C05AF"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// Этот код создан программой.
|
// Этот код создан программой.
|
||||||
|
Binary file not shown.
@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "7753B25EBBD66BE430FC2FD0B52EBF5B1AD812A8"
|
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "C940A7EC1C1F318B915586DB854312BE5B4E31302B1570EA55356EFCBCA6ED7F"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// Этот код создан программой.
|
// Этот код создан программой.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "7753B25EBBD66BE430FC2FD0B52EBF5B1AD812A8"
|
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "C940A7EC1C1F318B915586DB854312BE5B4E31302B1570EA55356EFCBCA6ED7F"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// Этот код создан программой.
|
// Этот код создан программой.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
|
|
||||||
FC:\Users\Илья\Source\Repos\Dev_PhysFormuler\PhysFormuler\MainWindow.xaml;;
|
FC:\Users\Илья\Source\Repos\PhysFormuler\MainWindow.xaml;;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user