mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Promote Configuration
This commit is contained in:
@@ -218,6 +218,26 @@ namespace SabreTools.Library.DatFiles
|
|||||||
reader.Read();
|
reader.Read();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "configuration":
|
||||||
|
var configuration = new Configuration
|
||||||
|
{
|
||||||
|
Name = reader.GetAttribute("name"),
|
||||||
|
Tag = reader.GetAttribute("tag"),
|
||||||
|
Mask = reader.GetAttribute("mask"),
|
||||||
|
Conditions = new List<ListXmlCondition>(),
|
||||||
|
Locations = new List<ListXmlConfLocation>(),
|
||||||
|
Settings = new List<ListXmlConfSetting>(),
|
||||||
|
};
|
||||||
|
|
||||||
|
// Now read the internal tags
|
||||||
|
ReadConfiguration(reader.ReadSubtree(), configuration);
|
||||||
|
|
||||||
|
datItems.Add(configuration);
|
||||||
|
|
||||||
|
// Skip the configuration now that we've processed it
|
||||||
|
reader.Skip();
|
||||||
|
break;
|
||||||
|
|
||||||
case "device_ref":
|
case "device_ref":
|
||||||
datItems.Add(new DeviceReference
|
datItems.Add(new DeviceReference
|
||||||
{
|
{
|
||||||
@@ -410,25 +430,6 @@ namespace SabreTools.Library.DatFiles
|
|||||||
reader.Skip();
|
reader.Skip();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "configuration":
|
|
||||||
var configuration = new ListXmlConfiguration();
|
|
||||||
configuration.Name = reader.GetAttribute("name");
|
|
||||||
configuration.Tag = reader.GetAttribute("tag");
|
|
||||||
configuration.Mask = reader.GetAttribute("mask");
|
|
||||||
|
|
||||||
// Now read the internal tags
|
|
||||||
ReadConfiguration(reader.ReadSubtree(), configuration);
|
|
||||||
|
|
||||||
// Ensure the list exists
|
|
||||||
if (machine.Configurations == null)
|
|
||||||
machine.Configurations = new List<ListXmlConfiguration>();
|
|
||||||
|
|
||||||
machine.Configurations.Add(configuration);
|
|
||||||
|
|
||||||
// Skip the configuration now that we've processed it
|
|
||||||
reader.Skip();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "port":
|
case "port":
|
||||||
var port = new ListXmlPort();
|
var port = new ListXmlPort();
|
||||||
port.Tag = reader.GetAttribute("tag");
|
port.Tag = reader.GetAttribute("tag");
|
||||||
@@ -781,8 +782,8 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// Read Configuration information
|
/// Read Configuration information
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader">XmlReader representing a diskarea block</param>
|
/// <param name="reader">XmlReader representing a diskarea block</param>
|
||||||
/// <param name="configuration">ListXmlConfiguration to populate</param>
|
/// <param name="configuration">Configuration to populate</param>
|
||||||
private void ReadConfiguration(XmlReader reader, ListXmlConfiguration configuration)
|
private void ReadConfiguration(XmlReader reader, Configuration configuration)
|
||||||
{
|
{
|
||||||
// If we have an empty configuration, skip it
|
// If we have an empty configuration, skip it
|
||||||
if (reader == null)
|
if (reader == null)
|
||||||
@@ -1362,64 +1363,6 @@ namespace SabreTools.Library.DatFiles
|
|||||||
xtw.WriteEndElement();
|
xtw.WriteEndElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (datItem.Machine.Configurations != null)
|
|
||||||
{
|
|
||||||
foreach (var configuration in datItem.Machine.Configurations)
|
|
||||||
{
|
|
||||||
xtw.WriteStartElement("configuration");
|
|
||||||
|
|
||||||
xtw.WriteOptionalAttributeString("name", configuration.Name);
|
|
||||||
xtw.WriteOptionalAttributeString("tag", configuration.Tag);
|
|
||||||
xtw.WriteOptionalAttributeString("mask", configuration.Mask);
|
|
||||||
|
|
||||||
if (configuration.Conditions != null)
|
|
||||||
{
|
|
||||||
foreach (var condition in configuration.Conditions)
|
|
||||||
{
|
|
||||||
xtw.WriteStartElement("condition");
|
|
||||||
|
|
||||||
xtw.WriteOptionalAttributeString("tag", condition.Tag);
|
|
||||||
xtw.WriteOptionalAttributeString("mask", condition.Mask);
|
|
||||||
xtw.WriteOptionalAttributeString("relation", condition.Relation);
|
|
||||||
xtw.WriteOptionalAttributeString("value", condition.Value);
|
|
||||||
|
|
||||||
// End condition
|
|
||||||
xtw.WriteEndElement();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (configuration.Locations != null)
|
|
||||||
{
|
|
||||||
foreach (var location in configuration.Locations)
|
|
||||||
{
|
|
||||||
xtw.WriteStartElement("conflocation");
|
|
||||||
|
|
||||||
xtw.WriteOptionalAttributeString("name", location.Name);
|
|
||||||
xtw.WriteOptionalAttributeString("number", location.Number);
|
|
||||||
xtw.WriteOptionalAttributeString("inverted", location.Inverted.FromYesNo());
|
|
||||||
|
|
||||||
// End conflocation
|
|
||||||
xtw.WriteEndElement();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (configuration.Settings != null)
|
|
||||||
{
|
|
||||||
foreach (var setting in configuration.Settings)
|
|
||||||
{
|
|
||||||
xtw.WriteStartElement("confsetting");
|
|
||||||
|
|
||||||
xtw.WriteOptionalAttributeString("name", setting.Name);
|
|
||||||
xtw.WriteOptionalAttributeString("value", setting.Value);
|
|
||||||
xtw.WriteOptionalAttributeString("default", setting.Default.FromYesNo());
|
|
||||||
|
|
||||||
// End confsetting
|
|
||||||
xtw.WriteEndElement();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// End configuration
|
|
||||||
xtw.WriteEndElement();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (datItem.Machine.Ports != null)
|
if (datItem.Machine.Ports != null)
|
||||||
{
|
{
|
||||||
foreach (var port in datItem.Machine.Ports)
|
foreach (var port in datItem.Machine.Ports)
|
||||||
@@ -1633,6 +1576,50 @@ namespace SabreTools.Library.DatFiles
|
|||||||
xtw.WriteEndElement();
|
xtw.WriteEndElement();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ItemType.Configuration:
|
||||||
|
var configuration = datItem as Configuration;
|
||||||
|
xtw.WriteStartElement("configuration");
|
||||||
|
xtw.WriteOptionalAttributeString("name", configuration.Name);
|
||||||
|
xtw.WriteOptionalAttributeString("tag", configuration.Tag);
|
||||||
|
xtw.WriteOptionalAttributeString("mask", configuration.Mask);
|
||||||
|
|
||||||
|
if (configuration.Conditions != null)
|
||||||
|
{
|
||||||
|
foreach (var condition in configuration.Conditions)
|
||||||
|
{
|
||||||
|
xtw.WriteStartElement("condition");
|
||||||
|
xtw.WriteOptionalAttributeString("tag", condition.Tag);
|
||||||
|
xtw.WriteOptionalAttributeString("mask", condition.Mask);
|
||||||
|
xtw.WriteOptionalAttributeString("relation", condition.Relation);
|
||||||
|
xtw.WriteOptionalAttributeString("value", condition.Value);
|
||||||
|
xtw.WriteEndElement();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (configuration.Locations != null)
|
||||||
|
{
|
||||||
|
foreach (var location in configuration.Locations)
|
||||||
|
{
|
||||||
|
xtw.WriteStartElement("conflocation");
|
||||||
|
xtw.WriteOptionalAttributeString("name", location.Name);
|
||||||
|
xtw.WriteOptionalAttributeString("number", location.Number);
|
||||||
|
xtw.WriteOptionalAttributeString("inverted", location.Inverted.FromYesNo());
|
||||||
|
xtw.WriteEndElement();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (configuration.Settings != null)
|
||||||
|
{
|
||||||
|
foreach (var setting in configuration.Settings)
|
||||||
|
{
|
||||||
|
xtw.WriteStartElement("confsetting");
|
||||||
|
xtw.WriteOptionalAttributeString("name", setting.Name);
|
||||||
|
xtw.WriteOptionalAttributeString("value", setting.Value);
|
||||||
|
xtw.WriteOptionalAttributeString("default", setting.Default.FromYesNo());
|
||||||
|
xtw.WriteEndElement();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xtw.WriteEndElement();
|
||||||
|
break;
|
||||||
|
|
||||||
case ItemType.DeviceReference:
|
case ItemType.DeviceReference:
|
||||||
xtw.WriteStartElement("device_ref");
|
xtw.WriteStartElement("device_ref");
|
||||||
xtw.WriteRequiredAttributeString("name", datItem.Name);
|
xtw.WriteRequiredAttributeString("name", datItem.Name);
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
|
|
||||||
public override bool Equals(DatItem other)
|
public override bool Equals(DatItem other)
|
||||||
{
|
{
|
||||||
// If we don't have a BiosSet, return false
|
// If we don't have a Adjuster, return false
|
||||||
if (ItemType != other.ItemType)
|
if (ItemType != other.ItemType)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
@@ -41,32 +41,6 @@ namespace SabreTools.Library.DatItems
|
|||||||
public string Value { get; set; }
|
public string Value { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents one ListXML configuration
|
|
||||||
/// </summary>
|
|
||||||
/// TODO: Promote to DatItem level (contains lists)
|
|
||||||
[JsonObject("configuration")]
|
|
||||||
public class ListXmlConfiguration
|
|
||||||
{
|
|
||||||
[JsonProperty("name")]
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("tag")]
|
|
||||||
public string Tag { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("mask")]
|
|
||||||
public string Mask { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("conditions")]
|
|
||||||
public List<ListXmlCondition> Conditions { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("locations")]
|
|
||||||
public List<ListXmlConfLocation> Locations { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("settings")]
|
|
||||||
public List<ListXmlConfSetting> Settings { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents one ListXML conflocation
|
/// Represents one ListXML conflocation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
256
SabreTools.Library/DatItems/Configuration.cs
Normal file
256
SabreTools.Library/DatItems/Configuration.cs
Normal file
@@ -0,0 +1,256 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
using SabreTools.Library.Filtering;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace SabreTools.Library.DatItems
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents which Configuration(s) is associated with a set
|
||||||
|
/// </summary>
|
||||||
|
[JsonObject("configuration")]
|
||||||
|
public class Configuration : DatItem
|
||||||
|
{
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tag associated with the configuration
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("tag", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
public string Tag { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Mask associated with the configuration
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("mask", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
public string Mask { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Conditions associated with the configuration
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("conditions")]
|
||||||
|
public List<ListXmlCondition> Conditions { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Locations associated with the configuration
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("locations")]
|
||||||
|
public List<ListXmlConfLocation> Locations { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Settings associated with the configuration
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("settings")]
|
||||||
|
public List<ListXmlConfSetting> Settings { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Accessors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set fields with given values
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mappings">Mappings dictionary</param>
|
||||||
|
public override void SetFields(Dictionary<Field, string> mappings)
|
||||||
|
{
|
||||||
|
// Set base fields
|
||||||
|
base.SetFields(mappings);
|
||||||
|
|
||||||
|
// Handle Configuration-specific fields
|
||||||
|
if (mappings.Keys.Contains(Field.DatItem_Tag))
|
||||||
|
Tag = mappings[Field.DatItem_Tag];
|
||||||
|
|
||||||
|
if (mappings.Keys.Contains(Field.DatItem_Mask))
|
||||||
|
Mask = mappings[Field.DatItem_Mask];
|
||||||
|
|
||||||
|
// TODO: Handle DatItem_Condition*
|
||||||
|
// TODO: Handle DatItem_Location*
|
||||||
|
// TODO: Handle DatItem_Setting*
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a default, empty Configuration object
|
||||||
|
/// </summary>
|
||||||
|
public Configuration()
|
||||||
|
{
|
||||||
|
Name = string.Empty;
|
||||||
|
ItemType = ItemType.Configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Cloning Methods
|
||||||
|
|
||||||
|
public override object Clone()
|
||||||
|
{
|
||||||
|
return new Configuration()
|
||||||
|
{
|
||||||
|
Name = this.Name,
|
||||||
|
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,
|
||||||
|
|
||||||
|
Tag = this.Tag,
|
||||||
|
Mask = this.Mask,
|
||||||
|
Conditions = this.Conditions,
|
||||||
|
Locations = this.Locations,
|
||||||
|
Settings = this.Settings,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Comparision Methods
|
||||||
|
|
||||||
|
public override bool Equals(DatItem other)
|
||||||
|
{
|
||||||
|
// If we don't have a Configuration, return false
|
||||||
|
if (ItemType != other.ItemType)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Otherwise, treat it as a Configuration
|
||||||
|
Configuration newOther = other as Configuration;
|
||||||
|
|
||||||
|
// If the Adjuster information matches
|
||||||
|
return (Name == newOther.Name && Tag == newOther.Tag && Mask == newOther.Mask);
|
||||||
|
|
||||||
|
// TODO: Handle DatItem_Condition*
|
||||||
|
// TODO: Handle DatItem_Location*
|
||||||
|
// TODO: Handle DatItem_Setting*
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Filtering
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check to see if a DatItem passes the filter
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filter">Filter to check against</param>
|
||||||
|
/// <returns>True if the item passed the filter, false otherwise</returns>
|
||||||
|
public override bool PassesFilter(Filter filter)
|
||||||
|
{
|
||||||
|
// Check common fields first
|
||||||
|
if (!base.PassesFilter(filter))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on tag
|
||||||
|
if (filter.DatItem_Tag.MatchesPositiveSet(Tag) == false)
|
||||||
|
return false;
|
||||||
|
if (filter.DatItem_Tag.MatchesNegativeSet(Tag) == true)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on mask
|
||||||
|
if (filter.DatItem_Mask.MatchesPositiveSet(Mask) == false)
|
||||||
|
return false;
|
||||||
|
if (filter.DatItem_Mask.MatchesNegativeSet(Mask) == true)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// TODO: Handle DatItem_Condition*
|
||||||
|
// TODO: Handle DatItem_Location*
|
||||||
|
// TODO: Handle DatItem_Setting*
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove fields from the DatItem
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fields">List of Fields to remove</param>
|
||||||
|
public override void RemoveFields(List<Field> fields)
|
||||||
|
{
|
||||||
|
// Remove common fields first
|
||||||
|
base.RemoveFields(fields);
|
||||||
|
|
||||||
|
// Remove the fields
|
||||||
|
if (fields.Contains(Field.DatItem_Tag))
|
||||||
|
Tag = null;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Mask))
|
||||||
|
Mask = null;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Conditions))
|
||||||
|
Conditions = null;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Locations))
|
||||||
|
Locations = null;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Settings))
|
||||||
|
Settings = null;
|
||||||
|
|
||||||
|
// TODO: Handle DatItem_Condition*
|
||||||
|
// TODO: Handle DatItem_Location*
|
||||||
|
// TODO: Handle DatItem_Setting*
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Sorting and Merging
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replace fields from another item
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item">DatItem to pull new information from</param>
|
||||||
|
/// <param name="fields">List of Fields representing what should be updated</param>
|
||||||
|
public override void ReplaceFields(DatItem item, List<Field> fields)
|
||||||
|
{
|
||||||
|
// Replace common fields first
|
||||||
|
base.ReplaceFields(item, fields);
|
||||||
|
|
||||||
|
// If we don't have a Configuration to replace from, ignore specific fields
|
||||||
|
if (item.ItemType != ItemType.Configuration)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Cast for easier access
|
||||||
|
Configuration newItem = item as Configuration;
|
||||||
|
|
||||||
|
// Replace the fields
|
||||||
|
if (fields.Contains(Field.DatItem_Tag))
|
||||||
|
Tag = newItem.Tag;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Mask))
|
||||||
|
Mask = newItem.Mask;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Conditions))
|
||||||
|
Conditions = newItem.Conditions;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Locations))
|
||||||
|
Locations = newItem.Locations;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Settings))
|
||||||
|
Settings = newItem.Settings;
|
||||||
|
|
||||||
|
// TODO: Handle DatItem_Condition*
|
||||||
|
// TODO: Handle DatItem_Location*
|
||||||
|
// TODO: Handle DatItem_Setting*
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -197,24 +197,6 @@ namespace SabreTools.Library.DatItems
|
|||||||
Machine_DipSwitch_Value_Value,
|
Machine_DipSwitch_Value_Value,
|
||||||
Machine_DipSwitch_Value_Default,
|
Machine_DipSwitch_Value_Default,
|
||||||
|
|
||||||
// Configurations
|
|
||||||
Machine_Configurations,
|
|
||||||
Machine_Configuration_Name,
|
|
||||||
Machine_Configuration_Tag,
|
|
||||||
Machine_Configuration_Mask,
|
|
||||||
|
|
||||||
// Configurations.Locations
|
|
||||||
Machine_Configuration_Locations,
|
|
||||||
Machine_Configuration_Location_Name,
|
|
||||||
Machine_Configuration_Location_Number,
|
|
||||||
Machine_Configuration_Location_Inverted,
|
|
||||||
|
|
||||||
// Configurations.Settings
|
|
||||||
Machine_Configuration_Settings,
|
|
||||||
Machine_Configuration_Setting_Name,
|
|
||||||
Machine_Configuration_Setting_Value,
|
|
||||||
Machine_Configuration_Setting_Default,
|
|
||||||
|
|
||||||
// Ports
|
// Ports
|
||||||
Machine_Ports,
|
Machine_Ports,
|
||||||
Machine_Port_Tag,
|
Machine_Port_Tag,
|
||||||
@@ -407,6 +389,21 @@ namespace SabreTools.Library.DatItems
|
|||||||
DatItem_ChipType,
|
DatItem_ChipType,
|
||||||
DatItem_Clock,
|
DatItem_Clock,
|
||||||
|
|
||||||
|
// Configuration
|
||||||
|
DatItem_Mask,
|
||||||
|
|
||||||
|
// Configuration.Locations
|
||||||
|
DatItem_Locations,
|
||||||
|
DatItem_Location_Name,
|
||||||
|
DatItem_Location_Number,
|
||||||
|
DatItem_Location_Inverted,
|
||||||
|
|
||||||
|
// Configuration.Settings
|
||||||
|
DatItem_Settings,
|
||||||
|
DatItem_Setting_Name,
|
||||||
|
DatItem_Setting_Value,
|
||||||
|
DatItem_Setting_Default,
|
||||||
|
|
||||||
// Ram Option
|
// Ram Option
|
||||||
DatItem_Content,
|
DatItem_Content,
|
||||||
|
|
||||||
@@ -457,6 +454,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
Archive,
|
Archive,
|
||||||
BiosSet,
|
BiosSet,
|
||||||
Chip,
|
Chip,
|
||||||
|
Configuration,
|
||||||
DeviceReference,
|
DeviceReference,
|
||||||
RamOption,
|
RamOption,
|
||||||
Release,
|
Release,
|
||||||
|
|||||||
@@ -184,12 +184,6 @@ namespace SabreTools.Library.DatItems
|
|||||||
[JsonProperty("dipswitches", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("dipswitches", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
public List<ListXmlDipSwitch> DipSwitches { get; set; } = null;
|
public List<ListXmlDipSwitch> DipSwitches { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// List of associated configurations
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("configurations", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
||||||
public List<ListXmlConfiguration> Configurations { get; set; } = null;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// List of associated ports
|
/// List of associated ports
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -577,7 +571,6 @@ namespace SabreTools.Library.DatItems
|
|||||||
Conditions = this.Conditions,
|
Conditions = this.Conditions,
|
||||||
Inputs = this.Inputs,
|
Inputs = this.Inputs,
|
||||||
DipSwitches = this.DipSwitches,
|
DipSwitches = this.DipSwitches,
|
||||||
Configurations = this.Configurations,
|
|
||||||
Ports = this.Ports,
|
Ports = this.Ports,
|
||||||
Drivers = this.Drivers,
|
Drivers = this.Drivers,
|
||||||
Features = this.Features,
|
Features = this.Features,
|
||||||
|
|||||||
@@ -119,24 +119,6 @@ namespace SabreTools.Library.Filtering
|
|||||||
public FilterItem<string> Machine_DipSwitch_Value_Value { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> Machine_DipSwitch_Value_Value { get; private set; } = new FilterItem<string>();
|
||||||
public FilterItem<bool?> Machine_DipSwitch_Value_Default { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
public FilterItem<bool?> Machine_DipSwitch_Value_Default { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
|
|
||||||
// Configurations
|
|
||||||
public FilterItem<bool?> Machine_Configurations { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
|
||||||
public FilterItem<string> Machine_Configuration_Name { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> Machine_Configuration_Tag { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> Machine_Configuration_Mask { get; private set; } = new FilterItem<string>();
|
|
||||||
|
|
||||||
// Configurations.Locations
|
|
||||||
public FilterItem<bool?> Machine_Configuration_Locations { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
|
||||||
public FilterItem<string> Machine_Configuration_Location_Name { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> Machine_Configuration_Location_Number { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<bool?> Machine_Configuration_Location_Inverted { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
|
||||||
|
|
||||||
// Configurations.Settings
|
|
||||||
public FilterItem<bool?> Machine_Configuration_Settings { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
|
||||||
public FilterItem<string> Machine_Configuration_Setting_Name { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> Machine_Configuration_Setting_Value { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<bool?> Machine_Configuration_Setting_Default { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
|
||||||
|
|
||||||
// Ports
|
// Ports
|
||||||
public FilterItem<bool?> Machine_Ports { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
public FilterItem<bool?> Machine_Ports { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
public FilterItem<string> Machine_Port_Tag { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> Machine_Port_Tag { get; private set; } = new FilterItem<string>();
|
||||||
@@ -329,6 +311,21 @@ namespace SabreTools.Library.Filtering
|
|||||||
public FilterItem<string> DatItem_ChipType { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_ChipType { get; private set; } = new FilterItem<string>();
|
||||||
public FilterItem<string> DatItem_Clock { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_Clock { get; private set; } = new FilterItem<string>();
|
||||||
|
|
||||||
|
// Configuration
|
||||||
|
public FilterItem<string> DatItem_Mask { get; private set; } = new FilterItem<string>();
|
||||||
|
|
||||||
|
// Configuration.Locations
|
||||||
|
public FilterItem<bool?> DatItem_Locations { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
|
public FilterItem<string> DatItem_Location_Name { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<string> DatItem_Location_Number { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<bool?> DatItem_Location_Inverted { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
|
|
||||||
|
// Configuration.Settings
|
||||||
|
public FilterItem<bool?> DatItem_Settings { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
|
public FilterItem<string> DatItem_Setting_Name { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<string> DatItem_Setting_Value { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<bool?> DatItem_Setting_Default { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
|
|
||||||
// Ram Option
|
// Ram Option
|
||||||
public FilterItem<string> DatItem_Content { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_Content { get; private set; } = new FilterItem<string>();
|
||||||
|
|
||||||
@@ -938,93 +935,6 @@ namespace SabreTools.Library.Filtering
|
|||||||
Machine_DipSwitch_Value_Default.Neutral = true;
|
Machine_DipSwitch_Value_Default.Neutral = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Configurations
|
|
||||||
case Field.Machine_Configurations:
|
|
||||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
|
||||||
Machine_Configurations.Neutral = false;
|
|
||||||
else
|
|
||||||
Machine_Configurations.Neutral = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Configuration_Name:
|
|
||||||
if (negate)
|
|
||||||
Machine_Configuration_Name.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Configuration_Name.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Configuration_Tag:
|
|
||||||
if (negate)
|
|
||||||
Machine_Configuration_Tag.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Configuration_Tag.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Configuration_Mask:
|
|
||||||
if (negate)
|
|
||||||
Machine_Configuration_Mask.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Configuration_Mask.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Configurations.Locations
|
|
||||||
case Field.Machine_Configuration_Locations:
|
|
||||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
|
||||||
Machine_Configuration_Locations.Neutral = false;
|
|
||||||
else
|
|
||||||
Machine_Configuration_Locations.Neutral = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Configuration_Location_Name:
|
|
||||||
if (negate)
|
|
||||||
Machine_Configuration_Location_Name.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Configuration_Location_Name.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Configuration_Location_Number:
|
|
||||||
if (negate)
|
|
||||||
Machine_Configuration_Location_Number.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Configuration_Location_Number.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Configuration_Location_Inverted:
|
|
||||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
|
||||||
Machine_Configuration_Location_Inverted.Neutral = false;
|
|
||||||
else
|
|
||||||
Machine_Configuration_Location_Inverted.Neutral = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Configurations.Settings
|
|
||||||
case Field.Machine_Configuration_Settings:
|
|
||||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
|
||||||
Machine_Configuration_Settings.Neutral = false;
|
|
||||||
else
|
|
||||||
Machine_Configuration_Settings.Neutral = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Configuration_Setting_Name:
|
|
||||||
if (negate)
|
|
||||||
Machine_Configuration_Setting_Name.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Configuration_Setting_Name.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Configuration_Setting_Value:
|
|
||||||
if (negate)
|
|
||||||
Machine_Configuration_Setting_Value.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Configuration_Setting_Value.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Configuration_Setting_Default:
|
|
||||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
|
||||||
Machine_Configuration_Setting_Default.Neutral = false;
|
|
||||||
else
|
|
||||||
Machine_Configuration_Setting_Default.Neutral = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Ports
|
// Ports
|
||||||
case Field.Machine_Ports:
|
case Field.Machine_Ports:
|
||||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
||||||
@@ -1884,6 +1794,72 @@ namespace SabreTools.Library.Filtering
|
|||||||
DatItem_Clock.PositiveSet.Add(value);
|
DatItem_Clock.PositiveSet.Add(value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Configuration
|
||||||
|
case Field.DatItem_Mask:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Mask.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Mask.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Configurations.Locations
|
||||||
|
case Field.DatItem_Locations:
|
||||||
|
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
||||||
|
DatItem_Locations.Neutral = false;
|
||||||
|
else
|
||||||
|
DatItem_Locations.Neutral = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Location_Name:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Location_Name.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Location_Name.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Location_Number:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Location_Number.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Location_Number.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Location_Inverted:
|
||||||
|
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
||||||
|
DatItem_Location_Inverted.Neutral = false;
|
||||||
|
else
|
||||||
|
DatItem_Location_Inverted.Neutral = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Configurations.Settings
|
||||||
|
case Field.DatItem_Settings:
|
||||||
|
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
||||||
|
DatItem_Settings.Neutral = false;
|
||||||
|
else
|
||||||
|
DatItem_Settings.Neutral = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Setting_Name:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Setting_Name.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Setting_Name.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Setting_Value:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Setting_Value.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Setting_Value.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Setting_Default:
|
||||||
|
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
||||||
|
DatItem_Setting_Default.Neutral = false;
|
||||||
|
else
|
||||||
|
DatItem_Setting_Default.Neutral = true;
|
||||||
|
break;
|
||||||
|
|
||||||
// Ram Option
|
// Ram Option
|
||||||
case Field.DatItem_Content:
|
case Field.DatItem_Content:
|
||||||
if (negate)
|
if (negate)
|
||||||
|
|||||||
@@ -612,42 +612,6 @@ namespace SabreTools.Library.Tools
|
|||||||
case "dipswitch_value_default":
|
case "dipswitch_value_default":
|
||||||
return Field.Machine_DipSwitch_Value_Default;
|
return Field.Machine_DipSwitch_Value_Default;
|
||||||
|
|
||||||
case "configurations":
|
|
||||||
return Field.Machine_Configurations;
|
|
||||||
|
|
||||||
case "configuration_name":
|
|
||||||
return Field.Machine_Configuration_Name;
|
|
||||||
|
|
||||||
case "configuration_tag":
|
|
||||||
return Field.Machine_Configuration_Tag;
|
|
||||||
|
|
||||||
case "configuration_mask":
|
|
||||||
return Field.Machine_Configuration_Mask;
|
|
||||||
|
|
||||||
case "configuration_locations":
|
|
||||||
return Field.Machine_Configuration_Locations;
|
|
||||||
|
|
||||||
case "configuration_location_name":
|
|
||||||
return Field.Machine_Configuration_Location_Name;
|
|
||||||
|
|
||||||
case "configuration_location_number":
|
|
||||||
return Field.Machine_Configuration_Location_Number;
|
|
||||||
|
|
||||||
case "configuration_location_inverted":
|
|
||||||
return Field.Machine_Configuration_Location_Inverted;
|
|
||||||
|
|
||||||
case "configuration_settings":
|
|
||||||
return Field.Machine_Configuration_Settings;
|
|
||||||
|
|
||||||
case "configuration_setting_name":
|
|
||||||
return Field.Machine_Configuration_Setting_Name;
|
|
||||||
|
|
||||||
case "configuration_setting_value":
|
|
||||||
return Field.Machine_Configuration_Setting_Value;
|
|
||||||
|
|
||||||
case "configuration_setting_default":
|
|
||||||
return Field.Machine_Configuration_Setting_Default;
|
|
||||||
|
|
||||||
case "ports":
|
case "ports":
|
||||||
return Field.Machine_Ports;
|
return Field.Machine_Ports;
|
||||||
|
|
||||||
@@ -1070,6 +1034,34 @@ namespace SabreTools.Library.Tools
|
|||||||
case "clock":
|
case "clock":
|
||||||
return Field.DatItem_Clock;
|
return Field.DatItem_Clock;
|
||||||
|
|
||||||
|
// Configuration
|
||||||
|
case "mask":
|
||||||
|
return Field.DatItem_Mask;
|
||||||
|
|
||||||
|
case "locations":
|
||||||
|
return Field.DatItem_Locations;
|
||||||
|
|
||||||
|
case "location_name":
|
||||||
|
return Field.DatItem_Location_Name;
|
||||||
|
|
||||||
|
case "location_number":
|
||||||
|
return Field.DatItem_Location_Number;
|
||||||
|
|
||||||
|
case "location_inverted":
|
||||||
|
return Field.DatItem_Location_Inverted;
|
||||||
|
|
||||||
|
case "settings":
|
||||||
|
return Field.DatItem_Settings;
|
||||||
|
|
||||||
|
case "setting_name":
|
||||||
|
return Field.DatItem_Setting_Name;
|
||||||
|
|
||||||
|
case "setting_value":
|
||||||
|
return Field.DatItem_Setting_Value;
|
||||||
|
|
||||||
|
case "setting_default":
|
||||||
|
return Field.DatItem_Setting_Default;
|
||||||
|
|
||||||
// Ram Option
|
// Ram Option
|
||||||
case "content":
|
case "content":
|
||||||
return Field.DatItem_Content;
|
return Field.DatItem_Content;
|
||||||
|
|||||||
Reference in New Issue
Block a user