diff --git a/ErgometerApplication/ErgometerApplication/ClientApplicatie.Designer.cs b/ErgometerApplication/ErgometerApplication/ClientApplicatie.Designer.cs index d130b9e..9b19b4f 100644 --- a/ErgometerApplication/ErgometerApplication/ClientApplicatie.Designer.cs +++ b/ErgometerApplication/ErgometerApplication/ClientApplicatie.Designer.cs @@ -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; } diff --git a/ErgometerApplication/ErgometerApplication/ClientApplicatie.cs b/ErgometerApplication/ErgometerApplication/ClientApplicatie.cs index 82d0c67..96b84d5 100644 --- a/ErgometerApplication/ErgometerApplication/ClientApplicatie.cs +++ b/ErgometerApplication/ErgometerApplication/ClientApplicatie.cs @@ -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) { diff --git a/ErgometerApplication/ErgometerApplication/PanelClientData.cs b/ErgometerApplication/ErgometerApplication/PanelClientData.cs index 375a764..0d4e07b 100644 --- a/ErgometerApplication/ErgometerApplication/PanelClientData.cs +++ b/ErgometerApplication/ErgometerApplication/PanelClientData.cs @@ -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)