Merged in bugfix/ecs-756 (pull request #1)

Bugfix/ecs 756
This commit is contained in:
Neil Dorin
2018-07-25 16:54:14 +00:00
committed by HeathV
11 changed files with 1544 additions and 1344 deletions

2
.gitmodules vendored
View File

@@ -1,3 +1,3 @@
[submodule "essentials-framework"]
path = essentials-framework
url = https://hvolmer@bitbucket.org/Pepperdash_Products/essentials-framework.git
url = https://bitbucket.org/Pepperdash_Products/essentials-framework.git

View File

@@ -79,9 +79,9 @@ namespace PepperDash.Essentials
string directoryPrefix;
//directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory();
#warning ^ For use with beta Include4.dat for XiO Edge
directoryPrefix = "";
directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory();
//directoryPrefix = "";
if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server)
{
@@ -207,6 +207,9 @@ namespace PepperDash.Essentials
/// </summary>
public void LoadDevices()
{
// Build the processor wrapper class
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
foreach (var devConf in ConfigReader.ConfigObject.Devices)
{
@@ -215,7 +218,14 @@ namespace PepperDash.Essentials
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Creating device '{0}'", devConf.Key);
// Skip this to prevent unnecessary warnings
if (devConf.Key == "processor")
{
if (devConf.Type.ToLower() != Global.ControlSystem.ControllerPrompt.ToLower())
Debug.Console(0,
"WARNING: Config file defines processor type as '{0}' but actual processor is '{1}'! Some ports may not be available",
devConf.Type.ToUpper(), Global.ControlSystem.ControllerPrompt.ToUpper());
continue;
}
// Try local factory first
var newDev = DeviceFactory.GetDevice(devConf);
@@ -348,7 +358,7 @@ namespace PepperDash.Essentials
{
try
{
LogoServer = new HttpLogoServer(8080, Global.FilePathPrefix + "html" + Global.DirectorySeparator + "logo");
LogoServer = new HttpLogoServer(8080, Global.DirectorySeparator + "html" + Global.DirectorySeparator + "logo");
}
catch (Exception)
{

View File

@@ -44,9 +44,9 @@ namespace PepperDash.Essentials
// AV Driver
Debug.Console(0, panelController, "Adding huddle space AV driver");
var avDriver = new EssentialsHuddlePanelAvFunctionsDriver(mainDriver, props);
avDriver.CurrentRoom = room as EssentialsHuddleSpaceRoom;
avDriver.DefaultRoomKey = props.DefaultRoomKey;
mainDriver.AvDriver = avDriver;
avDriver.CurrentRoom = room as EssentialsHuddleSpaceRoom;
// Environment Driver
if (avDriver.CurrentRoom.Config.Environment != null && avDriver.CurrentRoom.Config.Environment.DeviceKeys.Count > 0)
@@ -113,9 +113,9 @@ namespace PepperDash.Essentials
var codecDriver = new PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver(panelController.Panel, avDriver,
(room as EssentialsHuddleVtc1Room).VideoCodec, mainDriver.HeaderDriver);
avDriver.SetVideoCodecDriver(codecDriver);
avDriver.CurrentRoom = room as EssentialsHuddleVtc1Room;
avDriver.DefaultRoomKey = props.DefaultRoomKey;
mainDriver.AvDriver = avDriver;
avDriver.CurrentRoom = room as EssentialsHuddleVtc1Room;
// Environment Driver
if (avDriver.CurrentRoom.Config.Environment != null && avDriver.CurrentRoom.Config.Environment.DeviceKeys.Count > 0)

View File

@@ -165,10 +165,11 @@
<Compile Include="FOR REFERENCE UI\PageControllers\PageControllerLargeSetTopBoxGeneric.cs" />
<Compile Include="FOR REFERENCE UI\PageControllers\LargeTouchpanelControllerBase.cs" />
<Compile Include="FOR REFERENCE UI\Panels\SmartGraphicsTouchpanelControllerBase.cs" />
<Compile Include="UIDrivers\Environment Drivers\EssentialsLightingDriver.cs" />
<Compile Include="UIDrivers\Environment Drivers\EssentialsEnvironmentDriver.cs" />
<Compile Include="UIDrivers\Environment Drivers\EssentialsLightingDriver.cs" />
<Compile Include="UIDrivers\Environment Drivers\EssentialsShadeDriver.cs" />
<Compile Include="UIDrivers\Essentials\EssentialsHeaderDriver.cs" />
<Compile Include="UIDrivers\JoinedSigInterlock.cs" />
<Compile Include="UIDrivers\SigInterlock.cs" />
<Compile Include="UIDrivers\EssentialsHuddleVTC\EssentialsHuddlePresentationUiDriver.cs" />
<Compile Include="UIDrivers\EssentialsHuddle\EssentialsHuddleTechPageDriver.cs" />
@@ -176,7 +177,6 @@
<Compile Include="UI\SmartObjectHeaderButtonList.cs" />
<Compile Include="UI\SubpageReferenceListCallStagingItem.cs" />
<Compile Include="UIDrivers\VC\EssentialsVideoCodecUiDriver.cs" />
<Compile Include="UIDrivers\JoinedSigInterlock.cs" />
<Compile Include="UIDrivers\EssentialsHuddleVTC\EssentialsHuddleVtc1PanelAvFunctionsDriver.cs" />
<Compile Include="UIDrivers\VolumeAndSourceChangeArgs.cs" />
<Compile Include="UI\JoinConstants\UISmartObjectJoin.cs" />

View File

@@ -4,5 +4,5 @@
[assembly: AssemblyCompany("PepperDash Technology Corp")]
[assembly: AssemblyProduct("PepperDashEssentials")]
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")]
[assembly: AssemblyVersion("1.2.0.*")]
[assembly: AssemblyVersion("1.2.4.*")]

View File

@@ -7,6 +7,7 @@ using Crestron.SimplSharp.CrestronIO;
using Crestron.SimplSharp.Net.Http;
using PepperDash.Core;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials
{
@@ -64,10 +65,14 @@ namespace PepperDash.Essentials
void Server_OnHttpRequest(object sender, OnHttpRequestArgs args)
{
var path = args.Request.Path;
if (File.Exists(FileDirectory + @"\" + path))
Debug.Console(2, "HTTP Request with path: '{0}'", args.Request.Path);
if (File.Exists(FileDirectory + path))
{
string filePath = path.Replace('/', '\\');
string localPath = string.Format(@"{0}{1}", FileDirectory, filePath);
Debug.Console(2, "HTTP Logo Server attempting to find file: '{0}'", localPath);
if (File.Exists(localPath))
{
args.Response.Header.ContentType = GetContentType(new FileInfo(localPath).Extension);
@@ -75,10 +80,15 @@ namespace PepperDash.Essentials
}
else
{
Debug.Console(2, "HTTP Logo Server Cannot find file '{0}'", localPath);
args.Response.ContentString = string.Format("Not found: '{0}'", filePath);
args.Response.Code = 404;
}
}
else
{
Debug.Console(2, "HTTP Logo Server: '{0}' does not exist", FileDirectory + path);
}
}
/// <summary>

View File

@@ -487,6 +487,30 @@ namespace PepperDash.Essentials
/// </summary>
public const uint HeaderIcon5Press = 3955;
/// 3960
/// </summary>
public const uint HeaderPopupCaretsSubpageVisibile = 3960;
/// <summary>
/// 3961
/// </summary>
public const uint HeaderCaret1Visible = 3961;
/// <summary>
/// 3962
/// </summary>
public const uint HeaderCaret2Visible = 3962;
/// <summary>
/// 3963
/// </summary>
public const uint HeaderCaret3Visible = 3963;
/// <summary>
/// 3964
/// </summary>
public const uint HeaderCaret4Visible = 3964;
/// <summary>
/// 3965
/// </summary>
public const uint HeaderCaret5Visible = 3965;
/// <summary>
/// 3999
/// </summary>

View File

@@ -45,15 +45,15 @@ namespace PepperDash.Essentials
Devices = new List<IKeyed>();
DeviceSubDrivers = new List<PanelDriverBase>();
Parent.AvDriver.PopupInterlock.IsShownFeedback.OutputChange += IsShownFeedback_OutputChange;
Parent.AvDriver.PopupInterlock.StatusChanged += new EventHandler<StatusChangedEventArgs>(PopupInterlock_CurrentJoinChanged);
// Calculate the join offests for each device page and assign join actions for each button
}
void IsShownFeedback_OutputChange(object sender, EventArgs e)
void PopupInterlock_CurrentJoinChanged(object sender, StatusChangedEventArgs e)
{
// Hide this driver and all sub drivers if popup interlock is not shown
if (Parent.AvDriver.PopupInterlock.IsShownFeedback.BoolValue == false)
if (!e.IsShown || e.NewJoin != BackgroundSubpageJoin)
{
foreach (var driver in DeviceSubDrivers)
{
@@ -64,12 +64,17 @@ namespace PepperDash.Essentials
}
}
void IsShownFeedback_OutputChange(object sender, EventArgs e)
{
}
/// <summary>
/// Shows this driver and all sub drivers
/// </summary>
public override void Show()
{
Parent.AvDriver.PopupInterlock.ShowInterlockedWithToggle(BackgroundSubpageJoin);
Parent.AvDriver.PopupInterlock.ShowInterlocked(BackgroundSubpageJoin);
foreach (var driver in DeviceSubDrivers)
{

View File

@@ -24,6 +24,12 @@ namespace PepperDash.Essentials
/// </summary>
public class EssentialsHeaderDriver : PanelDriverBase
{
uint EnvironmentCaretVisible;
uint CalendarCaretVisible;
uint CallCaretVisible;
JoinedSigInterlock CaretInterlock;
CrestronTouchpanelPropertiesConfig Config;
/// <summary>
@@ -43,6 +49,7 @@ namespace PepperDash.Essentials
{
Config = config;
Parent = parent;
CaretInterlock = new JoinedSigInterlock(TriList);
}
void SetUpGear(IAVDriver avDriver, EssentialsRoomBase currentRoom)
@@ -55,9 +62,15 @@ namespace PepperDash.Essentials
() =>
{
if (currentRoom.OnFeedback.BoolValue)
{
avDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPageVisible);
CaretInterlock.ShowInterlocked(UIBoolJoin.HeaderCaret5Visible);
}
else
{
avDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPagePowerOffVisible);
CaretInterlock.ShowInterlocked(UIBoolJoin.HeaderCaret5Visible);
}
});
TriList.SetSigFalseAction(UIBoolJoin.TechExitButton, () =>
avDriver.PopupInterlock.HideAndClear());
@@ -72,10 +85,14 @@ namespace PepperDash.Essentials
TriList.SetBool(UIBoolJoin.HelpPageShowCallButtonVisible, roomConf.Help.ShowCallButton);
TriList.SetString(UIStringJoin.HelpPageCallButtonText, roomConf.Help.CallButtonText);
if (roomConf.Help.ShowCallButton)
{
TriList.SetSigFalseAction(UIBoolJoin.HelpPageShowCallButtonPress, () => { }); // ************ FILL IN
}
else
{
TriList.ClearBoolSigAction(UIBoolJoin.HelpPageShowCallButtonPress);
}
}
else // older config
{
TriList.SetString(UIStringJoin.HelpMessage, roomConf.HelpMessage);
@@ -95,6 +112,7 @@ namespace PepperDash.Essentials
message = "Sorry, no help message available. No room connected.";
//TriList.StringInput[UIStringJoin.HelpMessage].StringValue = message;
Parent.AvDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HelpPageVisible);
CaretInterlock.ShowInterlocked(UIBoolJoin.HeaderCaret4Visible);
});
}
@@ -102,8 +120,14 @@ namespace PepperDash.Essentials
{
if (environmentDriver != null)
{
TriList.SetString(nextJoin, "Lights");
TriList.SetSigFalseAction(nextJoin, environmentDriver.Toggle);
var tempJoin = nextJoin;
TriList.SetString(tempJoin, "Lights");
EnvironmentCaretVisible = tempJoin + 10;
TriList.SetSigFalseAction(tempJoin, () =>
{
environmentDriver.Toggle();
CaretInterlock.ShowInterlocked(EnvironmentCaretVisible);
});
nextJoin--;
return nextJoin;
}
@@ -116,8 +140,14 @@ namespace PepperDash.Essentials
// Calendar button
if (avDriver.CurrentRoom.ScheduleSource != null)
{
TriList.SetString(nextJoin, "Calendar");
TriList.SetSigFalseAction(nextJoin, avDriver.CalendarPress);
var tempJoin = nextJoin;
TriList.SetString(tempJoin, "Calendar");
CalendarCaretVisible = tempJoin + 10;
TriList.SetSigFalseAction(tempJoin, () =>
{
avDriver.CalendarPress();
CaretInterlock.ShowInterlocked(CalendarCaretVisible);
});
nextJoin--;
return nextJoin;
@@ -129,9 +159,16 @@ namespace PepperDash.Essentials
uint SetUpCallButton(EssentialsHuddleVtc1PanelAvFunctionsDriver avDriver, uint nextJoin)
{
// Call button
TriList.SetString(nextJoin, "DND");
TriList.SetSigFalseAction(nextJoin, avDriver.ShowActiveCallsList);
HeaderCallButtonIconSig = TriList.StringInput[nextJoin];
var tempJoin = nextJoin;
TriList.SetString(tempJoin, "DND");
CallCaretVisible = tempJoin + 10;
TriList.SetSigFalseAction(tempJoin, () =>
{
avDriver.ShowActiveCallsList();
if(avDriver.CurrentRoom.InCallFeedback.BoolValue)
CaretInterlock.ShowInterlocked(CallCaretVisible);
});
HeaderCallButtonIconSig = TriList.StringInput[tempJoin];
nextJoin--;
return nextJoin;
@@ -192,6 +229,10 @@ namespace PepperDash.Essentials
var roomConf = currentRoom.Config;
// Register for the PopupInterlock IsShowsFeedback event to tie the header carets subpage visiblity to it
Parent.AvDriver.PopupInterlock.StatusChanged -= PopupInterlock_StatusChanged;
Parent.AvDriver.PopupInterlock.StatusChanged += PopupInterlock_StatusChanged;
SetUpGear(avDriver, currentRoom);
SetUpHelpButton(roomConf);
@@ -211,7 +252,13 @@ namespace PepperDash.Essentials
TriList.SetSigFalseAction(i, () => { });
}
TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusLabelPress, avDriver.ShowActiveCallsList);
TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusLabelPress,
() =>
{
avDriver.ShowActiveCallsList();
if (avDriver.CurrentRoom.InCallFeedback.BoolValue)
CaretInterlock.ShowInterlocked(CallCaretVisible);
});
// Set Call Status Subpage Position
@@ -244,6 +291,10 @@ namespace PepperDash.Essentials
var roomConf = currentRoom.Config;
// Register for the PopupInterlock IsShowsFeedback event to tie the header carets subpage visiblity to it
Parent.AvDriver.PopupInterlock.StatusChanged -= PopupInterlock_StatusChanged;
Parent.AvDriver.PopupInterlock.StatusChanged += PopupInterlock_StatusChanged;
SetUpGear(avDriver, currentRoom);
SetUpHelpButton(roomConf);
@@ -262,5 +313,59 @@ namespace PepperDash.Essentials
HeaderButtonsAreSetUp = true;
}
///// <summary>
///// Whenever a popup is shown/hidden, show/hide the header carets subpage and set the visibility of the correct caret
///// </summary>
///// <param name="sender"></param>
///// <param name="e"></param>
//void IsShownFeedback_OutputChange(object sender, EventArgs e)
//{
// var popupInterlockIsShown = Parent.AvDriver.PopupInterlock.IsShown;
// // Set the visible state for the HeaderPopupCaretsSubpage to match that of the PopupInterlock state
// TriList.SetBool(UIBoolJoin.HeaderPopupCaretsSubpageVisibile, popupInterlockIsShown);
// // Clear all caret visibility
// for (uint i = UIBoolJoin.HeaderCaret5Visible; i >= UIBoolJoin.HeaderCaret1Visible; i--)
// {
// TriList.SetBool(i, false);
// }
// // Set the current caret visible if the popup is still shown
// if (popupInterlockIsShown)
// TriList.SetBool(NextCaretVisible, true);
//}
/// <summary>
/// Whenever a popup is shown/hidden, show/hide the header carets subpage and set the visibility of the correct caret
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void PopupInterlock_StatusChanged(object sender, StatusChangedEventArgs e)
{
// Set the visible state for the HeaderPopupCaretsSubpage to match that of the PopupInterlock state
bool headerPopupShown = false;
// Check if the popup interlock is shown, and if one of the header popups is current, then show the carets subpage
if (e.IsShown)
{
if (e.NewJoin == Parent.EnvironmentDriver.BackgroundSubpageJoin)
headerPopupShown = true;
else if (e.NewJoin == UIBoolJoin.HeaderActiveCallsListVisible)
headerPopupShown = true;
else if (e.NewJoin == UIBoolJoin.HelpPageVisible)
headerPopupShown = true;
else if (e.NewJoin == UIBoolJoin.MeetingsOrContacMethodsListVisible)
headerPopupShown = true;
else if (e.NewJoin == UIBoolJoin.VolumesPagePowerOffVisible || e.NewJoin == UIBoolJoin.VolumesPageVisible)
headerPopupShown = true;
}
// Set the carets subpage visibility
TriList.SetBool(UIBoolJoin.HeaderPopupCaretsSubpageVisibile, headerPopupShown);
if (!e.IsShown)
CaretInterlock.HideAndClear();
}
}
}

View File

@@ -18,6 +18,8 @@ namespace PepperDash.Essentials
public BoolFeedback IsShownFeedback;
public event EventHandler<StatusChangedEventArgs> StatusChanged;
bool _IsShown;
public bool IsShown
@@ -48,12 +50,16 @@ namespace PepperDash.Essentials
/// </summary>
public void ShowInterlocked(uint join)
{
var prevJoin = CurrentJoin;
var wasShown = _IsShown;
Debug.Console(2, "Trilist {0:X2}, interlock swapping {1} for {2}", TriList.ID, CurrentJoin, join);
if (CurrentJoin == join && TriList.BooleanInput[join].BoolValue)
return;
SetButDontShow(join);
TriList.SetBool(CurrentJoin, true);
IsShown = true;
OnStatusChange(prevJoin, CurrentJoin, wasShown, IsShown);
}
/// <summary>
@@ -62,6 +68,9 @@ namespace PepperDash.Essentials
/// <param name="join"></param>
public void ShowInterlockedWithToggle(uint join)
{
var prevJoin = CurrentJoin;
var wasShown = IsShown;
Debug.Console(2, "Trilist {0:X2}, interlock swapping {1} for {2}", TriList.ID, CurrentJoin, join);
if (CurrentJoin == join)
HideAndClear();
@@ -72,6 +81,8 @@ namespace PepperDash.Essentials
CurrentJoin = join;
TriList.BooleanInput[CurrentJoin].BoolValue = true;
IsShown = true;
OnStatusChange(prevJoin, CurrentJoin, wasShown, IsShown);
}
}
/// <summary>
@@ -79,9 +90,13 @@ namespace PepperDash.Essentials
/// </summary>
public void HideAndClear()
{
var prevJoin = CurrentJoin;
var wasShown = IsShown;
Debug.Console(2, "Trilist {0:X2}, interlock hiding {1}", TriList.ID, CurrentJoin);
Hide();
CurrentJoin = 0;
OnStatusChange(prevJoin, CurrentJoin, wasShown, IsShown);
}
/// <summary>
@@ -90,11 +105,15 @@ namespace PepperDash.Essentials
/// </summary>
public void Hide()
{
var prevJoin = CurrentJoin;
var wasShown = IsShown;
Debug.Console(2, "Trilist {0:X2}, interlock hiding {1}", TriList.ID, CurrentJoin);
if (CurrentJoin > 0)
{
TriList.BooleanInput[CurrentJoin].BoolValue = false;
IsShown = false;
OnStatusChange(prevJoin, CurrentJoin, wasShown, IsShown);
}
}
@@ -103,11 +122,16 @@ namespace PepperDash.Essentials
/// </summary>
public void Show()
{
var prevJoin = CurrentJoin;
var wasShown = IsShown;
Debug.Console(2, "Trilist {0:X2}, interlock showing {1}", TriList.ID, CurrentJoin);
if (CurrentJoin > 0)
{
TriList.BooleanInput[CurrentJoin].BoolValue = true;
IsShown = true;
OnStatusChange(prevJoin, CurrentJoin, wasShown, IsShown);
}
}
@@ -125,5 +149,27 @@ namespace PepperDash.Essentials
CurrentJoin = join;
}
void OnStatusChange(uint prevJoin, uint newJoin, bool wasShown, bool isShown)
{
var handler = StatusChanged;
if (handler != null)
handler(this, new StatusChangedEventArgs(prevJoin, newJoin, wasShown, isShown));
}
}
public class StatusChangedEventArgs : EventArgs
{
public uint PreviousJoin { get; set; }
public uint NewJoin { get; set; }
public bool WasShown { get; set; }
public bool IsShown { get; set; }
public StatusChangedEventArgs(uint prevJoin, uint newJoin, bool wasShown, bool isShown)
{
PreviousJoin = prevJoin;
NewJoin = newJoin;
WasShown = wasShown;
IsShown = isShown;
}
}
}