mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-17 21:24:20 +00:00
initial working maui migration with android only
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace qController.QItems
|
||||
{
|
||||
public class QCue
|
||||
{
|
||||
//info loaded from "/cueLists"
|
||||
public string number { get; set; }
|
||||
public string uniqueID { get; set; }
|
||||
public bool flagged { get; set; }
|
||||
public string listName { get; set; }
|
||||
public string type { get; set; }
|
||||
public string colorName { get; set; }
|
||||
public string name { get; set; }
|
||||
public bool armed { get; set; }
|
||||
|
||||
//info loaded from "/valuesForKeys
|
||||
public decimal translationX { get; set; }
|
||||
public bool isRunning { get; set; }
|
||||
public decimal scaleX { get; set; }
|
||||
public bool isPaused { get; set; }
|
||||
public decimal translationY { get; set; }
|
||||
public decimal preWait { get; set; }
|
||||
public decimal opacity { get; set; }
|
||||
public decimal scaleY { get; set; }
|
||||
public decimal duration { get; set; }
|
||||
public decimal postWait { get; set; }
|
||||
public bool isBroken { get; set; }
|
||||
public string displayName { get; set; }
|
||||
public bool isLoaded { get; set; }
|
||||
public string notes { get; set; }
|
||||
public List<List<double>> levels { get; set; }
|
||||
|
||||
//info loaded from /children
|
||||
public List<QCue> cues { get; set; }
|
||||
|
||||
//get string for icon font from cue type
|
||||
public string getIconString()
|
||||
{
|
||||
return QIcon.GetIconFromType(type);
|
||||
}
|
||||
|
||||
public string IconText
|
||||
{
|
||||
get
|
||||
{
|
||||
return QIcon.GetIconFromType(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace qController.QItems
|
||||
{
|
||||
public class QCueList
|
||||
{
|
||||
public string number { get; set; }
|
||||
public string uniqueID { get; set; }
|
||||
public List<QCue> cues { get; set; }
|
||||
public bool flagged { get; set; }
|
||||
public string listName { get; set; }
|
||||
public string type { get; set; }
|
||||
public string colorName { get; set; }
|
||||
public string name { get; set; }
|
||||
public bool armed { get; set; }
|
||||
|
||||
public string IconText
|
||||
{
|
||||
get
|
||||
{
|
||||
return QIcon.GetIconFromType("Group");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
namespace qController.Classes.Cues
|
||||
{
|
||||
public class QDefinitions
|
||||
{
|
||||
public QDefinitions()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using Microsoft.Maui.Controls.Compatibility;
|
||||
using Microsoft.Maui.Controls;
|
||||
using Microsoft.Maui;
|
||||
|
||||
namespace qController.QItems
|
||||
{
|
||||
public class QInstance
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
//Class pertains to the local copy of a workspace, with methods for fetching/updating information inside
|
||||
using System.Collections.Generic;
|
||||
using Serilog;
|
||||
|
||||
namespace qController.QItems
|
||||
{
|
||||
public class QWorkspace
|
||||
{
|
||||
public string status { get; set; }
|
||||
public List<QCueList> data { get; set; }
|
||||
public string workspace_id { get; set; }
|
||||
public string address { get; set; }
|
||||
public bool IsPopulated { get; set; }
|
||||
|
||||
public string passcode { get; set; }
|
||||
|
||||
//ONLY FOR PASSING A WORKSPACE LOAD ERROR
|
||||
public QWorkspace(string id)
|
||||
{
|
||||
workspace_id = id;
|
||||
}
|
||||
|
||||
public QWorkspace(string id, string passcode)
|
||||
{
|
||||
workspace_id = id;
|
||||
this.passcode = passcode;
|
||||
}
|
||||
|
||||
public QWorkspace()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public QCue GetCue(string cue_id)
|
||||
{
|
||||
foreach (var cueList in data)
|
||||
{
|
||||
foreach (var cue in cueList.cues)
|
||||
{
|
||||
if(cue.uniqueID == cue_id)
|
||||
{
|
||||
return cue;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public QCueList GetCueList(string id)
|
||||
{
|
||||
foreach (var cueList in data)
|
||||
{
|
||||
if(cueList.uniqueID == id)
|
||||
{
|
||||
return cueList;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void UpdateCue(QCue cue)
|
||||
{
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
for (int j = 0; j < data[i].cues.Count; j++)
|
||||
{
|
||||
if(data[i].cues[j].uniqueID == cue.uniqueID)
|
||||
{
|
||||
//Log.Debug("Cue found and updated in workspace: " + cue.uniqueID);
|
||||
data[i].cues[j] = cue;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateChildren(string cue_id, List<QCue> children)
|
||||
{
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
for (int j = 0; j < data[i].cues.Count; j++)
|
||||
{
|
||||
if (data[i].cues[j].uniqueID == cue_id)
|
||||
{
|
||||
if(data[i].cues[j].type == "Group")
|
||||
{
|
||||
data[i].cues[j].cues = children;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool CheckPopulated()
|
||||
{
|
||||
if(data == null)
|
||||
{
|
||||
IsPopulated = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
for (int j = 0; j < data[i].cues.Count; j++)
|
||||
{
|
||||
if (data[i].cues[j].type == "Group" && data[i].cues[j].cues == null)
|
||||
{
|
||||
IsPopulated = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
IsPopulated = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void PrintStats()
|
||||
{
|
||||
foreach (var cueList in data)
|
||||
{
|
||||
Log.Debug(cueList.listName + "("+ cueList.cues.Count + " cues)");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
//General information about a QLab Workspace
|
||||
namespace qController.QItems
|
||||
{
|
||||
public class QWorkspaceInfo
|
||||
{
|
||||
public string version { get; set; }
|
||||
public string displayName { get; set; }
|
||||
public string uniqueID { get; set; }
|
||||
public bool hasPasscode { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user