-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.cs
69 lines (56 loc) · 2.28 KB
/
Form1.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
using System;
using System.Collections.Generic;
using Powerline;
namespace Powerline
{
public partial class PowerlinePilot : Form
{
public PowerlinePilot()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
PassengerCar MyPS = new()
{
CurrentSpeed = (byte)numCurrentSpeed.Value,
FuelTankCapacity = (byte)numFuelTankCapacity.Value,
FuelLeftPercentage = (byte)numFuelLeftPercentage.Value,
AverageFuelConsumptionPer100 = (byte)numAverageFuelConsumptionPer100.Value,
NumberOfPassengers = (byte)numNumberOfPassengers.Value
};
lblDistanceLeft.Text = MyPS.DistanceLeft().ToString("0");
lblMinutesToFullstop.Text = MyPS.MinutesToFullstop().ToString("0");
//Console.WriteLine("Passenger car will go another: {0} km.", MyPS.DistanceLeft());
//Console.WriteLine("Passenger car will go for another: {0} min.", MyPS.MinutesToFullstop());
// Console.WriteLine("Truck will go another: {0} km.", MyT.DistanceLeft());
// Console.WriteLine("Truck will go for another: {0} min.", MyT.MinutesToFullstop());
}
private void lblDistanceLeft_Click(object sender, EventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
private void lblAverageFuelConsumptionPer100_Click(object sender, EventArgs e)
{
}
private void groupBox1_Enter(object sender, EventArgs e)
{
}
private void button1_Click_1(object sender, EventArgs e)
{
// comment
Truck MyT = new()
{
CurrentSpeed = (byte)numTCurrentSpeed.Value,
FuelTankCapacity = (byte)numTFuelTankCapacity.Value,
FuelLeftPercentage = (byte)numTFuelLeftPercentage.Value,
AverageFuelConsumptionPer100 = (byte)numTAverageFuelConsumptionPer100.Value,
CurrentLoad = (int)numTCurrentLoad.Value
};
lblTDistanceLeft.Text = MyT.DistanceLeft().ToString("0");
lblTMinutesToFullstop.Text = MyT.MinutesToFullstop().ToString("0");
}
}
}