-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainForm.cs
140 lines (129 loc) · 3.65 KB
/
MainForm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Physics
{
public interface IMainForm
{
string charSize { get; }
string length { get; }
string emissivity { get; }
string airTemp { get; }
bool isHorizontal { get; }
string[] bottomTemp { get; }
string rayleigh { set; }
string grashof { set; }
string nusselt { set; }
string heatTransferCoeff { set; }
string avTemp { set; }
//string secondParam { set; }
Image formula { set; }
bool grButtonisEnabled { set; }
event EventHandler CalculateClick;
event EventHandler GraphClick;
}
public partial class MainForm : Form, IMainForm
{
public MainForm()
{
InitializeComponent();
CalculateBut.Click += new EventHandler(CalculateBut_Click);
GraphButton.Click += new EventHandler(GraphButton_Click);
}
void CalculateBut_Click(object sender, EventArgs e)
{
if (CalculateClick != null) CalculateClick(this, EventArgs.Empty);
}
void GraphButton_Click(object sender, EventArgs e)
{
if (GraphClick != null) GraphClick(this, EventArgs.Empty);
}
#region Входные параметры
public string charSize
{
get { return charSizeFld.Text; }
}
public string length
{
get { return lengthFld.Text; }
}
public string emissivity
{
get { return emissivityFld.Text; }
}
public bool isHorizontal
{
get { return horizontalRButton.Checked; }
}
public string airTemp
{
get { return airTempFld.Text; }
}
public string[] bottomTemp
{
get {
string[] arr = new string[5];
arr[0] = t1TextBox.Text ;
arr[1] = t2TextBox.Text;
arr[2] = t3TextBox.Text;
arr[3] = t4TextBox.Text;
arr[4] = t5TextBox.Text;
return arr;
}
}
#endregion
#region Вывод результатов
public string avTemp
{
set { avTempTextBox.Text = value; }
}
public string rayleigh
{
set { rayleighFld.Text = value; }
}
public string grashof
{
set { grashofFld.Text = value; }
}
public string nusselt
{
set { nusseltFld.Text = value; }
}
public string heatTransferCoeff
{
set { heatTransferCoeffFld.Text = value; }
}
public bool grButtonisEnabled
{
set { GraphButton.Enabled = value; }
}
public Image formula
{
set
{
if (value == null && equtionPicBox.Image!= null)
equtionPicBox.Image.Dispose();
equtionPicBox.Image = value;
}
}
#endregion
public event EventHandler CalculateClick;
public event EventHandler GraphClick;
private void verticalRButton_CheckedChanged(object sender, EventArgs e)
{
if (isHorizontal)
{
secondParamLabel.Text = "Длина цилиндра";
}
else
{
secondParamLabel.Text = "Диаметр цилиндра D";
}
}
}
}