Develop #10
@@ -163,6 +163,9 @@ namespace ClientApp.Utils
|
|||||||
sendMessage(DataParser.getSetResistanceResponseJson(true));
|
sendMessage(DataParser.getSetResistanceResponseJson(true));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case DataParser.MESSAGE:
|
||||||
|
engineConnection.DoctorMessage = DataParser.getChatMessageFromJson(payloadbytes);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
Console.WriteLine($"Received json with identifier {identifier}:\n{Encoding.ASCII.GetString(payloadbytes)}");
|
Console.WriteLine($"Received json with identifier {identifier}:\n{Encoding.ASCII.GetString(payloadbytes)}");
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ namespace ClientApp.Utils
|
|||||||
private static string headId = string.Empty;
|
private static string headId = string.Empty;
|
||||||
private static string groundPlaneId = string.Empty;
|
private static string groundPlaneId = string.Empty;
|
||||||
private static string terrainId = string.Empty;
|
private static string terrainId = string.Empty;
|
||||||
private static string lastMessage = "No message received yet";
|
|
||||||
|
|
||||||
|
public string DoctorMessage { get; set; };
|
||||||
public float BikeSpeed { get; set; }
|
public float BikeSpeed { get; set; }
|
||||||
public float BikePower { get; set; }
|
public float BikePower { get; set; }
|
||||||
public float BikeBPM { get; set; }
|
public float BikeBPM { get; set; }
|
||||||
@@ -65,6 +65,7 @@ namespace ClientApp.Utils
|
|||||||
BikePower = 0;
|
BikePower = 0;
|
||||||
BikeBPM = 0;
|
BikeBPM = 0;
|
||||||
BikeResistance = 50;
|
BikeResistance = 50;
|
||||||
|
DoctorMessage = "No message received yet";
|
||||||
updateTimer = new System.Timers.Timer(1000);
|
updateTimer = new System.Timers.Timer(1000);
|
||||||
updateTimer.Elapsed += UpdateTimer_Elapsed;
|
updateTimer.Elapsed += UpdateTimer_Elapsed;
|
||||||
updateTimer.AutoReset = true;
|
updateTimer.AutoReset = true;
|
||||||
@@ -324,7 +325,7 @@ namespace ClientApp.Utils
|
|||||||
{
|
{
|
||||||
// TODO check if is drawn
|
// TODO check if is drawn
|
||||||
});
|
});
|
||||||
SendMessageAndOnResponse(mainCommand.showMessage(panelId, "message", lastMessage), "message",
|
SendMessageAndOnResponse(mainCommand.showMessage(panelId, "message", DoctorMessage), "message",
|
||||||
(message) =>
|
(message) =>
|
||||||
{
|
{
|
||||||
// TODO check if is drawn
|
// TODO check if is drawn
|
||||||
|
|||||||
Reference in New Issue
Block a user