Added time panel

This commit is contained in:
2015-10-21 16:50:09 +02:00
parent 7f32a5edf3
commit b4fc8c2dfa
3 changed files with 18 additions and 4 deletions
@@ -50,6 +50,7 @@ namespace ErgometerApplication
this.power = new PanelClientData("Weerstand", 25, 400);
this.energy = new PanelClientData("Energie", 0, 200);
this.actualpower = new PanelClientData("Absolute Weerstand", 0, 400);
this.time = new PanelClientData("Tijd", 0, 400);
this.panelClientContainer.SuspendLayout();
this.panelTopBar.SuspendLayout();
@@ -87,6 +88,7 @@ namespace ErgometerApplication
this.panelDataViewLeft.Controls.Add(power);
this.panelDataViewLeft.Controls.Add(energy);
this.panelDataViewLeft.Controls.Add(actualpower);
this.panelDataViewLeft.Controls.Add(time);
//
// panelClientChat
@@ -178,7 +180,7 @@ namespace ErgometerApplication
private System.Windows.Forms.Button buttonLogOff;
private System.Windows.Forms.Label labelUsername;
private System.Windows.Forms.Label labelHallo;
public PanelClientData heartBeat, RPM, speed, distance, power, energy, seconds, actualpower;
public PanelClientData heartBeat, RPM, speed, distance, power, energy, seconds, actualpower, time;
}
@@ -47,6 +47,7 @@ namespace ErgometerApplication
power.updateValue(m.Power);
energy.updateValue(m.Energy);
actualpower.updateValue(m.ActualPower);
time.updateValue(m.Seconds);
if (count >= 10)
{
@@ -15,11 +15,13 @@ namespace ErgometerApplication
private int min;
private int max;
private string name;
public PanelClientData(string name, int min, int max) : base()
{
this.min = min;
this.max = max;
this.name = name;
this.metingName = new System.Windows.Forms.Label();
this.progressBarMeting = new System.Windows.Forms.ProgressBar();
@@ -30,7 +32,8 @@ namespace ErgometerApplication
this.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.Controls.Add(this.labelMetingCurrentValue);
this.Controls.Add(this.progressBarMeting);
if(name != "Tijd")
this.Controls.Add(this.progressBarMeting);
this.Controls.Add(this.metingName);
this.Dock = System.Windows.Forms.DockStyle.Top;
this.Location = new System.Drawing.Point(0, 0);
@@ -74,8 +77,16 @@ namespace ErgometerApplication
public void updateValue(int value)
{
this.labelMetingCurrentValue.Text = value.ToString();
this.progressBarMeting.Value = ValueToPercentage(value);
if (name == "Tijd")
{
this.labelMetingCurrentValue.Text = (value / 60) + ":" + (value % 60);
}
else
{
this.labelMetingCurrentValue.Text = value.ToString();
this.progressBarMeting.Value = ValueToPercentage(value);
}
}
public void updateValue(double value)