Add logging to R case
This commit is contained in:
parent
6163f0d316
commit
2ae37ae85e
@ -37,7 +37,7 @@ namespace PhysFormuler
|
||||
if (box.Text != "")
|
||||
{
|
||||
double number;
|
||||
if (Double.TryParse(box.Text,out number))
|
||||
if (Double.TryParse(box.Text, out number))
|
||||
{
|
||||
return !double.IsNaN(number);
|
||||
}
|
||||
@ -56,19 +56,19 @@ namespace PhysFormuler
|
||||
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(U, type))
|
||||
{
|
||||
if (IsReady(R, type))
|
||||
{
|
||||
Numbers.I = Numbers.U / Numbers.R;
|
||||
I.Text = Math.Round(Numbers.I, 4).ToString();
|
||||
Logger.Items.Add(Numbers.U + "В / " + Numbers.R + "Ом = " + I.Text + "А");
|
||||
Logger.Items.Add(Numbers.U + "В / " + Numbers.R + "ом = " + I.Text + "А");
|
||||
}
|
||||
if (IsReady(I, type))
|
||||
{
|
||||
Numbers.R = Numbers.U / Numbers.I;
|
||||
R.Text = Math.Round(Numbers.R, 4).ToString();
|
||||
Logger.Items.Add(Numbers.U + "В / " + Numbers.I + "А = " + R.Text + "Ом");
|
||||
Logger.Items.Add(Numbers.U + "В / " + Numbers.I + "А = " + R.Text + "ом");
|
||||
}
|
||||
if (IsReady(q, type))
|
||||
{
|
||||
@ -93,35 +93,40 @@ namespace PhysFormuler
|
||||
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))
|
||||
{
|
||||
Numbers.I = Numbers.U / Numbers.R;
|
||||
I.Text = Math.Round(Numbers.I, 4).ToString();
|
||||
Logger.Items.Add(Numbers.U + "В / " + Numbers.R + "Ом = " + Numbers.I + "А");
|
||||
}
|
||||
if(IsReady(I, type))
|
||||
if (IsReady(I, type))
|
||||
{
|
||||
Numbers.U = Numbers.I * Numbers.R;
|
||||
U.Text = Math.Round(Numbers.U, 4).ToString();
|
||||
Logger.Items.Add(Numbers.I + "А * " + Numbers.R + "ом = " + Numbers.U + "В");
|
||||
}
|
||||
if(IsReady(S,type))
|
||||
if (IsReady(S, type))
|
||||
{
|
||||
if(IsReady(p,type))
|
||||
if (IsReady(p, type))
|
||||
{
|
||||
Numbers.l = Numbers.R * Numbers.S / Numbers.p;
|
||||
l.Text = Math.Round(Numbers.l, 4).ToString();
|
||||
Logger.Items.Add(Numbers.R + "ом * " + Numbers.S + "мм^2 / " + Numbers.p + "ом*м = " + Numbers.l+ "м");
|
||||
}
|
||||
if(IsReady(l,type))
|
||||
if (IsReady(l, type))
|
||||
{
|
||||
Numbers.p = Numbers.R * Numbers.S / Numbers.l;
|
||||
p.Text = Math.Round(Numbers.p, 4).ToString();
|
||||
Logger.Items.Add(Numbers.R + "ом * " + Numbers.S + "мм^2 / " + Numbers.l + "м = " + Numbers.p + "ом*м");
|
||||
}
|
||||
}
|
||||
if(IsReady(p,type))
|
||||
if (IsReady(p, type))
|
||||
{
|
||||
if(IsReady(l,type))
|
||||
if (IsReady(l, type))
|
||||
{
|
||||
Numbers.S = Numbers.p * Numbers.l / Numbers.R;
|
||||
S.Text = Math.Round(Numbers.S, 4).ToString();
|
||||
Logger.Items.Add(Numbers.p + "ом*м * " + Numbers.l + "м / " + Numbers.R + "ом = " + Numbers.S+ "мм^2");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -144,12 +149,12 @@ namespace PhysFormuler
|
||||
Numbers.R = Numbers.U / Numbers.I;
|
||||
R.Text = Math.Round(Numbers.R, 4).ToString();
|
||||
}
|
||||
if(IsReady(q, type))
|
||||
if (IsReady(q, type))
|
||||
{
|
||||
Numbers.temp = Numbers.q / Numbers.I;
|
||||
temp.Text = Math.Round(Numbers.temp, 4).ToString();
|
||||
}
|
||||
if(IsReady(temp, type))
|
||||
if (IsReady(temp, type))
|
||||
{
|
||||
Numbers.q = Numbers.I * Numbers.temp;
|
||||
q.Text = Math.Round(Numbers.q, 4).ToString();
|
||||
@ -164,22 +169,22 @@ namespace PhysFormuler
|
||||
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))
|
||||
{
|
||||
Numbers.A = Numbers.U * Numbers.q;
|
||||
A.Text = Math.Round(Numbers.A, 4).ToString();
|
||||
}
|
||||
if(IsReady(I, type))
|
||||
if (IsReady(I, type))
|
||||
{
|
||||
Numbers.temp = Numbers.q / Numbers.I;
|
||||
temp.Text = Math.Round(Numbers.temp, 4).ToString();
|
||||
}
|
||||
if(IsReady(temp, type))
|
||||
if (IsReady(temp, type))
|
||||
{
|
||||
Numbers.I = Numbers.q / Numbers.temp;
|
||||
I.Text = Math.Round(Numbers.I, 4).ToString();
|
||||
}
|
||||
if(IsReady(A, type))
|
||||
if (IsReady(A, type))
|
||||
{
|
||||
Numbers.U = Numbers.A * Numbers.q;
|
||||
U.Text = Math.Round(Numbers.U, 4).ToString();
|
||||
@ -192,12 +197,12 @@ namespace PhysFormuler
|
||||
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))
|
||||
{
|
||||
Numbers.q = Numbers.A / Numbers.U;
|
||||
q.Text = Math.Round(Numbers.q, 4).ToString();
|
||||
}
|
||||
if(IsReady(q, type))
|
||||
if (IsReady(q, type))
|
||||
{
|
||||
Numbers.U = Numbers.A * Numbers.q;
|
||||
U.Text = Math.Round(Numbers.U, 4).ToString();
|
||||
@ -210,12 +215,12 @@ namespace PhysFormuler
|
||||
if (!Math.Round(Numbers.q, 4).Equals(q.Text) && IsReady(q, type)) Numbers.q = (float)Convert.ToDouble(q.Text);
|
||||
if (IsReady(temp, type))
|
||||
{
|
||||
if(IsReady(I, type))
|
||||
if (IsReady(I, type))
|
||||
{
|
||||
Numbers.q = Numbers.I * Numbers.temp;
|
||||
q.Text = Math.Round(Numbers.q, 4).ToString();
|
||||
}
|
||||
if(IsReady(q, type))
|
||||
if (IsReady(q, type))
|
||||
{
|
||||
Numbers.I = Numbers.q / Numbers.temp;
|
||||
I.Text = Math.Round(Numbers.I, 4).ToString();
|
||||
@ -227,24 +232,24 @@ namespace PhysFormuler
|
||||
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(p, type))
|
||||
{
|
||||
if(IsReady(l,type))
|
||||
if (IsReady(l, type))
|
||||
{
|
||||
if(IsReady(S,type))
|
||||
if (IsReady(S, type))
|
||||
{
|
||||
Numbers.R = Numbers.p * Numbers.l / Numbers.S;
|
||||
R.Text = Math.Round(Numbers.R, 4).ToString();
|
||||
}
|
||||
if(IsReady(R,type))
|
||||
if (IsReady(R, type))
|
||||
{
|
||||
Numbers.S = Numbers.p * Numbers.l / Numbers.R;
|
||||
S.Text = Math.Round(Numbers.S, 4).ToString();
|
||||
}
|
||||
}
|
||||
if(IsReady(R,type))
|
||||
if (IsReady(R, type))
|
||||
{
|
||||
if(IsReady(S,type))
|
||||
if (IsReady(S, type))
|
||||
{
|
||||
Numbers.l = Numbers.R * Numbers.S / Numbers.p;
|
||||
l.Text = Math.Round(Numbers.l, 4).ToString();
|
||||
@ -257,24 +262,24 @@ namespace PhysFormuler
|
||||
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(l, type))
|
||||
{
|
||||
if(IsReady(p,type))
|
||||
if (IsReady(p, type))
|
||||
{
|
||||
if(IsReady(S,type))
|
||||
if (IsReady(S, type))
|
||||
{
|
||||
Numbers.R = Numbers.p * Numbers.l / Numbers.S;
|
||||
R.Text = Math.Round(Numbers.R, 4).ToString();
|
||||
}
|
||||
if(IsReady(R,type))
|
||||
if (IsReady(R, type))
|
||||
{
|
||||
Numbers.S = Numbers.p * Numbers.l / Numbers.R;
|
||||
S.Text = Math.Round(Numbers.S, 4).ToString();
|
||||
}
|
||||
}
|
||||
if(IsReady(R,type))
|
||||
if (IsReady(R, type))
|
||||
{
|
||||
if(IsReady(S,type))
|
||||
if (IsReady(S, type))
|
||||
{
|
||||
Numbers.p = Numbers.R * Numbers.S / Numbers.l;
|
||||
p.Text = Math.Round(Numbers.p, 4).ToString();
|
||||
@ -287,24 +292,24 @@ namespace PhysFormuler
|
||||
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(S, type))
|
||||
{
|
||||
if(IsReady(p,type))
|
||||
if (IsReady(p, type))
|
||||
{
|
||||
if(IsReady(l,type))
|
||||
if (IsReady(l, type))
|
||||
{
|
||||
Numbers.R = Numbers.p * Numbers.l / Numbers.S;
|
||||
R.Text = Math.Round(Numbers.R, 4).ToString();
|
||||
}
|
||||
if(IsReady(R,type))
|
||||
if (IsReady(R, type))
|
||||
{
|
||||
Numbers.l = Numbers.R * Numbers.S / Numbers.p;
|
||||
l.Text = Math.Round(Numbers.l, 4).ToString();
|
||||
}
|
||||
}
|
||||
if(IsReady(R,type))
|
||||
if (IsReady(R, type))
|
||||
{
|
||||
if(IsReady(l,type))
|
||||
if (IsReady(l, type))
|
||||
{
|
||||
Numbers.p = Numbers.R * Numbers.S / Numbers.l;
|
||||
p.Text = Math.Round(Numbers.p, 4).ToString();
|
||||
|
Reference in New Issue
Block a user