Switch to only TCP Communication

- No more UDP
- Lots of random refactoring as well
This commit is contained in:
2020-06-06 12:12:23 -05:00
parent ac084bb343
commit fe8bd257d1
32 changed files with 323 additions and 177 deletions
@@ -1,44 +0,0 @@
using Xamarin.Forms;
namespace qController
{
public class QButton : Button
{
public QCommand qCommand
{
get;
set;
}
public QButton(QCommand command)
{
qCommand = command;
Text = qCommand.text;
TextColor = Color.Black;
FontSize = App.HeightUnit * 2.5;
if (qCommand.osc.Contains("go"))
{
BackgroundColor = Color.SeaGreen;
switch (Device.RuntimePlatform)
{
case Device.iOS:
FontSize = App.HeightUnit * 4;
FontAttributes = FontAttributes.Bold;
break;
case Device.Android:
FontSize = App.HeightUnit * 4;
FontAttributes = FontAttributes.Bold;
break;
}
}
else if (qCommand.osc.Contains("panic"))
{
BackgroundColor = Color.IndianRed;
}
else
{
BackgroundColor = Color.FromHex("D8D8D8");
}
}
}
}
@@ -1,8 +1,9 @@
using System;
using System.Collections.Generic;
using Xamarin.Forms;
using qController.Communication;
namespace qController
namespace qController.Cell
{
public class QControlsBlock : Frame
{
@@ -130,7 +131,7 @@ namespace qController
{
string workspace_prefix = "/workspace/" + qController.qWorkspace.workspace_id;
string command = workspace_prefix + ((QButton)sender).qCommand.osc;
qController.qClient.sendUDP(command);
qController.qClient.sendTCP(command);
}
}
}
@@ -1,8 +1,8 @@
using System;
using System.Collections.ObjectModel;
using System.Collections.ObjectModel;
using Xamarin.Forms;
using qController.QItems;
namespace qController
namespace qController.Cell
{
public class QCueListCell : Frame
{
@@ -1,34 +0,0 @@
using Xamarin.Forms;
namespace qController
{
public class QInstance : ViewCell
{
public string name { get; set; }
public string address { get; set; }
public QInstance()
{
}
public QInstance(string tName, string tAddress)
{
name = tName;
address = tAddress;
}
public bool IsReachable()
{
/*try
{
IPAddress instanceIP = IPAddress.Parse(address);
Ping p = new System.Net.NetworkInformation.Ping();
PingReply reply = p.Send(instanceIP);
return reply.Status == IPStatus.Success ? true : false;
}
catch
{
return false;
}*/
return true;
}
}
}
@@ -2,7 +2,7 @@
using Xamarin.Forms;
using Serilog;
namespace qController
namespace qController.Cell
{
public class QInstanceCell : ViewCell
{
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using Xamarin.Forms;
namespace qController
namespace qController.Cell
{
public class QLevelsCell : Frame
{
@@ -1,8 +1,9 @@
using System;
using Acr.UserDialogs;
using qController.QItems;
using Xamarin.Forms;
namespace qController
namespace qController.Cell
{
public class CueEditArgs : EventArgs
{
@@ -1,20 +0,0 @@
using Xamarin.Forms;
namespace qController
{
public class ShadowButton : Frame
{
public ShadowButton(Button b)
{
//Content = b;
HeightRequest = b.Height;
WidthRequest = b.Width;
CornerRadius = b.CornerRadius;
Padding = new Thickness(0);
Content = b;
HasShadow = true;
BorderColor = Color.Black;
IsVisible = false;
}
}
}