mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 12:06:58 +00:00
Closes #26. If specified SGD file isnt' found in User/sgd directory, we look in application/SGD directory for embedded resource file. Updates PD.Core to latest.
This commit is contained in:
parent
dc9eee9325
commit
4d300a9b68
4 changed files with 23 additions and 6 deletions
|
|
@ -106,12 +106,18 @@ 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);
|
||||||
return;
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Panel.LoadSmartObjects(sgdName);
|
Panel.LoadSmartObjects(sgdName);
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit acebe6b43b28cc3a93f899e9714292a0cc1ab2cc
|
Subproject commit 27a665b68a0725729bb09138bb85f575833df4b2
|
||||||
Loading…
Add table
Add a link
Reference in a new issue