mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-06 16:25:01 +00:00
Added none source to share list
This commit is contained in:
@@ -16,10 +16,34 @@ namespace PepperDash.Essentials.UIDrivers
|
||||
{
|
||||
public class EssentialsHuddleTechPageDriver : PanelDriverBase
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
SmartObjectDynamicList MenuList;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
SubpageReferenceList StatusList;
|
||||
/// <summary>
|
||||
/// References lines in the list against device instances
|
||||
/// </summary>
|
||||
Dictionary<ICommunicationMonitor, uint> StatusListDeviceIndexes;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
IAVDriver Parent;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
JoinedSigInterlock PagesInterlock;
|
||||
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint JoinText = 1;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -45,21 +69,25 @@ namespace PepperDash.Essentials.UIDrivers
|
||||
MenuList.SetFeedback(1, true);
|
||||
});
|
||||
|
||||
MenuList.SetItemMainText(2, "Panel Setup");
|
||||
MenuList.SetItemMainText(2, "Display Controls");
|
||||
MenuList.SetItemButtonAction(2, b => {
|
||||
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechPanelSetupVisible);
|
||||
MenuList.SetFeedback(2, true);
|
||||
});
|
||||
|
||||
MenuList.SetItemMainText(3, "System Status");
|
||||
MenuList.SetItemButtonAction(3, b => {
|
||||
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechDisplayControlsVisible);
|
||||
MenuList.SetFeedback(2, true);
|
||||
});
|
||||
|
||||
MenuList.SetItemMainText(3, "Panel Setup");
|
||||
MenuList.SetItemButtonAction(3, b => {
|
||||
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechPanelSetupVisible);
|
||||
MenuList.SetFeedback(3, true);
|
||||
});
|
||||
|
||||
MenuList.Count = 3;
|
||||
}
|
||||
|
||||
BuildStatusList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public override void Show()
|
||||
{
|
||||
TriList.SetBool(UIBoolJoin.TechCommonItemsVisbible, true);
|
||||
@@ -67,11 +95,53 @@ namespace PepperDash.Essentials.UIDrivers
|
||||
base.Show();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public override void Hide()
|
||||
{
|
||||
TriList.SetBool(UIBoolJoin.TechCommonItemsVisbible, false);
|
||||
PagesInterlock.Hide();
|
||||
base.Hide();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void BuildStatusList()
|
||||
{
|
||||
StatusList = new SubpageReferenceList(TriList, UISmartObjectJoin.TechStatusList, 3, 3, 3);
|
||||
StatusListDeviceIndexes = new Dictionary<ICommunicationMonitor, uint>();
|
||||
uint i = 0;
|
||||
foreach (var d in DeviceManager.AllDevices)
|
||||
{
|
||||
// make sure it is both ICommunicationMonitor and a Device
|
||||
var sd = d as ICommunicationMonitor;
|
||||
if (sd == null)
|
||||
continue;
|
||||
var dd = sd as Device;
|
||||
if(dd == null)
|
||||
continue;
|
||||
i++;
|
||||
StatusList.StringInputSig(i, 1).StringValue = dd.Name;
|
||||
StatusList.UShortInputSig(i, 1).UShortValue = (ushort)sd.CommunicationMonitor.Status;
|
||||
StatusListDeviceIndexes.Add(sd, i);
|
||||
sd.CommunicationMonitor.StatusChange += CommunicationMonitor_StatusChange ;
|
||||
}
|
||||
StatusList.Count = (ushort)i;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void CommunicationMonitor_StatusChange(object sender, MonitorStatusChangeEventArgs e)
|
||||
{
|
||||
var c = sender as ICommunicationMonitor;
|
||||
if (StatusListDeviceIndexes.ContainsKey(c))
|
||||
{
|
||||
var i = StatusListDeviceIndexes[c];
|
||||
StatusList.UShortInputSig(i, 1).UShortValue = (ushort)e.Status;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -750,13 +750,13 @@ namespace PepperDash.Essentials
|
||||
if (!srcConfig.IncludeInSourceList) // Skip sources marked this way
|
||||
continue;
|
||||
|
||||
var actualSource = DeviceManager.GetDeviceForKey(srcConfig.SourceKey) as Device;
|
||||
if (actualSource == null)
|
||||
{
|
||||
Debug.Console(1, "Cannot assign missing source '{0}' to source UI list",
|
||||
srcConfig.SourceKey);
|
||||
continue;
|
||||
}
|
||||
//var actualSource = DeviceManager.GetDeviceForKey(srcConfig.SourceKey) as Device;
|
||||
//if (actualSource == null)
|
||||
//{
|
||||
// Debug.Console(1, "Cannot assign missing source '{0}' to source UI list",
|
||||
// srcConfig.SourceKey);
|
||||
// continue;
|
||||
//}
|
||||
var routeKey = kvp.Key;
|
||||
var item = new SubpageReferenceListSourceItem(i++, SourceStagingSrl, srcConfig,
|
||||
b => { if (!b) UiSelectSource(routeKey); });
|
||||
|
||||
Reference in New Issue
Block a user