mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
v1.0.48 - Updates all code that uses file paths to work on windows or linux platforms. Updates to add compatability for running on XiO Edge platform.
This commit is contained in:
@@ -20,7 +20,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return Global.FilePathPrefix + @"IR\";
|
return Global.FilePathPrefix + "IR" + Global.DirectorySeparator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,14 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
public static string FilePathPrefix { get; private set; }
|
public static string FilePathPrefix { get; private set; }
|
||||||
|
|
||||||
|
public static char DirectorySeparator
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return System.IO.Path.DirectorySeparatorChar;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the file path prefix
|
/// Sets the file path prefix
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -19,14 +19,18 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
public static bool LoadConfig2()
|
public static bool LoadConfig2()
|
||||||
{
|
{
|
||||||
Debug.Console(0, "Loading unmerged system/template portal configuration file.");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading unmerged system/template portal configuration file.");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var filePath = Global.FilePathPrefix + @"ConfigurationFile.json";
|
var filePath = Global.FilePathPrefix + "configurationFile.json";
|
||||||
|
|
||||||
if (!File.Exists(filePath))
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to load config file: '{0}'", filePath);
|
||||||
|
|
||||||
|
if (!File.Exists(filePath))
|
||||||
{
|
{
|
||||||
Debug.Console(0,
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Error,
|
||||||
"ERROR: Configuration file not present. Please load file to {0} and reset program", filePath);
|
"ERROR: Configuration file not present. Please load file to {0} and reset program", filePath);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -48,11 +52,16 @@ namespace PepperDash.Essentials
|
|||||||
ConfigObject.TemplateUrl= doubleObj["template_url"].Value<string>();
|
ConfigObject.TemplateUrl= doubleObj["template_url"].Value<string>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully Loaded Merged Config");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "ERROR: Config load failed: \r{0}", e);
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Error, "ERROR: Config load failed: \r{0}", e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
public static class FactoryHelper
|
public static class FactoryHelper
|
||||||
{
|
{
|
||||||
public static string IrDriverPathPrefix = Global.FilePathPrefix + @"IR\";
|
public static string IrDriverPathPrefix = Global.FilePathPrefix + "IR" + Global.DirectorySeparator;
|
||||||
|
|
||||||
public static void HandleUnknownType(JToken devToken, string type)
|
public static void HandleUnknownType(JToken devToken, string type)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ namespace PepperDash.Essentials
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public override void InitializeSystem()
|
public override void InitializeSystem()
|
||||||
{
|
{
|
||||||
|
DeterminePlatform();
|
||||||
|
|
||||||
CrestronConsole.AddNewConsoleCommand(s =>
|
CrestronConsole.AddNewConsoleCommand(s =>
|
||||||
{
|
{
|
||||||
foreach (var tl in TieLineCollection.Default)
|
foreach (var tl in TieLineCollection.Default)
|
||||||
@@ -54,9 +56,6 @@ namespace PepperDash.Essentials
|
|||||||
"Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
|
"Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
|
||||||
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
|
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
|
|
||||||
DeterminePlatform();
|
|
||||||
|
|
||||||
GoWithLoad();
|
GoWithLoad();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,16 +66,30 @@ namespace PepperDash.Essentials
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void DeterminePlatform()
|
public void DeterminePlatform()
|
||||||
{
|
{
|
||||||
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
|
|
||||||
|
ErrorLog.Error("Determining Platform....");
|
||||||
|
|
||||||
string filePathPrefix;
|
string filePathPrefix;
|
||||||
|
|
||||||
|
var dirSeparator = Global.DirectorySeparator;
|
||||||
|
|
||||||
|
var version = Crestron.SimplSharp.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||||
|
|
||||||
|
var versionString = string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build);
|
||||||
|
|
||||||
if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server)
|
if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server)
|
||||||
{
|
{
|
||||||
filePathPrefix = string.Format(@"\NVRAM\program{0}\",
|
filePathPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory() + dirSeparator + "NVRAM"
|
||||||
InitialParametersClass.ApplicationNumber);
|
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
|
||||||
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
|
ErrorLog.Error(string.Format("Starting Essentials v{0} on 3-series Appliance", versionString));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
filePathPrefix = (@"\USER\");
|
filePathPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory() + dirSeparator + "User" + dirSeparator;
|
||||||
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
|
ErrorLog.Error(string.Format("Starting Essentials v{0} on XiO Edge Server", versionString));
|
||||||
}
|
}
|
||||||
|
|
||||||
Global.SetFilePathPrefix(filePathPrefix);
|
Global.SetFilePathPrefix(filePathPrefix);
|
||||||
@@ -93,18 +106,19 @@ namespace PepperDash.Essentials
|
|||||||
ConsoleAccessLevelEnum.AccessOperator);
|
ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
//PortalSync = new PepperDashPortalSyncClient();
|
//PortalSync = new PepperDashPortalSyncClient();
|
||||||
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
Debug.Console(0, "Starting Essentials load from configuration");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials load from configuration");
|
||||||
|
|
||||||
var filesReady = SetupFilesystem();
|
var filesReady = SetupFilesystem();
|
||||||
if (filesReady)
|
if (filesReady)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "Folder structure verified. Loading config...");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Folder structure verified. Loading config...");
|
||||||
if (!ConfigReader.LoadConfig2())
|
if (!ConfigReader.LoadConfig2())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Load();
|
Load();
|
||||||
Debug.Console(0, "Essentials load complete\r" +
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Essentials load complete\r" +
|
||||||
"-------------------------------------------------------------");
|
"-------------------------------------------------------------");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -139,11 +153,11 @@ namespace PepperDash.Essentials
|
|||||||
if (!configExists)
|
if (!configExists)
|
||||||
Directory.Create(configDir);
|
Directory.Create(configDir);
|
||||||
|
|
||||||
var irDir = Global.FilePathPrefix + @"ir";
|
var irDir = Global.FilePathPrefix + "ir";
|
||||||
if (!Directory.Exists(irDir))
|
if (!Directory.Exists(irDir))
|
||||||
Directory.Create(irDir);
|
Directory.Create(irDir);
|
||||||
|
|
||||||
var sgdDir = Global.FilePathPrefix + @"sgd";
|
var sgdDir = Global.FilePathPrefix + "sgd";
|
||||||
if (!Directory.Exists(sgdDir))
|
if (!Directory.Exists(sgdDir))
|
||||||
Directory.Create(sgdDir);
|
Directory.Create(sgdDir);
|
||||||
|
|
||||||
@@ -196,7 +210,8 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Debug.Console(0, "Creating device '{0}'", devConf.Key);
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Creating device '{0}'", devConf.Key);
|
||||||
// Skip this to prevent unnecessary warnings
|
// Skip this to prevent unnecessary warnings
|
||||||
if (devConf.Key == "processor")
|
if (devConf.Key == "processor")
|
||||||
continue;
|
continue;
|
||||||
@@ -215,13 +230,18 @@ namespace PepperDash.Essentials
|
|||||||
if (newDev != null)
|
if (newDev != null)
|
||||||
DeviceManager.AddDevice(newDev);
|
DeviceManager.AddDevice(newDev);
|
||||||
else
|
else
|
||||||
Debug.Console(0, "ERROR: Cannot load unknown device type '{0}', key '{1}'.", devConf.Type, devConf.Key);
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "ERROR: Cannot load unknown device type '{0}', key '{1}'.", devConf.Type, devConf.Key);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "ERROR: Creating device {0}. Skipping device. \r{1}", devConf.Key, e);
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "ERROR: Creating device {0}. Skipping device. \r{1}", devConf.Key, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Devices Loaded.");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -240,6 +260,10 @@ namespace PepperDash.Essentials
|
|||||||
if (newTL != null)
|
if (newTL != null)
|
||||||
tlc.Add(newTL);
|
tlc.Add(newTL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Tie Lines Loaded.");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -249,7 +273,7 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
if (ConfigReader.ConfigObject.Rooms == null)
|
if (ConfigReader.ConfigObject.Rooms == null)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "WARNING: Configuration contains no rooms");
|
Debug.Console(0, Debug.ErrorLogLevel.Warning, "WARNING: Configuration contains no rooms");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,31 +286,39 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
DeviceManager.AddDevice(room);
|
DeviceManager.AddDevice(room);
|
||||||
|
|
||||||
Debug.Console(1, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion");
|
||||||
DeviceManager.AddDevice(new EssentialsHuddleSpaceFusionSystemControllerBase((EssentialsHuddleSpaceRoom)room, 0xf1));
|
DeviceManager.AddDevice(new EssentialsHuddleSpaceFusionSystemControllerBase((EssentialsHuddleSpaceRoom)room, 0xf1));
|
||||||
|
|
||||||
|
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Cotija Bridge...");
|
||||||
// Cotija bridge
|
// Cotija bridge
|
||||||
var bridge = new CotijaEssentialsHuddleSpaceRoomBridge(room as EssentialsHuddleSpaceRoom);
|
var bridge = new CotijaEssentialsHuddleSpaceRoomBridge(room as EssentialsHuddleSpaceRoom);
|
||||||
AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
|
AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
|
||||||
DeviceManager.AddDevice(bridge);
|
DeviceManager.AddDevice(bridge);
|
||||||
|
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Cotija Bridge Added...");
|
||||||
}
|
}
|
||||||
else if (room is EssentialsHuddleVtc1Room)
|
else if (room is EssentialsHuddleVtc1Room)
|
||||||
{
|
{
|
||||||
DeviceManager.AddDevice(room);
|
DeviceManager.AddDevice(room);
|
||||||
|
|
||||||
Debug.Console(1, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion");
|
||||||
DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((EssentialsHuddleVtc1Room)room, 0xf1));
|
DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((EssentialsHuddleVtc1Room)room, 0xf1));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Console(1, "Room is NOT EssentialsHuddleSpaceRoom, attempting to add to DeviceManager w/o Fusion");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is NOT EssentialsHuddleSpaceRoom, attempting to add to DeviceManager w/o Fusion");
|
||||||
DeviceManager.AddDevice(room);
|
DeviceManager.AddDevice(room);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Debug.Console(0, "WARNING: Cannot create room from config, key '{0}'", roomConfig.Key);
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "WARNING: Cannot create room from config, key '{0}'", roomConfig.Key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Rooms Loaded.");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -315,11 +347,11 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
LogoServer = new HttpLogoServer(8080, @"\html\logo");
|
LogoServer = new HttpLogoServer(8080, Global.FilePathPrefix + "html" + Global.DirectorySeparator + "logo");
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "NOTICE: Logo server cannot be started. Likely already running in another program");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "NOTICE: Logo server cannot be started. Likely already running in another program");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,55 +128,63 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
: base(room.Key + "-fusion")
|
: base(room.Key + "-fusion")
|
||||||
{
|
{
|
||||||
|
|
||||||
Room = room;
|
try
|
||||||
|
|
||||||
IpId = ipId;
|
|
||||||
|
|
||||||
FusionStaticAssets = new Dictionary<int, FusionAsset>();
|
|
||||||
|
|
||||||
GUIDs = new FusionRoomGuids();
|
|
||||||
|
|
||||||
var mac = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_MAC_ADDRESS, 0);
|
|
||||||
|
|
||||||
var slot = Global.ControlSystem.ProgramNumber;
|
|
||||||
|
|
||||||
string guidFilePath = Global.FilePathPrefix + string.Format(@"{1}-FusionGuids.json", Global.ControlSystem.ProgramNumber, InitialParametersClass.ProgramIDTag);
|
|
||||||
|
|
||||||
GuidFileExists = File.Exists(guidFilePath);
|
|
||||||
|
|
||||||
// Check if file exists
|
|
||||||
if (!GuidFileExists)
|
|
||||||
{
|
{
|
||||||
// Does not exist. Create GUIDs
|
|
||||||
GUIDs = new FusionRoomGuids(Room.Name, ipId, GUIDs.GenerateNewRoomGuid(slot, mac), FusionStaticAssets);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Exists. Read GUIDs
|
|
||||||
ReadGuidFile(guidFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
CreateSymbolAndBasicSigs(IpId);
|
Room = room;
|
||||||
SetUpSources();
|
|
||||||
SetUpCommunitcationMonitors();
|
|
||||||
SetUpDisplay();
|
|
||||||
SetUpError();
|
|
||||||
ExecuteCustomSteps();
|
|
||||||
|
|
||||||
if(Room.RoomOccupancy != null)
|
IpId = ipId;
|
||||||
{
|
|
||||||
if(Room.OccupancyStatusProviderIsRemote)
|
FusionStaticAssets = new Dictionary<int, FusionAsset>();
|
||||||
SetUpRemoteOccupancy();
|
|
||||||
|
GUIDs = new FusionRoomGuids();
|
||||||
|
|
||||||
|
var mac = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_MAC_ADDRESS, 0);
|
||||||
|
|
||||||
|
var slot = Global.ControlSystem.ProgramNumber;
|
||||||
|
|
||||||
|
string guidFilePath = Global.FilePathPrefix + string.Format(@"{0}-FusionGuids.json", InitialParametersClass.ProgramIDTag);
|
||||||
|
|
||||||
|
GuidFileExists = File.Exists(guidFilePath);
|
||||||
|
|
||||||
|
// Check if file exists
|
||||||
|
if (!GuidFileExists)
|
||||||
|
{
|
||||||
|
// Does not exist. Create GUIDs
|
||||||
|
GUIDs = new FusionRoomGuids(Room.Name, ipId, GUIDs.GenerateNewRoomGuid(slot, mac), FusionStaticAssets);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetUpLocalOccupancy();
|
// Exists. Read GUIDs
|
||||||
|
ReadGuidFile(guidFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CreateSymbolAndBasicSigs(IpId);
|
||||||
|
SetUpSources();
|
||||||
|
SetUpCommunitcationMonitors();
|
||||||
|
SetUpDisplay();
|
||||||
|
SetUpError();
|
||||||
|
ExecuteCustomSteps();
|
||||||
|
|
||||||
|
if (Room.RoomOccupancy != null)
|
||||||
|
{
|
||||||
|
if (Room.OccupancyStatusProviderIsRemote)
|
||||||
|
SetUpRemoteOccupancy();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetUpLocalOccupancy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make it so!
|
||||||
|
FusionRVI.GenerateFileForAllFusionDevices();
|
||||||
|
|
||||||
|
GenerateGuidFile(guidFilePath);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Error Building Fusion System Controller: {0}", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make it so!
|
|
||||||
FusionRVI.GenerateFileForAllFusionDevices();
|
|
||||||
|
|
||||||
GenerateGuidFile(guidFilePath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -245,7 +253,7 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
{
|
{
|
||||||
if(string.IsNullOrEmpty(filePath))
|
if(string.IsNullOrEmpty(filePath))
|
||||||
{
|
{
|
||||||
Debug.Console(0, this, "Error reading guid file. No path specified.");
|
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Error reading guid file. No path specified.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,7 +278,7 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Console(0, this, "Fusion Guids successfully read from file: {0}", filePath);
|
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Fusion Guids successfully read from file: {0}", filePath);
|
||||||
|
|
||||||
Debug.Console(1, this, "\nRoom Name: {0}\nIPID: {1:x}\n RoomGuid: {2}", Room.Name, IpId, RoomGuid);
|
Debug.Console(1, this, "\nRoom Name: {0}\nIPID: {1:x}\n RoomGuid: {2}", Room.Name, IpId, RoomGuid);
|
||||||
|
|
||||||
@@ -281,7 +289,7 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(0, this, "Error reading guid file: {0}", e);
|
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Error reading guid file: {0}", e);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@@ -293,7 +301,7 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
|
|
||||||
protected virtual void CreateSymbolAndBasicSigs(uint ipId)
|
protected virtual void CreateSymbolAndBasicSigs(uint ipId)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Creating Fusion Room symbol with GUID: {0}", RoomGuid);
|
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Creating Fusion Room symbol with GUID: {0}", RoomGuid);
|
||||||
|
|
||||||
FusionRoom = new FusionRoom(ipId, Global.ControlSystem, Room.Name, RoomGuid);
|
FusionRoom = new FusionRoom(ipId, Global.ControlSystem, Room.Name, RoomGuid);
|
||||||
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.Use();
|
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.Use();
|
||||||
@@ -395,32 +403,21 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
|
|
||||||
protected void GetProcessorInfo()
|
protected void GetProcessorInfo()
|
||||||
{
|
{
|
||||||
//SystemName = FusionRoom.CreateOffsetStringSig(50, "Info - Processor - System Name", eSigIoMask.InputSigOnly);
|
|
||||||
//Model = FusionRoom.CreateOffsetStringSig(51, "Info - Processor - Model", eSigIoMask.InputSigOnly);
|
|
||||||
//SerialNumber = FusionRoom.CreateOffsetStringSig(52, "Info - Processor - Serial Number", eSigIoMask.InputSigOnly);
|
|
||||||
//Uptime = FusionRoom.CreateOffsetStringSig(53, "Info - Processor - Uptime", eSigIoMask.InputSigOnly);
|
|
||||||
|
|
||||||
Firmware = FusionRoom.CreateOffsetStringSig(61, "Info - Processor - Firmware", eSigIoMask.InputSigOnly);
|
Firmware = FusionRoom.CreateOffsetStringSig(61, "Info - Processor - Firmware", eSigIoMask.InputSigOnly);
|
||||||
|
|
||||||
for (int i = 0; i < Global.ControlSystem.NumProgramsSupported; i++)
|
if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server)
|
||||||
{
|
{
|
||||||
var join = 62 + i;
|
for (int i = 0; i < Global.ControlSystem.NumProgramsSupported; i++)
|
||||||
var progNum = i + 1;
|
{
|
||||||
Program[i] = FusionRoom.CreateOffsetStringSig((uint)join, string.Format("Info - Processor - Program {0}", progNum), eSigIoMask.InputSigOnly);
|
var join = 62 + i;
|
||||||
|
var progNum = i + 1;
|
||||||
|
Program[i] = FusionRoom.CreateOffsetStringSig((uint)join, string.Format("Info - Processor - Program {0}", progNum), eSigIoMask.InputSigOnly);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Firmware.InputSig.StringValue = InitialParametersClass.FirmwareVersion;
|
Firmware.InputSig.StringValue = InitialParametersClass.FirmwareVersion;
|
||||||
|
|
||||||
//var programs = ProcessorProgReg.GetProcessorProgReg();
|
|
||||||
|
|
||||||
//for (int i = 1; i < Global.ControlSystem.NumProgramsSupported; i++)
|
|
||||||
//{
|
|
||||||
// var join = 62 + i;
|
|
||||||
// var progNum = i + 1;
|
|
||||||
// if (programs[i].Exists)
|
|
||||||
// Program[i].InputSig.StringValue = programs[i].Name;
|
|
||||||
//}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetTouchpanelInfo()
|
void GetTouchpanelInfo()
|
||||||
|
|||||||
@@ -38,7 +38,8 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
AddPostActivationAction(() =>
|
AddPostActivationAction(() =>
|
||||||
{
|
{
|
||||||
Debug.Console(0, this, "Creating hardware...");
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
|
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Creating touchpanel hardware...");
|
||||||
type = type.ToLower();
|
type = type.ToLower();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -68,13 +69,15 @@ namespace PepperDash.Essentials
|
|||||||
Panel = new Tsw1060(id, Global.ControlSystem);
|
Panel = new Tsw1060(id, Global.ControlSystem);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Console(0, this, "WARNING: Cannot create TSW controller with type '{0}'", type);
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
|
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "WARNING: Cannot create TSW controller with type '{0}'", type);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(0, this, "WARNING: Cannot create TSW base class. Panel will not function: {0}", e.Message);
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
|
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "WARNING: Cannot create TSW base class. Panel will not function: {0}", e.Message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,12 +93,13 @@ namespace PepperDash.Essentials
|
|||||||
//CrestronInvoke.BeginInvoke(o =>
|
//CrestronInvoke.BeginInvoke(o =>
|
||||||
// {
|
// {
|
||||||
var regSuccess = Panel.Register();
|
var regSuccess = Panel.Register();
|
||||||
|
#warning Temporary Error logging for XiO Edge Debugging
|
||||||
if (regSuccess != eDeviceRegistrationUnRegistrationResponse.Success)
|
if (regSuccess != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||||
Debug.Console(0, this, "WARNING: Registration failed. Continuing, but panel may not function: {0}", regSuccess);
|
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "WARNING: Registration failed. Continuing, but panel may not function: {0}", regSuccess);
|
||||||
|
|
||||||
// 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\" + 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, "ERROR: Smart object file '{0}' not present. Exiting TSW load", sgdName);
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user