Panel now shows more data
This commit is contained in:
@@ -164,7 +164,7 @@ namespace RH_Engine
|
||||
return JsonConvert.SerializeObject(Payload(payload));
|
||||
}
|
||||
|
||||
public string bikeSpeed(string uuidPanel, string serialCode, double speed)
|
||||
private string showOnPanel(string uuidPanel, string serialCode, string mText, int index)
|
||||
{
|
||||
dynamic payload = new
|
||||
{
|
||||
@@ -173,9 +173,9 @@ namespace RH_Engine
|
||||
data = new
|
||||
{
|
||||
id = uuidPanel,
|
||||
text = "Speed: " + speed.ToString(),
|
||||
position = new int[] { 4, 24 },
|
||||
size = 36.0,
|
||||
text = mText,
|
||||
position = new int[] { 4, 24 + index * 32 },
|
||||
size = 32.0,
|
||||
color = new int[] { 0, 0, 0, 1 },
|
||||
font = "segoeui"
|
||||
}
|
||||
@@ -184,6 +184,43 @@ namespace RH_Engine
|
||||
return JsonConvert.SerializeObject(Payload(payload));
|
||||
}
|
||||
|
||||
|
||||
public string showBikespeed(string uuidPanel, string serialCode, double speed)
|
||||
{
|
||||
//dynamic payload = new
|
||||
//{
|
||||
// id = "scene/panel/drawtext",
|
||||
// serial = serialCode,
|
||||
// data = new
|
||||
// {
|
||||
// id = uuidPanel,
|
||||
// text = "Speed: " + speed + " m/s",
|
||||
// position = new int[] { 4, 24 },
|
||||
// size = 36.0,
|
||||
// color = new int[] { 0, 0, 0, 1 },
|
||||
// font = "segoeui"
|
||||
// }
|
||||
//};
|
||||
|
||||
//return JsonConvert.SerializeObject(Payload(payload));
|
||||
return showOnPanel(uuidPanel, serialCode, "Speed: " + speed + " m/s", 0);
|
||||
}
|
||||
|
||||
public string showHeartrate(string uuidPanel, string serialCode, int bpm)
|
||||
{
|
||||
return showOnPanel(uuidPanel, serialCode, "Heartrate: " + bpm + " bpm", 1);
|
||||
}
|
||||
|
||||
public string showPower(string uuidPanel, string serialCode, double power)
|
||||
{
|
||||
return showOnPanel(uuidPanel, serialCode, "Inst. Power: " + power + " W", 2);
|
||||
}
|
||||
|
||||
public string showResistance(string uuidPanel, string serialCode, double resistance)
|
||||
{
|
||||
return showOnPanel(uuidPanel, serialCode, "Resistance: " + resistance + " %", 3);
|
||||
}
|
||||
|
||||
public string SwapPanelCommand(string uuid)
|
||||
{
|
||||
dynamic payload = new
|
||||
|
||||
Reference in New Issue
Block a user