Remove dead QUpdater code

This commit is contained in:
Joel Wetzell
2020-06-12 08:11:53 -05:00
parent 1a5835075d
commit 76a2f1c5ec
3 changed files with 1 additions and 52 deletions
@@ -21,7 +21,6 @@ namespace qController.Communication
{
this.port = port;
this.ipAddress = address;
qClient = new QClient(ipAddress, port);
qUpdater = new QUpdater(this);
@@ -75,8 +74,6 @@ namespace qController.Communication
public void Kill(){
Log.Debug("QCONTROLLER - Killing");
if (qUpdater != null)
qUpdater.Kill();
if (qClient != null)
qClient.Close();
}
@@ -1,24 +1,15 @@
//Class used for updating local "copy" of workspace info, cue-lists, cues, etc.
using System;
using System.Threading;
using Serilog;
using Xamarin.Forms;
using Serilog;
namespace qController.Communication
{
public class QUpdater
{
private bool active = true;
private bool started = false;
private QController qController;
private Thread updateThread;
private QController qController;
public QUpdater(QController controller)
{
qController = controller;
updateThread = new Thread(new ThreadStart(UpdateLoop));
qController.qClient.qParser.CueInfoUpdated += OnCueUpdateReceived;
qController.qClient.qParser.WorkspaceUpdated += OnWorkspaceUpdated;
qController.qClient.qParser.PlaybackPositionUpdated += OnPlaybackPositionUpdated;
@@ -40,33 +31,6 @@ namespace qController.Communication
private void OnWorkspaceLoadError(object source, WorkspaceEventArgs args)
{
Log.Debug("QUPDATER - Loading cuelists has failed for some reason retrying");
//qController.qClient.sendArgsUDP("/workspace/" + args.UpdatedWorkspace.workspace_id + "/connect");
//qController.qClient.sendArgsUDP("/workspace/" + args.UpdatedWorkspace.workspace_id + "/updates", 1);
//qController.qClient.sendTCP("/workspace/" + args.UpdatedWorkspace.workspace_id + "/cueLists");
}
public void Start(){
Log.Debug("QUPDATER - Start() method called");
try
{
//updateThread.Start();
Log.Debug("QUPDATER - updateThread started");
}
catch (ThreadStateException tSe)
{
Log.Debug("QUPDATER - updateThread already started");
}
}
//Attempt at a "keep alive" message
public void UpdateLoop()
{
active = true;
Device.StartTimer(TimeSpan.FromSeconds(5.0), () => {
SendThump();
return active;
});
}
public void OnCueUpdateReceived(object source, CueEventArgs args)
@@ -101,16 +65,5 @@ namespace qController.Communication
Log.Debug("QUPDATER - Update Specific Cue Called because of Playback Position Updated");
qController.qClient.UpdateSpecificCue(qController.qWorkspace.workspace_id,args.PlaybackPosition);
}
public void SendThump()
{
qController.qClient.sendTCP("/workspace/" + qController.qWorkspace.workspace_id + "/thump");
}
public void Kill(){
active = false;
updateThread.Abort();
}
}
}
@@ -61,7 +61,6 @@ namespace qController
Log.Debug($"CONTROLPAGE - Connection Status Changed: {args.WorkspaceId} : {args.Status}");
if (args.Status.Equals("ok"))
{
qController.qUpdater.Start();
Device.BeginInvokeOnMainThread(() => {
FinishUI();
});