cleaned out framework files; added framework submodule; referneced p.core to reference in framework; moved essentials.sln; changed paths in sln to match; test build

This commit is contained in:
Heath Volmer
2018-06-28 13:59:14 -06:00
parent 058ea730ed
commit 0e9d1e4c35
413 changed files with 33026 additions and 71338 deletions

View File

@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Fusion
{
/// <summary>
/// When created, runs progcomments on every slot and stores the program names in a list
/// </summary>
public class ProcessorProgReg
{
//public static Dictionary<int, ProcessorProgramItem> Programs { get; private set; }
public static Dictionary<int, ProcessorProgramItem> GetProcessorProgReg()
{
var programs = new Dictionary<int, ProcessorProgramItem>();
for (int i = 1; i <= Global.ControlSystem.NumProgramsSupported; i++)
{
string response = null;
var success = CrestronConsole.SendControlSystemCommand("progcomments:" + i, ref response);
var item = new ProcessorProgramItem();
if (!success)
item.Name = "Error: PROGCOMMENTS failed";
else
{
if (response.ToLower().Contains("bad or incomplete"))
item.Name = "";
else
{
var startPos = response.IndexOf("Program File");
var colonPos = response.IndexOf(":", startPos) + 1;
var endPos = response.IndexOf(CrestronEnvironment.NewLine, colonPos);
item.Name = response.Substring(colonPos, endPos - colonPos).Trim();
item.Exists = true;
if (item.Name.Contains(".dll"))
{
startPos = response.IndexOf("Compiler Revision");
colonPos = response.IndexOf(":", startPos) + 1;
endPos = response.IndexOf(CrestronEnvironment.NewLine, colonPos);
item.Name = item.Name + "_v" + response.Substring(colonPos, endPos - colonPos).Trim();
}
}
}
programs[i] = item;
Debug.Console(1, "Program {0}: {1}", i, item.Name);
}
return programs;
}
}
/// <summary>
/// Used in ProcessorProgReg
/// </summary>
public class ProcessorProgramItem
{
public bool Exists { get; set; }
public string Name { get; set; }
}
}