From dfa56a240b9aedc20332b580a734c6bf88404eee Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 2 Sep 2020 23:02:06 -0700 Subject: [PATCH] Promote Control --- SabreTools.Library/DatFiles/Json.cs | 3 + SabreTools.Library/DatFiles/Listxml.cs | 4 +- SabreTools.Library/DatFiles/OpenMSX.cs | 4 +- SabreTools.Library/DatFiles/SabreDat.cs | 2 +- SabreTools.Library/DatFiles/SoftwareList.cs | 12 +- SabreTools.Library/DatItems/Auxiliary.cs | 93 +---- SabreTools.Library/DatItems/Control.cs | 425 ++++++++++++++++++++ SabreTools.Library/DatItems/DatItem.cs | 7 +- SabreTools.Library/DatItems/Enums.cs | 1 + SabreTools.Library/DatItems/Machine.cs | 4 +- SabreTools.Library/Tools/Converters.cs | 6 + 11 files changed, 456 insertions(+), 105 deletions(-) create mode 100644 SabreTools.Library/DatItems/Control.cs diff --git a/SabreTools.Library/DatFiles/Json.cs b/SabreTools.Library/DatFiles/Json.cs index 1ba292ff..dd0ba1e9 100644 --- a/SabreTools.Library/DatFiles/Json.cs +++ b/SabreTools.Library/DatFiles/Json.cs @@ -232,6 +232,9 @@ namespace SabreTools.Library.DatFiles case ItemType.Configuration: datItem = datItemObj.ToObject(); break; + case ItemType.Control: + datItem = datItemObj.ToObject(); + break; case ItemType.Device: datItem = datItemObj.ToObject(); break; diff --git a/SabreTools.Library/DatFiles/Listxml.cs b/SabreTools.Library/DatFiles/Listxml.cs index 5d1d9b7b..c91060f7 100644 --- a/SabreTools.Library/DatFiles/Listxml.cs +++ b/SabreTools.Library/DatFiles/Listxml.cs @@ -686,7 +686,7 @@ namespace SabreTools.Library.DatFiles { case "control": var control = new Control(); - control.Type = reader.GetAttribute("type"); + control.ControlType = reader.GetAttribute("type"); control.Player = reader.GetAttribute("player"); control.Buttons = reader.GetAttribute("buttons"); control.RegButtons = reader.GetAttribute("regbuttons"); @@ -1558,7 +1558,7 @@ namespace SabreTools.Library.DatFiles foreach (var control in input.Controls) { xtw.WriteStartElement("control"); - xtw.WriteOptionalAttributeString("type", control.Type); + xtw.WriteOptionalAttributeString("type", control.ControlType); xtw.WriteOptionalAttributeString("player", control.Player); xtw.WriteOptionalAttributeString("buttons", control.Buttons); xtw.WriteOptionalAttributeString("regbuttons", control.RegButtons); diff --git a/SabreTools.Library/DatFiles/OpenMSX.cs b/SabreTools.Library/DatFiles/OpenMSX.cs index 3fa4ad11..36c8d1d2 100644 --- a/SabreTools.Library/DatFiles/OpenMSX.cs +++ b/SabreTools.Library/DatFiles/OpenMSX.cs @@ -196,7 +196,7 @@ namespace SabreTools.Library.DatFiles int indexId) { List items = new List(); - OpenMSXOriginal original = null; + Original original = null; while (!reader.EOF) { @@ -238,7 +238,7 @@ namespace SabreTools.Library.DatFiles break; case "original": - original = new OpenMSXOriginal(); + original = new Original(); original.Value = reader.GetAttribute("value").AsYesNo(); original.Content = reader.ReadElementContentAsString(); break; diff --git a/SabreTools.Library/DatFiles/SabreDat.cs b/SabreTools.Library/DatFiles/SabreDat.cs index fe9b7fb4..e5c0eccf 100644 --- a/SabreTools.Library/DatFiles/SabreDat.cs +++ b/SabreTools.Library/DatFiles/SabreDat.cs @@ -1486,7 +1486,7 @@ namespace SabreTools.Library.DatFiles foreach (var control in input.Controls) { xtw.WriteStartElement("control"); - xtw.WriteOptionalAttributeString("type", control.Type); + xtw.WriteOptionalAttributeString("type", control.ControlType); xtw.WriteOptionalAttributeString("player", control.Player); xtw.WriteOptionalAttributeString("buttons", control.Buttons); xtw.WriteOptionalAttributeString("regbuttons", control.RegButtons); diff --git a/SabreTools.Library/DatFiles/SoftwareList.cs b/SabreTools.Library/DatFiles/SoftwareList.cs index 9dad3283..e47098a8 100644 --- a/SabreTools.Library/DatFiles/SoftwareList.cs +++ b/SabreTools.Library/DatFiles/SoftwareList.cs @@ -164,13 +164,13 @@ namespace SabreTools.Library.DatFiles break; case "info": - var info = new SoftwareListInfo(); + var info = new Info(); info.Name = reader.GetAttribute("name"); info.Value = reader.GetAttribute("value"); // Ensure the list exists if (machine.Infos == null) - machine.Infos = new List(); + machine.Infos = new List(); machine.Infos.Add(info); @@ -178,13 +178,13 @@ namespace SabreTools.Library.DatFiles break; case "sharedfeat": - var sharedFeature = new SoftwareListSharedFeature(); + var sharedFeature = new SharedFeature(); sharedFeature.Name = reader.GetAttribute("name"); sharedFeature.Value = reader.GetAttribute("value"); // Ensure the list exists if (machine.SharedFeatures == null) - machine.SharedFeatures = new List(); + machine.SharedFeatures = new List(); machine.SharedFeatures.Add(sharedFeature); @@ -701,7 +701,7 @@ namespace SabreTools.Library.DatFiles if (datItem.Machine.Infos != null && datItem.Machine.Infos.Count > 0) { - foreach (SoftwareListInfo kvp in datItem.Machine.Infos) + foreach (Info kvp in datItem.Machine.Infos) { xtw.WriteStartElement("info"); xtw.WriteRequiredAttributeString("name", kvp.Name); @@ -712,7 +712,7 @@ namespace SabreTools.Library.DatFiles if (datItem.Machine.SharedFeatures != null && datItem.Machine.SharedFeatures.Count > 0) { - foreach (SoftwareListSharedFeature kvp in datItem.Machine.SharedFeatures) + foreach (SharedFeature kvp in datItem.Machine.SharedFeatures) { xtw.WriteStartElement("sharedfeat"); xtw.WriteRequiredAttributeString("name", kvp.Name); diff --git a/SabreTools.Library/DatItems/Auxiliary.cs b/SabreTools.Library/DatItems/Auxiliary.cs index 32b58c1f..b0a510a7 100644 --- a/SabreTools.Library/DatItems/Auxiliary.cs +++ b/SabreTools.Library/DatItems/Auxiliary.cs @@ -15,100 +15,13 @@ namespace SabreTools.Library.DatItems { #region Machine - #region ListXML - - /// - /// Represents one ListXML control - /// - [JsonObject("control")] - public class Control - { - #region Fields - - /// - /// Control type - /// - [JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)] - public string Type { get; set; } - - /// - /// Player ID - /// - [JsonProperty("player", DefaultValueHandling = DefaultValueHandling.Ignore)] - public string Player { get; set; } // TODO: Int32? - - /// - /// Button count - /// - [JsonProperty("buttons", DefaultValueHandling = DefaultValueHandling.Ignore)] - public string Buttons { get; set; } // TODO: Int32? - - /// - /// Regular button count - /// - [JsonProperty("regbuttons", DefaultValueHandling = DefaultValueHandling.Ignore)] - public string RegButtons { get; set; } // TODO: Int32? - - /// - /// Minimum value - /// - [JsonProperty("minimum", DefaultValueHandling = DefaultValueHandling.Ignore)] - public string Minimum { get; set; } // TODO: Int32? Float? - - /// - /// Maximum value - /// - [JsonProperty("maximum", DefaultValueHandling = DefaultValueHandling.Ignore)] - public string Maximum { get; set; } // TODO: Int32? Float? - - /// - /// Sensitivity value - /// - [JsonProperty("sensitivity", DefaultValueHandling = DefaultValueHandling.Ignore)] - public string Sensitivity { get; set; } // TODO: Int32? Float? - - /// - /// Keypress delta - /// - [JsonProperty("keydelta", DefaultValueHandling = DefaultValueHandling.Ignore)] - public string KeyDelta { get; set; } // TODO: Int32? Float? - - /// - /// Determines if the control is reversed - /// - [JsonProperty("reverse", DefaultValueHandling = DefaultValueHandling.Ignore)] - public bool? Reverse { get; set; } - - /// - /// First set of ways - /// - [JsonProperty("ways", DefaultValueHandling = DefaultValueHandling.Ignore)] - public string Ways { get; set; } // TODO: Int32? Float? - - /// - /// Second set of ways - /// - [JsonProperty("ways2", DefaultValueHandling = DefaultValueHandling.Ignore)] - public string Ways2 { get; set; } // TODO: Int32? Float? - - /// - /// Third set of ways - /// - [JsonProperty("ways3", DefaultValueHandling = DefaultValueHandling.Ignore)] - public string Ways3 { get; set; } // TODO: Int32? Float? - - #endregion - } - - #endregion - #region OpenMSX /// /// Represents the OpenMSX original value /// [JsonObject("original")] - public class OpenMSXOriginal + public class Original { [JsonProperty("value")] public bool? Value { get; set; } @@ -125,7 +38,7 @@ namespace SabreTools.Library.DatItems /// Represents one SoftwareList info /// [JsonObject("info")] - public class SoftwareListInfo + public class Info { [JsonProperty("name")] public string Name { get; set; } @@ -138,7 +51,7 @@ namespace SabreTools.Library.DatItems /// Represents one SoftwareList shared feature object /// [JsonObject("sharedfeat")] - public class SoftwareListSharedFeature + public class SharedFeature { [JsonProperty("name")] public string Name { get; set; } diff --git a/SabreTools.Library/DatItems/Control.cs b/SabreTools.Library/DatItems/Control.cs new file mode 100644 index 00000000..60ba0809 --- /dev/null +++ b/SabreTools.Library/DatItems/Control.cs @@ -0,0 +1,425 @@ +using System.Collections.Generic; +using System.Linq; + +using SabreTools.Library.Filtering; +using SabreTools.Library.Tools; +using Newtonsoft.Json; + +namespace SabreTools.Library.DatItems +{ + /// + /// Represents control for an input + /// + [JsonObject("control")] + public class Control : DatItem + { + #region Fields + + /// + /// Control type + /// + [JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)] + public string ControlType { get; set; } + + /// + /// Player ID + /// + [JsonProperty("player", DefaultValueHandling = DefaultValueHandling.Ignore)] + public string Player { get; set; } // TODO: Int32? + + /// + /// Button count + /// + [JsonProperty("buttons", DefaultValueHandling = DefaultValueHandling.Ignore)] + public string Buttons { get; set; } // TODO: Int32? + + /// + /// Regular button count + /// + [JsonProperty("regbuttons", DefaultValueHandling = DefaultValueHandling.Ignore)] + public string RegButtons { get; set; } // TODO: Int32? + + /// + /// Minimum value + /// + [JsonProperty("minimum", DefaultValueHandling = DefaultValueHandling.Ignore)] + public string Minimum { get; set; } // TODO: Int32? Float? + + /// + /// Maximum value + /// + [JsonProperty("maximum", DefaultValueHandling = DefaultValueHandling.Ignore)] + public string Maximum { get; set; } // TODO: Int32? Float? + + /// + /// Sensitivity value + /// + [JsonProperty("sensitivity", DefaultValueHandling = DefaultValueHandling.Ignore)] + public string Sensitivity { get; set; } // TODO: Int32? Float? + + /// + /// Keypress delta + /// + [JsonProperty("keydelta", DefaultValueHandling = DefaultValueHandling.Ignore)] + public string KeyDelta { get; set; } // TODO: Int32? Float? + + /// + /// Determines if the control is reversed + /// + [JsonProperty("reverse", DefaultValueHandling = DefaultValueHandling.Ignore)] + public bool? Reverse { get; set; } + + /// + /// First set of ways + /// + [JsonProperty("ways", DefaultValueHandling = DefaultValueHandling.Ignore)] + public string Ways { get; set; } // TODO: Int32? Float? + + /// + /// Second set of ways + /// + [JsonProperty("ways2", DefaultValueHandling = DefaultValueHandling.Ignore)] + public string Ways2 { get; set; } // TODO: Int32? Float? + + /// + /// Third set of ways + /// + [JsonProperty("ways3", DefaultValueHandling = DefaultValueHandling.Ignore)] + public string Ways3 { get; set; } // TODO: Int32? Float? + + #endregion + + #region Accessors + + /// + /// Set fields with given values + /// + /// Mappings dictionary + public override void SetFields(Dictionary mappings) + { + // Set base fields + base.SetFields(mappings); + + // Handle Control-specific fields + if (mappings.Keys.Contains(Field.DatItem_Control_Type)) + ControlType = mappings[Field.DatItem_Control_Type]; + + if (mappings.Keys.Contains(Field.DatItem_Control_Player)) + Player = mappings[Field.DatItem_Control_Player]; + + if (mappings.Keys.Contains(Field.DatItem_Control_Buttons)) + Buttons = mappings[Field.DatItem_Control_Buttons]; + + if (mappings.Keys.Contains(Field.DatItem_Control_RegButtons)) + RegButtons = mappings[Field.DatItem_Control_RegButtons]; + + if (mappings.Keys.Contains(Field.DatItem_Control_Minimum)) + Minimum = mappings[Field.DatItem_Control_Minimum]; + + if (mappings.Keys.Contains(Field.DatItem_Control_Maximum)) + Maximum = mappings[Field.DatItem_Control_Maximum]; + + if (mappings.Keys.Contains(Field.DatItem_Control_Sensitivity)) + Sensitivity = mappings[Field.DatItem_Control_Sensitivity]; + + if (mappings.Keys.Contains(Field.DatItem_Control_KeyDelta)) + KeyDelta = mappings[Field.DatItem_Control_KeyDelta]; + + if (mappings.Keys.Contains(Field.DatItem_Control_Reverse)) + Reverse = mappings[Field.DatItem_Control_Reverse].AsYesNo(); + + if (mappings.Keys.Contains(Field.DatItem_Control_Ways)) + Ways = mappings[Field.DatItem_Control_Ways]; + + if (mappings.Keys.Contains(Field.DatItem_Control_Ways2)) + Ways2 = mappings[Field.DatItem_Control_Ways2]; + + if (mappings.Keys.Contains(Field.DatItem_Control_Ways3)) + Ways3 = mappings[Field.DatItem_Control_Ways3]; + } + + #endregion + + #region Constructors + + /// + /// Create a default, empty Control object + /// + public Control() + { + ItemType = ItemType.Control; + } + + #endregion + + #region Cloning Methods + + public override object Clone() + { + return new Control() + { + ItemType = this.ItemType, + DupeType = this.DupeType, + + AltName = this.AltName, + AltTitle = this.AltTitle, + + Original = this.Original, + OpenMSXSubType = this.OpenMSXSubType, + OpenMSXType = this.OpenMSXType, + Remark = this.Remark, + Boot = this.Boot, + + Part = this.Part, + Features = this.Features, + AreaName = this.AreaName, + AreaSize = this.AreaSize, + AreaWidth = this.AreaWidth, + AreaEndianness = this.AreaEndianness, + Value = this.Value, + LoadFlag = this.LoadFlag, + + Machine = this.Machine.Clone() as Machine, + Source = this.Source.Clone() as Source, + Remove = this.Remove, + + ControlType = this.ControlType, + Player = this.Player, + Buttons = this.Buttons, + RegButtons = this.RegButtons, + Minimum = this.Minimum, + Maximum = this.Maximum, + Sensitivity = this.Sensitivity, + KeyDelta = this.KeyDelta, + Reverse = this.Reverse, + Ways = this.Ways, + Ways2 = this.Ways2, + Ways3 = this.Ways3, + }; + } + + #endregion + + #region Comparision Methods + + public override bool Equals(DatItem other) + { + // If we don't have a Control, return false + if (ItemType != other.ItemType) + return false; + + // Otherwise, treat it as a Control + Control newOther = other as Control; + + // If the Control information matches + return (ControlType == newOther.ControlType + && Player == newOther.Player + && Buttons == newOther.Buttons + && RegButtons == newOther.RegButtons + && Minimum == newOther.Minimum + && Maximum == newOther.Maximum + && Sensitivity == newOther.Sensitivity + && KeyDelta == newOther.KeyDelta + && Reverse == newOther.Reverse + && Ways == newOther.Ways + && Ways2 == newOther.Ways2 + && Ways3 == newOther.Ways3); + } + + #endregion + + #region Filtering + + /// + /// Check to see if a DatItem passes the filter + /// + /// Filter to check against + /// True if the item passed the filter, false otherwise + public override bool PassesFilter(Filter filter) + { + // Check common fields first + if (!base.PassesFilter(filter)) + return false; + + // Filter on control type + if (filter.DatItem_Control_Type.MatchesPositiveSet(ControlType) == false) + return false; + if (filter.DatItem_Control_Type.MatchesNegativeSet(ControlType) == true) + return false; + + // Filter on display type + if (filter.DatItem_Control_Player.MatchesPositiveSet(Player) == false) + return false; + if (filter.DatItem_Control_Player.MatchesNegativeSet(Player) == true) + return false; + + // Filter on buttons + if (filter.DatItem_Control_Buttons.MatchesPositiveSet(Buttons) == false) + return false; + if (filter.DatItem_Control_Buttons.MatchesNegativeSet(Buttons) == true) + return false; + + // Filter on regbuttons + if (filter.DatItem_Control_RegButtons.MatchesPositiveSet(RegButtons) == false) + return false; + if (filter.DatItem_Control_RegButtons.MatchesNegativeSet(RegButtons) == true) + return false; + + // Filter on minimum + if (filter.DatItem_Control_Minimum.MatchesPositiveSet(Minimum) == false) + return false; + if (filter.DatItem_Control_Minimum.MatchesNegativeSet(Minimum) == true) + return false; + + // Filter on maximum + if (filter.DatItem_Control_Maximum.MatchesPositiveSet(Maximum) == false) + return false; + if (filter.DatItem_Control_Maximum.MatchesNegativeSet(Maximum) == true) + return false; + + // Filter on sensitivity + if (filter.DatItem_Control_Sensitivity.MatchesPositiveSet(Sensitivity) == false) + return false; + if (filter.DatItem_Control_Sensitivity.MatchesNegativeSet(Sensitivity) == true) + return false; + + // Filter on keydelta + if (filter.DatItem_Control_KeyDelta.MatchesPositiveSet(KeyDelta) == false) + return false; + if (filter.DatItem_Control_KeyDelta.MatchesNegativeSet(KeyDelta) == true) + return false; + + // Filter on reverse + if (filter.DatItem_Control_Reverse.MatchesNeutral(null, Reverse) == false) + return false; + + // Filter on ways + if (filter.DatItem_Control_Ways.MatchesPositiveSet(Ways) == false) + return false; + if (filter.DatItem_Control_Ways.MatchesNegativeSet(Ways) == true) + return false; + + // Filter on ways2 + if (filter.DatItem_Control_Ways2.MatchesPositiveSet(Ways2) == false) + return false; + if (filter.DatItem_Control_Ways2.MatchesNegativeSet(Ways2) == true) + return false; + + // Filter on ways3 + if (filter.DatItem_Control_Ways3.MatchesPositiveSet(Ways3) == false) + return false; + if (filter.DatItem_Control_Ways3.MatchesNegativeSet(Ways3) == true) + return false; + + return true; + } + + /// + /// Remove fields from the DatItem + /// + /// List of Fields to remove + public override void RemoveFields(List fields) + { + // Remove common fields first + base.RemoveFields(fields); + + // Remove the fields + if (fields.Contains(Field.DatItem_Control_Type)) + ControlType = null; + + if (fields.Contains(Field.DatItem_Control_Player)) + Player = null; + + if (fields.Contains(Field.DatItem_Control_Buttons)) + Buttons = null; + + if (fields.Contains(Field.DatItem_Control_RegButtons)) + RegButtons = null; + + if (fields.Contains(Field.DatItem_Control_Minimum)) + Minimum = null; + + if (fields.Contains(Field.DatItem_Control_Maximum)) + Maximum = null; + + if (fields.Contains(Field.DatItem_Control_Sensitivity)) + Sensitivity = null; + + if (fields.Contains(Field.DatItem_Control_KeyDelta)) + KeyDelta = null; + + if (fields.Contains(Field.DatItem_Control_Reverse)) + Reverse = null; + + if (fields.Contains(Field.DatItem_Control_Ways)) + Ways = null; + + if (fields.Contains(Field.DatItem_Control_Ways2)) + Ways2 = null; + + if (fields.Contains(Field.DatItem_Control_Ways3)) + Ways3 = null; + } + + #endregion + + #region Sorting and Merging + + /// + /// Replace fields from another item + /// + /// DatItem to pull new information from + /// List of Fields representing what should be updated + public override void ReplaceFields(DatItem item, List fields) + { + // Replace common fields first + base.ReplaceFields(item, fields); + + // If we don't have a Control to replace from, ignore specific fields + if (item.ItemType != ItemType.Control) + return; + + // Cast for easier access + Control newItem = item as Control; + + // Replace the fields + if (fields.Contains(Field.DatItem_Control_Type)) + ControlType = newItem.ControlType; + + if (fields.Contains(Field.DatItem_Control_Player)) + Player = newItem.Player; + + if (fields.Contains(Field.DatItem_Control_Buttons)) + Buttons = newItem.Buttons; + + if (fields.Contains(Field.DatItem_Control_RegButtons)) + RegButtons = newItem.RegButtons; + + if (fields.Contains(Field.DatItem_Control_Minimum)) + Minimum = newItem.Minimum; + + if (fields.Contains(Field.DatItem_Control_Maximum)) + Maximum = newItem.Maximum; + + if (fields.Contains(Field.DatItem_Control_Sensitivity)) + Sensitivity = newItem.Sensitivity; + + if (fields.Contains(Field.DatItem_Control_KeyDelta)) + KeyDelta = newItem.KeyDelta; + + if (fields.Contains(Field.DatItem_Control_Reverse)) + Reverse = newItem.Reverse; + + if (fields.Contains(Field.DatItem_Control_Ways)) + Ways = newItem.Ways; + + if (fields.Contains(Field.DatItem_Control_Ways2)) + Ways2 = newItem.Ways2; + + if (fields.Contains(Field.DatItem_Control_Ways3)) + Ways3 = newItem.Ways3; + } + + #endregion + } +} diff --git a/SabreTools.Library/DatItems/DatItem.cs b/SabreTools.Library/DatItems/DatItem.cs index 5530593b..42967ac7 100644 --- a/SabreTools.Library/DatItems/DatItem.cs +++ b/SabreTools.Library/DatItems/DatItem.cs @@ -72,7 +72,7 @@ namespace SabreTools.Library.DatItems /// OpenMSX sub item type /// [JsonProperty("original", DefaultValueHandling = DefaultValueHandling.Ignore)] - public OpenMSXOriginal Original { get; set; } + public Original Original { get; set; } /// /// OpenMSX sub item type @@ -395,7 +395,7 @@ namespace SabreTools.Library.DatItems #region OpenMSX if (mappings.Keys.Contains(Field.DatItem_Original)) - Original = new OpenMSXOriginal() { Content = mappings[Field.DatItem_Original] }; + Original = new Original() { Content = mappings[Field.DatItem_Original] }; if (mappings.Keys.Contains(Field.DatItem_OpenMSXSubType)) OpenMSXSubType = mappings[Field.DatItem_OpenMSXSubType].AsOpenMSXSubType(); @@ -478,6 +478,9 @@ namespace SabreTools.Library.DatItems case ItemType.Configuration: return new Configuration(); + + case ItemType.Control: + return new Control(); case ItemType.Device: return new Device(); diff --git a/SabreTools.Library/DatItems/Enums.cs b/SabreTools.Library/DatItems/Enums.cs index de91ab44..b08207cf 100644 --- a/SabreTools.Library/DatItems/Enums.cs +++ b/SabreTools.Library/DatItems/Enums.cs @@ -483,6 +483,7 @@ namespace SabreTools.Library.DatItems Chip, Condition, Configuration, + Control, Device, DeviceReference, DipSwitch, diff --git a/SabreTools.Library/DatItems/Machine.cs b/SabreTools.Library/DatItems/Machine.cs index 687001b0..c14cde18 100644 --- a/SabreTools.Library/DatItems/Machine.cs +++ b/SabreTools.Library/DatItems/Machine.cs @@ -264,13 +264,13 @@ namespace SabreTools.Library.DatItems /// /// Also in SoftwareList [JsonProperty("infos", DefaultValueHandling = DefaultValueHandling.Ignore)] - public List Infos { get; set; } = null; + public List Infos { get; set; } = null; /// /// List of shared feature items /// [JsonProperty("sharedfeat", DefaultValueHandling = DefaultValueHandling.Ignore)] - public List SharedFeatures { get; set; } = null; + public List SharedFeatures { get; set; } = null; #endregion diff --git a/SabreTools.Library/Tools/Converters.cs b/SabreTools.Library/Tools/Converters.cs index 0de9aa80..0e9e840d 100644 --- a/SabreTools.Library/Tools/Converters.cs +++ b/SabreTools.Library/Tools/Converters.cs @@ -1655,6 +1655,8 @@ namespace SabreTools.Library.Tools return ItemType.Condition; case "configuration": return ItemType.Configuration; + case "control": + return ItemType.Control; case "device": return ItemType.Device; case "device_ref": @@ -1713,6 +1715,7 @@ namespace SabreTools.Library.Tools "chip" => ItemType.Chip, "condition" => ItemType.Condition, "configuration" => ItemType.Configuration, + "control" => ItemType.Control, "device" => ItemType.Device, "device_ref" => ItemType.DeviceReference, "dipswitch" => ItemType.DipSwitch, @@ -2293,6 +2296,8 @@ namespace SabreTools.Library.Tools return "condition"; case ItemType.Configuration: return "configuration"; + case ItemType.Control: + return "control"; case ItemType.Device: return "device"; case ItemType.DeviceReference: @@ -2351,6 +2356,7 @@ namespace SabreTools.Library.Tools ItemType.Chip => "chip", ItemType.Condition => "condition", ItemType.Configuration => "configuration", + ItemType.Control => "control", ItemType.Device => "device", ItemType.DeviceReference => "device_ref", ItemType.DipSwitch => "dipswitch",