mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
Tested schema and working in web tool. Can't get Essentials to load schema file at specified path yet. Adds addtional XML help for config properties.
This commit is contained in:
@@ -17,15 +17,27 @@ namespace PepperDash.Essentials.Core.Config
|
|||||||
[JsonProperty("info")]
|
[JsonProperty("info")]
|
||||||
public InfoConfig Info { get; set; }
|
public InfoConfig Info { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines the devices in the system
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("devices")]
|
[JsonProperty("devices")]
|
||||||
public List<DeviceConfig> Devices { get; set; }
|
public List<DeviceConfig> Devices { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines the source list for the system
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("sourceLists")]
|
[JsonProperty("sourceLists")]
|
||||||
public Dictionary<string, Dictionary<string, SourceListItem>> SourceLists { get; set; }
|
public Dictionary<string, Dictionary<string, SourceListItem>> SourceLists { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines all the tie lines for system routing
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("tieLines")]
|
[JsonProperty("tieLines")]
|
||||||
public List<TieLineConfig> TieLines { get; set; }
|
public List<TieLineConfig> TieLines { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines any join maps to override the default join maps
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("joinMaps")]
|
[JsonProperty("joinMaps")]
|
||||||
public Dictionary<string, string> JoinMaps { get; set; }
|
public Dictionary<string, string> JoinMaps { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -13,99 +13,43 @@ namespace PepperDash.Essentials.Core.Config
|
|||||||
{
|
{
|
||||||
public class DeviceConfig : PropertiesConfigBase
|
public class DeviceConfig : PropertiesConfigBase
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The unique idendifier for the device
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("key", Required = Required.Always)]
|
[JsonProperty("key", Required = Required.Always)]
|
||||||
public string Key { get; set; }
|
public string Key { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A unique ID for each device instance. Used to differentiate between devices of the same type that may have
|
||||||
|
/// been added/removed from the system
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("uid")]
|
[JsonProperty("uid")]
|
||||||
public int Uid { get; set; }
|
public int Uid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The name of the device
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("name")]
|
[JsonProperty("name")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The group for the device
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("group")]
|
[JsonProperty("group")]
|
||||||
public string Group { get; set; }
|
public string Group { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The type of the device to instantiate
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("type", Required = Required.Always)]
|
[JsonProperty("type", Required = Required.Always)]
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The properties necessary to define the device
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("properties", Required = Required.Always)]
|
[JsonProperty("properties", Required = Required.Always)]
|
||||||
[JsonConverter(typeof(DevicePropertiesConverter))]
|
[JsonConverter(typeof(DevicePropertiesConverter))]
|
||||||
public JToken Properties { get; set; }
|
public JToken Properties { get; set; }
|
||||||
|
|
||||||
public DeviceConfig()
|
|
||||||
{
|
|
||||||
SchemaJson = @"
|
|
||||||
{
|
|
||||||
'definitions': {},
|
|
||||||
'$schema': 'http://json-schema.org/draft-07/schema#',
|
|
||||||
'$id': 'http://example.com/root.json',
|
|
||||||
'type': 'object',
|
|
||||||
'title': 'The Root Schema',
|
|
||||||
'properties': {
|
|
||||||
'name': {
|
|
||||||
'$id': '#/properties/name',
|
|
||||||
'type': 'string',
|
|
||||||
'title': 'The Name Schema',
|
|
||||||
'default': '',
|
|
||||||
'examples': [
|
|
||||||
'App Server'
|
|
||||||
],
|
|
||||||
'pattern': '^(.*)$'
|
|
||||||
},
|
|
||||||
'group': {
|
|
||||||
'$id': '#/properties/group',
|
|
||||||
'type': 'string',
|
|
||||||
'title': 'The Group Schema',
|
|
||||||
'default': '',
|
|
||||||
'examples': [
|
|
||||||
'appServer'
|
|
||||||
],
|
|
||||||
'pattern': '^(.*)$'
|
|
||||||
},
|
|
||||||
'properties': {
|
|
||||||
'$id': '#/properties/properties',
|
|
||||||
'type': 'object',
|
|
||||||
'title': 'The Properties Schema'
|
|
||||||
},
|
|
||||||
'uid': {
|
|
||||||
'$id': '#/properties/uid',
|
|
||||||
'type': 'integer',
|
|
||||||
'title': 'The Uid Schema',
|
|
||||||
'default': 0,
|
|
||||||
'examples': [
|
|
||||||
4
|
|
||||||
]
|
|
||||||
},
|
|
||||||
'key': {
|
|
||||||
'$id': '#/properties/key',
|
|
||||||
'type': 'string',
|
|
||||||
'title': 'The Key Schema',
|
|
||||||
'default': '',
|
|
||||||
'examples': [
|
|
||||||
'display-1'
|
|
||||||
],
|
|
||||||
'pattern': '^(.*)$'
|
|
||||||
},
|
|
||||||
'type': {
|
|
||||||
'$id': '#/properties/type',
|
|
||||||
'type': 'string',
|
|
||||||
'title': 'The Type Schema',
|
|
||||||
'default': '',
|
|
||||||
'examples': [
|
|
||||||
'appServer'
|
|
||||||
],
|
|
||||||
'pattern': '^(.*)$'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'required': [
|
|
||||||
'group',
|
|
||||||
'properties',
|
|
||||||
'key',
|
|
||||||
'type'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -92,8 +92,18 @@ namespace PepperDash.Essentials.Core.Config
|
|||||||
{
|
{
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading config file: '{0}'", filePath);
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading config file: '{0}'", filePath);
|
||||||
|
|
||||||
// Attempt to validate config against schema
|
var directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory();
|
||||||
ValidateSchema(fs.ReadToEnd());
|
|
||||||
|
var schemaFilePath = directoryPrefix + Global.DirectorySeparator + "Config" + Global.DirectorySeparator + "Schema" + Global.DirectorySeparator + "EssentialsConfigSchema.json";
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading Schema from path: {0}", schemaFilePath);
|
||||||
|
|
||||||
|
if(File.Exists(schemaFilePath))
|
||||||
|
{
|
||||||
|
// Attempt to validate config against schema
|
||||||
|
ValidateSchema(fs.ReadToEnd(), schemaFilePath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Warning, "No Schema found at path: {0}", schemaFilePath);
|
||||||
|
|
||||||
if (localConfigFound)
|
if (localConfigFound)
|
||||||
{
|
{
|
||||||
@@ -133,20 +143,31 @@ namespace PepperDash.Essentials.Core.Config
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ValidateSchema(string json)
|
/// <summary>
|
||||||
|
/// Attempts to validate the JSON against the specified schema
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="json">JSON to be validated</param>
|
||||||
|
/// <param name="schemaFileName">File name of schema to validate against</param>
|
||||||
|
public static void ValidateSchema(string json, string schemaFileName)
|
||||||
{
|
{
|
||||||
JToken config = JToken.Parse(json);
|
JToken config = JToken.Parse(json);
|
||||||
|
|
||||||
var deviceConfig = new DeviceConfig();
|
using (StreamReader fs = new StreamReader(schemaFileName))
|
||||||
|
{
|
||||||
|
JsonSchema schema = JsonSchema.Parse(fs.ReadToEnd());
|
||||||
|
|
||||||
JsonSchema schema = JsonSchema.Parse(deviceConfig.SchemaJson);
|
config.Validate(schema, Json_ValidationEventHandler);
|
||||||
|
}
|
||||||
config.Validate(schema, _ValidationEventHandler);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void _ValidationEventHandler(object sender, ValidationEventArgs args)
|
/// <summary>
|
||||||
|
/// Event Handler callback for JSON validation
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="args"></param>
|
||||||
|
public static void Json_ValidationEventHandler(object sender, ValidationEventArgs args)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "{0}", args.Message);
|
Debug.Console(0, "JSON Validation error at line {0} position {1}: {2}", args.Exception.LineNumber, args.Exception.LinePosition, args.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -35,43 +35,7 @@
|
|||||||
"template"
|
"template"
|
||||||
],
|
],
|
||||||
"title": "Essentials Configuration"
|
"title": "Essentials Configuration"
|
||||||
},
|
},
|
||||||
"Info": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"name":{
|
|
||||||
"type":"string"
|
|
||||||
},
|
|
||||||
"date":{
|
|
||||||
"type":"string",
|
|
||||||
"format": "date-time"
|
|
||||||
},
|
|
||||||
"version":{
|
|
||||||
"type":"string"
|
|
||||||
},
|
|
||||||
"runtimeInfo":{
|
|
||||||
"type":"object"
|
|
||||||
},
|
|
||||||
"comment":{
|
|
||||||
"type":"string"
|
|
||||||
},
|
|
||||||
"hostname":{
|
|
||||||
"type":"string"
|
|
||||||
},
|
|
||||||
"appNumber":{
|
|
||||||
"type":"integer"
|
|
||||||
},
|
|
||||||
"lastModifiedDate": {
|
|
||||||
"type": "string",
|
|
||||||
"format": "date-time"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"lastModifiedDate"
|
|
||||||
],
|
|
||||||
"title": "SystemInfo"
|
|
||||||
},
|
|
||||||
"BasicConfig": {
|
"BasicConfig": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
@@ -96,32 +60,84 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"devices",
|
|
||||||
"info",
|
|
||||||
"rooms",
|
|
||||||
"sourceLists",
|
|
||||||
"tieLines"
|
|
||||||
],
|
],
|
||||||
"title": "Template"
|
"title": "Template"
|
||||||
},
|
},
|
||||||
|
"Info": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": true,
|
||||||
|
"properties": {
|
||||||
|
"name":{
|
||||||
|
"type":"string"
|
||||||
|
},
|
||||||
|
"date":{
|
||||||
|
"type":"string",
|
||||||
|
"format": "date-time"
|
||||||
|
},
|
||||||
|
"version":{
|
||||||
|
"type":"string"
|
||||||
|
},
|
||||||
|
"runtimeInfo":{
|
||||||
|
"$ref":"#/definitions/RuntimeInfo"
|
||||||
|
},
|
||||||
|
"comment":{
|
||||||
|
"type":"string"
|
||||||
|
},
|
||||||
|
"hostname":{
|
||||||
|
"type":"string"
|
||||||
|
},
|
||||||
|
"appNumber":{
|
||||||
|
"type":"integer"
|
||||||
|
},
|
||||||
|
"lastModifiedDate": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time"
|
||||||
|
},
|
||||||
|
"lastUid":{
|
||||||
|
"type":"integer"
|
||||||
|
},
|
||||||
|
"processorType":{
|
||||||
|
"type":"string"
|
||||||
|
},
|
||||||
|
"systemType":{
|
||||||
|
"type":"string"
|
||||||
|
},
|
||||||
|
"requiredControlSoftwareVersion":{
|
||||||
|
"type":"string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"title": "Info"
|
||||||
|
},
|
||||||
|
"RuntimeInfo":{
|
||||||
|
"type":"object",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"properties": {
|
||||||
|
"appName":{
|
||||||
|
"type":"string"
|
||||||
|
},
|
||||||
|
"assemblyVersion": {
|
||||||
|
"type":"string"
|
||||||
|
},
|
||||||
|
"osVersion":{
|
||||||
|
"type":"string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"Device": {
|
"Device": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": false,
|
"additionalProperties": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"supportedConfigModes": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"group": {
|
"group": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
"$ref": "#/definitions/DeviceProperties"
|
"type":"object"
|
||||||
},
|
},
|
||||||
"uid": {
|
"uid": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
@@ -131,302 +147,17 @@
|
|||||||
},
|
},
|
||||||
"type": {
|
"type": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
|
||||||
"supportsCompliance": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"supportedSystemTypes": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"group",
|
"group",
|
||||||
"key",
|
"key",
|
||||||
"name",
|
|
||||||
"properties",
|
"properties",
|
||||||
"type",
|
"type"
|
||||||
"uid"
|
|
||||||
],
|
],
|
||||||
"title": "Device"
|
"title": "Device"
|
||||||
},
|
},
|
||||||
"DeviceProperties": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"numberOfRelays": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"numberOfComPorts": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"numberOfDIOPorts": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"numberOfIrPorts": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"hasControls": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"isDefault": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"hasAudio": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"hasDpad": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"hasNumeric": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"hasDvr": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"disableCodecSharing": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"control": {
|
|
||||||
"$ref": "#/definitions/Control"
|
|
||||||
},
|
|
||||||
"serverUrl": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"communicationMonitorProperties": {
|
|
||||||
"$ref": "#/definitions/CommunicationMonitorProperties"
|
|
||||||
},
|
|
||||||
"phonebookMode": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"occupancy": {
|
|
||||||
"$ref": "#/definitions/Occupancy"
|
|
||||||
},
|
|
||||||
"favorites": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/definitions/Favorite"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sgdFile": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"showTime": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"showVolumeGauge": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"sourcesOverflowCount": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"showDate": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"headerStyle": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"usesSplashPage": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"roomListKey": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"defaultRoomKey": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [],
|
|
||||||
"title": "DeviceProperties"
|
|
||||||
},
|
|
||||||
"CommunicationMonitorProperties": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"timeToError": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"timeToWarning": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"pollInterval": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"pollString": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"pollInterval",
|
|
||||||
"pollString",
|
|
||||||
"timeToError",
|
|
||||||
"timeToWarning"
|
|
||||||
],
|
|
||||||
"title": "CommunicationMonitorProperties"
|
|
||||||
},
|
|
||||||
"Control": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"irFile": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"controlPortNumber": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"controlPortDevKey": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"method": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"tcpSshProperties": {
|
|
||||||
"$ref": "#/definitions/TCPSSHProperties"
|
|
||||||
},
|
|
||||||
"controlPortName": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"ipid": {
|
|
||||||
"type": "string",
|
|
||||||
"format": "integer"
|
|
||||||
},
|
|
||||||
"endOfLineChar": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"endOfLineString": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"deviceReadyResponsePattern": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"params": {
|
|
||||||
"$ref": "#/definitions/Params"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [],
|
|
||||||
"title": "Control"
|
|
||||||
},
|
|
||||||
"Params": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"deviceReadyResponsePattern": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"endOfLineString": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"deviceReadyResponsePattern",
|
|
||||||
"endOfLineString"
|
|
||||||
],
|
|
||||||
"title": "Params"
|
|
||||||
},
|
|
||||||
"TCPSSHProperties": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"username": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"port": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"address": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"password": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"autoReconnect": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"autoReconnectIntervalMs": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"bufferSize": {
|
|
||||||
"type": "integer"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"address",
|
|
||||||
"autoReconnect",
|
|
||||||
"autoReconnectIntervalMs",
|
|
||||||
"bufferSize",
|
|
||||||
"password",
|
|
||||||
"port",
|
|
||||||
"username"
|
|
||||||
],
|
|
||||||
"title": "TCPSSHProperties"
|
|
||||||
},
|
|
||||||
"Favorite": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"name": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"number": {
|
|
||||||
"type": "string",
|
|
||||||
"format": "integer"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"name",
|
|
||||||
"number"
|
|
||||||
],
|
|
||||||
"title": "Favorite"
|
|
||||||
},
|
|
||||||
"Occupancy": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"available": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"available"
|
|
||||||
],
|
|
||||||
"title": "Occupancy"
|
|
||||||
},
|
|
||||||
"TemplateInfo": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"lastUid": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"processorType": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"systemType": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"lastModifiedDate": {
|
|
||||||
"type": "string",
|
|
||||||
"format": "date-time"
|
|
||||||
},
|
|
||||||
"requiredControlSofwareVersion": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"comment": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"comment",
|
|
||||||
"lastModifiedDate",
|
|
||||||
"lastUid",
|
|
||||||
"processorType",
|
|
||||||
"requiredControlSofwareVersion",
|
|
||||||
"systemType"
|
|
||||||
],
|
|
||||||
"title": "TemplateInfo"
|
|
||||||
},
|
|
||||||
"Room": {
|
"Room": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
@@ -438,7 +169,7 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
"$ref": "#/definitions/RoomProperties"
|
"type": "object"
|
||||||
},
|
},
|
||||||
"type": {
|
"type": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@@ -452,246 +183,22 @@
|
|||||||
],
|
],
|
||||||
"title": "Room"
|
"title": "Room"
|
||||||
},
|
},
|
||||||
"RoomProperties": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"description": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"volumes": {
|
|
||||||
"$ref": "#/definitions/Volumes"
|
|
||||||
},
|
|
||||||
"defaultDisplayKey": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"defaultAudioKey": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"helpMessage": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"hasDsp": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"defaultSourceItem": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"logo": {
|
|
||||||
"$ref": "#/definitions/Logo"
|
|
||||||
},
|
|
||||||
"environment": {
|
|
||||||
"$ref": "#/definitions/Environment"
|
|
||||||
},
|
|
||||||
"defaultVideoBehavior": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"videoCodecKey": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"sourceListKey": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"defaultAudioKey",
|
|
||||||
"defaultDisplayKey",
|
|
||||||
"defaultSourceItem",
|
|
||||||
"defaultVideoBehavior",
|
|
||||||
"description",
|
|
||||||
"environment",
|
|
||||||
"hasDsp",
|
|
||||||
"helpMessage",
|
|
||||||
"logo",
|
|
||||||
"sourceListKey",
|
|
||||||
"videoCodecKey",
|
|
||||||
"volumes"
|
|
||||||
],
|
|
||||||
"title": "RoomProperties"
|
|
||||||
},
|
|
||||||
"Environment": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"deviceKeys": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"deviceKeys"
|
|
||||||
],
|
|
||||||
"title": "Environment"
|
|
||||||
},
|
|
||||||
"Logo": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"url": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"type",
|
|
||||||
"url"
|
|
||||||
],
|
|
||||||
"title": "Logo"
|
|
||||||
},
|
|
||||||
"Volumes": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"master": {
|
|
||||||
"$ref": "#/definitions/Master"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"master"
|
|
||||||
],
|
|
||||||
"title": "Volumes"
|
|
||||||
},
|
|
||||||
"Master": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"level": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"deviceKey": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"label": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"deviceKey",
|
|
||||||
"label",
|
|
||||||
"level"
|
|
||||||
],
|
|
||||||
"title": "Master"
|
|
||||||
},
|
|
||||||
"SourceLists": {
|
"SourceLists": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": false,
|
"additionalProperties": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
"default": {
|
"default":{
|
||||||
"$ref": "#/definitions/Default"
|
"$ref":"#/definitions/SourceList"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
|
||||||
"default"
|
|
||||||
],
|
|
||||||
"title": "SourceLists"
|
"title": "SourceLists"
|
||||||
},
|
},
|
||||||
"Default": {
|
"SourceList": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": false,
|
"additionalProperties": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
"codecOsd": {
|
|
||||||
"$ref": "#/definitions/CodecOsd"
|
|
||||||
},
|
|
||||||
"source-1": {
|
|
||||||
"$ref": "#/definitions/Source"
|
|
||||||
},
|
|
||||||
"roomOff": {
|
|
||||||
"$ref": "#/definitions/RoomOff"
|
|
||||||
},
|
|
||||||
"source-2": {
|
|
||||||
"$ref": "#/definitions/Source"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"required": [
|
"title": "Source List"
|
||||||
"codecOsd",
|
|
||||||
"roomOff",
|
|
||||||
"source-1",
|
|
||||||
"source-2"
|
|
||||||
],
|
|
||||||
"title": "Default"
|
|
||||||
},
|
|
||||||
"CodecOsd": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"sourceKey": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"routeList": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/definitions/RouteList"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"includeInSourceList": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"order": {
|
|
||||||
"type": "integer"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"includeInSourceList",
|
|
||||||
"name",
|
|
||||||
"order",
|
|
||||||
"routeList",
|
|
||||||
"sourceKey",
|
|
||||||
"type"
|
|
||||||
],
|
|
||||||
"title": "CodecOsd"
|
|
||||||
},
|
|
||||||
"RouteList": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"destinationKey": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"sourceKey": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"destinationKey",
|
|
||||||
"sourceKey",
|
|
||||||
"type"
|
|
||||||
],
|
|
||||||
"title": "RouteList"
|
|
||||||
},
|
|
||||||
"RoomOff": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"sourceKey": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"routeList": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/definitions/RouteList"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"routeList",
|
|
||||||
"sourceKey",
|
|
||||||
"type"
|
|
||||||
],
|
|
||||||
"title": "RoomOff"
|
|
||||||
},
|
},
|
||||||
"Source": {
|
"Source": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
@@ -716,7 +223,12 @@
|
|||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"type": {
|
"type": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"enum":[
|
||||||
|
"route",
|
||||||
|
"off",
|
||||||
|
"other"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"altIcon": {
|
"altIcon": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@@ -729,8 +241,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"altIcon",
|
|
||||||
"icon",
|
|
||||||
"includeInSourceList",
|
"includeInSourceList",
|
||||||
"order",
|
"order",
|
||||||
"routeList",
|
"routeList",
|
||||||
@@ -739,6 +249,34 @@
|
|||||||
"volumeControlKey"
|
"volumeControlKey"
|
||||||
],
|
],
|
||||||
"title": "Source"
|
"title": "Source"
|
||||||
|
},
|
||||||
|
"RouteList": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"properties": {
|
||||||
|
"destinationKey": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"sourceKey": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum":[
|
||||||
|
"audio",
|
||||||
|
"video",
|
||||||
|
"audioVideo",
|
||||||
|
"usbOutput",
|
||||||
|
"usbInput"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"destinationKey",
|
||||||
|
"sourceKey",
|
||||||
|
"type"
|
||||||
|
],
|
||||||
|
"title": "RouteList"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,34 +67,64 @@ namespace PepperDash.Essentials.Core
|
|||||||
[JsonProperty("name")]
|
[JsonProperty("name")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The icon to display
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("icon")]
|
[JsonProperty("icon")]
|
||||||
public string Icon { get; set; }
|
public string Icon { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Alternate icon to display
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("altIcon")]
|
[JsonProperty("altIcon")]
|
||||||
public string AltIcon { get; set; }
|
public string AltIcon { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates if the source should be included in the list
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("includeInSourceList")]
|
[JsonProperty("includeInSourceList")]
|
||||||
public bool IncludeInSourceList { get; set; }
|
public bool IncludeInSourceList { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines the order the source appears in the list (ascending)
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("order")]
|
[JsonProperty("order")]
|
||||||
public int Order { get; set; }
|
public int Order { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Key of the volume control device for the source
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("volumeControlKey")]
|
[JsonProperty("volumeControlKey")]
|
||||||
public string VolumeControlKey { get; set; }
|
public string VolumeControlKey { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The type of source list item
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("type")]
|
[JsonProperty("type")]
|
||||||
[JsonConverter(typeof(StringEnumConverter))]
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
public eSourceListItemType Type { get; set; }
|
public eSourceListItemType Type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The list of routes to run when source is selected
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("routeList")]
|
[JsonProperty("routeList")]
|
||||||
public List<SourceRouteListItem> RouteList { get; set; }
|
public List<SourceRouteListItem> RouteList { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates if this source should be disabled for sharing via codec content
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("disableCodecSharing")]
|
[JsonProperty("disableCodecSharing")]
|
||||||
public bool DisableCodecSharing { get; set; }
|
public bool DisableCodecSharing { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates if this source should be disabled for local routing
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("disableRoutedSharing")]
|
[JsonProperty("disableRoutedSharing")]
|
||||||
public bool DisableRoutedSharing { get; set; }
|
public bool DisableRoutedSharing { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The list of valid destination types for this source
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("destinations")]
|
[JsonProperty("destinations")]
|
||||||
public List<eSourceListItemDestinationTypes> Destinations { get; set; }
|
public List<eSourceListItemDestinationTypes> Destinations { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -267,11 +267,13 @@
|
|||||||
<Compile Include="SmartObjects\SubpageReferencList\SubpageReferenceList.cs" />
|
<Compile Include="SmartObjects\SubpageReferencList\SubpageReferenceList.cs" />
|
||||||
<Compile Include="SmartObjects\SubpageReferencList\SubpageReferenceListItem.cs" />
|
<Compile Include="SmartObjects\SubpageReferencList\SubpageReferenceListItem.cs" />
|
||||||
<None Include="app.config" />
|
<None Include="app.config" />
|
||||||
|
<EmbeddedResource Include="Config\Schema\EssentialsConfigSchema.json">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</EmbeddedResource>
|
||||||
<None Include="Properties\ControlSystem.cfg" />
|
<None Include="Properties\ControlSystem.cfg" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="bin\" />
|
<Folder Include="bin\" />
|
||||||
<Folder Include="Config\Schema\" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
|
||||||
<ProjectExtensions>
|
<ProjectExtensions>
|
||||||
|
|||||||
@@ -17,21 +17,39 @@ namespace PepperDash.Essentials.DM.Config
|
|||||||
[JsonProperty("control")]
|
[JsonProperty("control")]
|
||||||
public ControlPropertiesConfig Control { get; set; }
|
public ControlPropertiesConfig Control { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The available volume controls
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("volumeControls")]
|
[JsonProperty("volumeControls")]
|
||||||
public Dictionary<uint, DmCardAudioPropertiesConfig> VolumeControls { get; set; }
|
public Dictionary<uint, DmCardAudioPropertiesConfig> VolumeControls { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The input cards
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("inputSlots")]
|
[JsonProperty("inputSlots")]
|
||||||
public Dictionary<uint, string> InputSlots { get; set; }
|
public Dictionary<uint, string> InputSlots { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The output cards (each card represents a pair of outputs)
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("outputSlots")]
|
[JsonProperty("outputSlots")]
|
||||||
public Dictionary<uint, string> OutputSlots { get; set; }
|
public Dictionary<uint, string> OutputSlots { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The names of the Inputs
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("inputNames")]
|
[JsonProperty("inputNames")]
|
||||||
public Dictionary<uint, string> InputNames { get; set; }
|
public Dictionary<uint, string> InputNames { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The names of the Outputs
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("outputNames")]
|
[JsonProperty("outputNames")]
|
||||||
public Dictionary<uint, string> OutputNames { get; set; }
|
public Dictionary<uint, string> OutputNames { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The string to use when no route is set for a given output
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("noRouteText")]
|
[JsonProperty("noRouteText")]
|
||||||
public string NoRouteText { get; set; }
|
public string NoRouteText { get; set; }
|
||||||
|
|
||||||
@@ -49,9 +67,15 @@ namespace PepperDash.Essentials.DM.Config
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class DmCardAudioPropertiesConfig
|
public class DmCardAudioPropertiesConfig
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The level to set on the output
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("outLevel")]
|
[JsonProperty("outLevel")]
|
||||||
public int OutLevel { get; set; }
|
public int OutLevel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines if this level is adjustable or not
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("isVolumeControlPoint")]
|
[JsonProperty("isVolumeControlPoint")]
|
||||||
public bool IsVolumeControlPoint { get; set; }
|
public bool IsVolumeControlPoint { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user