-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFountainProject.cs
64 lines (49 loc) · 1.9 KB
/
FountainProject.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
/* FountainProject is the top level within Fountain Design. It expects a set of nozzles that
* create various effects. (Inspiration https://www.fountainpeople.com/products.)
*
* BIG CHALLENGE, I don't know how to set up get, set.
*
* SOMEDAY: static int ProjectCost = 10000; // cost constraint in dollars
*
*/
// TODO Get the logger to work again, and make meaningful entries.
// string myMsg = Model_ID + ": " + effectHeight + " = " + thisPressure;
// Logger.logEntry("Info", myMsg);
using System;
//MARK Global rename for namespace: Ctrl-R, Ctrl-R
namespace FountainDesign
{
public class FountainProject
{
public int MaxPressureTotal = 1500; // engineering constraint in PSI
// for simulating system-total pressure states
public static byte countLineItem = 3;
//TODO Enable a varying number of line-items (requires change to array count)
public FixtureWater[] myWaterFixtures = new FixtureWater[countLineItem];
public void FountainProjectBegin()
{
myWaterFixtures = new FixtureWater[3]; //TODO should be countLineItem
}
public int getTotalPressure()
{
int totalPressure = 0;
int myPressure;
int myQuantity;
for (int i = 0; i < myWaterFixtures.Length; i++)
{
myPressure = myWaterFixtures[i].effectPressure;
myQuantity = myWaterFixtures[i].quantity;
myPressure = myPressure * myQuantity;
totalPressure += myPressure;
}
// Ensure MaxPressureTotal is not exceeded.
// TODO Raise flag in UI if it is exceeded.
if ((int)totalPressure > MaxPressureTotal)
{
totalPressure = MaxPressureTotal;
}
return totalPressure;
}
}
}