merge Develop into master #9
@@ -13,9 +13,9 @@ namespace ProftaakRH
|
|||||||
{
|
{
|
||||||
IDataReceiver dataReceiver = new DataConverter();
|
IDataReceiver dataReceiver = new DataConverter();
|
||||||
BLEHandler bLEHandler = new BLEHandler(dataReceiver);
|
BLEHandler bLEHandler = new BLEHandler(dataReceiver);
|
||||||
//BikeSimulator bikeSimulator = new BikeSimulator(dataConverter);
|
BikeSimulator bikeSimulator = new BikeSimulator(dataReceiver);
|
||||||
//bikeSimulator.setResistance(bikeSimulator.GenerateResistance(1f));
|
bikeSimulator.setResistance(bikeSimulator.GenerateResistance(1f));
|
||||||
//bikeSimulator.StartSimulation();
|
bikeSimulator.StartSimulation();
|
||||||
|
|
||||||
|
|
||||||
bool running = true;
|
bool running = true;
|
||||||
|
|||||||
@@ -131,7 +131,36 @@ namespace RH_Engine
|
|||||||
return JsonConvert.SerializeObject(Payload(payload));
|
return JsonConvert.SerializeObject(Payload(payload));
|
||||||
}
|
}
|
||||||
|
|
||||||
public string bikeSpeed(string uuidPanel)
|
public string ColorPanel(string uuidPanel)
|
||||||
|
{
|
||||||
|
dynamic payload = new
|
||||||
|
{
|
||||||
|
id = "scene/panel/setclearcolor",
|
||||||
|
data = new
|
||||||
|
{
|
||||||
|
id = uuidPanel,
|
||||||
|
color = new int[] { 1, 1, 1, 1 }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return JsonConvert.SerializeObject(Payload(payload));
|
||||||
|
}
|
||||||
|
|
||||||
|
public string SwapPanel(string uuid)
|
||||||
|
{
|
||||||
|
dynamic payload = new
|
||||||
|
{
|
||||||
|
id = "scene/panel/swap",
|
||||||
|
data = new
|
||||||
|
{
|
||||||
|
id = uuid
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return JsonConvert.SerializeObject(Payload(payload));
|
||||||
|
}
|
||||||
|
|
||||||
|
public string bikeSpeed(string uuidPanel, double speed)
|
||||||
{
|
{
|
||||||
dynamic payload = new
|
dynamic payload = new
|
||||||
{
|
{
|
||||||
@@ -140,7 +169,7 @@ namespace RH_Engine
|
|||||||
{
|
{
|
||||||
id = uuidPanel,
|
id = uuidPanel,
|
||||||
text = "Bike speed placeholder",
|
text = "Bike speed placeholder",
|
||||||
position = new int[] { 100, 100 },
|
position = new int[] { 0, 0 },
|
||||||
size = 32.0,
|
size = 32.0,
|
||||||
color = new int[] { 0, 0, 0, 1 },
|
color = new int[] { 0, 0, 0, 1 },
|
||||||
font = "segoeui"
|
font = "segoeui"
|
||||||
|
|||||||
@@ -175,10 +175,12 @@ namespace RH_Engine
|
|||||||
string uuidPanel = JSONParser.getPanelID(response);
|
string uuidPanel = JSONParser.getPanelID(response);
|
||||||
WriteTextMessage(stream, mainCommand.ClearPanel(uuidPanel));
|
WriteTextMessage(stream, mainCommand.ClearPanel(uuidPanel));
|
||||||
Console.WriteLine(ReadPrefMessage(stream));
|
Console.WriteLine(ReadPrefMessage(stream));
|
||||||
WriteTextMessage(stream, mainCommand.bikeSpeed(uuidPanel));
|
WriteTextMessage(stream, mainCommand.bikeSpeed(uuidPanel, 2.42));
|
||||||
Console.WriteLine(ReadPrefMessage(stream));
|
Console.WriteLine(ReadPrefMessage(stream));
|
||||||
|
WriteTextMessage(stream, mainCommand.ColorPanel(uuidPanel));
|
||||||
WriteTextMessage(stream, mainCommand.SwapPanelCommand(uuidPanel));
|
Console.WriteLine("Color panel: " + ReadPrefMessage(stream));
|
||||||
|
WriteTextMessage(stream, mainCommand.SwapPanel(uuidPanel));
|
||||||
|
Console.WriteLine("Swap panel: " + ReadPrefMessage(stream));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user