mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
Merge pull request #39 from PepperDash/hotfix/sgd-failover-to-embedded-resources
Closes #26. If specified SGD file isnt' found in User/sgd directory,…
This commit is contained in:
@@ -106,13 +106,19 @@ namespace PepperDash.Essentials
|
|||||||
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "WARNING: Registration failed. Continuing, but panel may not function: {0}", Panel.RegistrationFailureReason);
|
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "WARNING: Registration failed. Continuing, but panel may not function: {0}", Panel.RegistrationFailureReason);
|
||||||
|
|
||||||
// Give up cleanly if SGD is not present.
|
// Give up cleanly if SGD is not present.
|
||||||
var sgdName = Global.FilePathPrefix
|
var sgdName = Global.FilePathPrefix + "sgd" + Global.DirectorySeparator + props.SgdFile;
|
||||||
+ Global.DirectorySeparator + "sgd" + Global.DirectorySeparator + props.SgdFile;
|
|
||||||
if (!File.Exists(sgdName))
|
if (!File.Exists(sgdName))
|
||||||
{
|
{
|
||||||
Debug.Console(0, this, "ERROR: Smart object file '{0}' not present. Exiting TSW load", sgdName);
|
Debug.Console(0, this, "Smart object file '{0}' not present in User folder. Looking for embedded file", sgdName);
|
||||||
|
|
||||||
|
sgdName = Global.ApplicationDirectoryPathPrefix + Global.DirectorySeparator + "SGD" + Global.DirectorySeparator + props.SgdFile;
|
||||||
|
|
||||||
|
if (!File.Exists(sgdName))
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "Unable to find SGD file '{0}' in User sgd or application SGD folder. Exiting touchpanel load.", sgdName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Panel.LoadSmartObjects(sgdName);
|
Panel.LoadSmartObjects(sgdName);
|
||||||
Panel.SigChange += Panel_SigChange;
|
Panel.SigChange += Panel_SigChange;
|
||||||
|
|||||||
@@ -26,6 +26,17 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static string FilePathPrefix { get; private set; }
|
public static string FilePathPrefix { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The file path prefix to the applciation directory
|
||||||
|
/// </summary>
|
||||||
|
public static string ApplicationDirectoryPathPrefix
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Crestron.SimplSharp.CrestronIO.Directory.GetApplicationDirectory();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the directory separator character based on the running OS
|
/// Returns the directory separator character based on the running OS
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user