mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Display pixclock to long?
This commit is contained in:
@@ -363,7 +363,6 @@ namespace SabreTools.Library.DatFiles
|
|||||||
DisplayType = reader.GetAttribute("type").AsDisplayType(),
|
DisplayType = reader.GetAttribute("type").AsDisplayType(),
|
||||||
FlipX = reader.GetAttribute("flipx").AsYesNo(),
|
FlipX = reader.GetAttribute("flipx").AsYesNo(),
|
||||||
Refresh = reader.GetAttribute("refresh"),
|
Refresh = reader.GetAttribute("refresh"),
|
||||||
PixClock = reader.GetAttribute("pixclock"),
|
|
||||||
HTotal = reader.GetAttribute("htotal"),
|
HTotal = reader.GetAttribute("htotal"),
|
||||||
HBEnd = reader.GetAttribute("hbend"),
|
HBEnd = reader.GetAttribute("hbend"),
|
||||||
HBStart = reader.GetAttribute("hbstart"),
|
HBStart = reader.GetAttribute("hbstart"),
|
||||||
@@ -399,6 +398,13 @@ namespace SabreTools.Library.DatFiles
|
|||||||
display.Height = height;
|
display.Height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set the pixclock
|
||||||
|
if (reader.GetAttribute("pixclock") != null)
|
||||||
|
{
|
||||||
|
if (Int64.TryParse(reader.GetAttribute("pixclock"), out long pixclock))
|
||||||
|
display.PixClock = pixclock;
|
||||||
|
}
|
||||||
|
|
||||||
datItems.Add(display);
|
datItems.Add(display);
|
||||||
|
|
||||||
reader.Read();
|
reader.Read();
|
||||||
@@ -1556,7 +1562,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
xtw.WriteOptionalAttributeString("width", display.Width?.ToString());
|
xtw.WriteOptionalAttributeString("width", display.Width?.ToString());
|
||||||
xtw.WriteOptionalAttributeString("height", display.Height?.ToString());
|
xtw.WriteOptionalAttributeString("height", display.Height?.ToString());
|
||||||
xtw.WriteOptionalAttributeString("refresh", display.Refresh);
|
xtw.WriteOptionalAttributeString("refresh", display.Refresh);
|
||||||
xtw.WriteOptionalAttributeString("pixclock", display.PixClock);
|
xtw.WriteOptionalAttributeString("pixclock", display.PixClock?.ToString());
|
||||||
xtw.WriteOptionalAttributeString("htotal", display.HTotal);
|
xtw.WriteOptionalAttributeString("htotal", display.HTotal);
|
||||||
xtw.WriteOptionalAttributeString("hbend", display.HBEnd);
|
xtw.WriteOptionalAttributeString("hbend", display.HBEnd);
|
||||||
xtw.WriteOptionalAttributeString("hstart", display.HBStart);
|
xtw.WriteOptionalAttributeString("hstart", display.HBStart);
|
||||||
|
|||||||
@@ -1442,7 +1442,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
xtw.WriteOptionalAttributeString("width", display.Width?.ToString());
|
xtw.WriteOptionalAttributeString("width", display.Width?.ToString());
|
||||||
xtw.WriteOptionalAttributeString("height", display.Height?.ToString());
|
xtw.WriteOptionalAttributeString("height", display.Height?.ToString());
|
||||||
xtw.WriteOptionalAttributeString("refresh", display.Refresh);
|
xtw.WriteOptionalAttributeString("refresh", display.Refresh);
|
||||||
xtw.WriteOptionalAttributeString("pixclock", display.PixClock);
|
xtw.WriteOptionalAttributeString("pixclock", display.PixClock?.ToString());
|
||||||
xtw.WriteOptionalAttributeString("htotal", display.HTotal);
|
xtw.WriteOptionalAttributeString("htotal", display.HTotal);
|
||||||
xtw.WriteOptionalAttributeString("hbend", display.HBEnd);
|
xtw.WriteOptionalAttributeString("hbend", display.HBEnd);
|
||||||
xtw.WriteOptionalAttributeString("hstart", display.HBStart);
|
xtw.WriteOptionalAttributeString("hstart", display.HBStart);
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// Pixel clock timer
|
/// Pixel clock timer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("pixclock", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("pixclock", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
public string PixClock { get; set; } // TODO: Int32? Float?
|
public long? PixClock { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Total horizontal lines
|
/// Total horizontal lines
|
||||||
@@ -147,7 +147,10 @@ namespace SabreTools.Library.DatItems
|
|||||||
Refresh = mappings[Field.DatItem_Refresh];
|
Refresh = mappings[Field.DatItem_Refresh];
|
||||||
|
|
||||||
if (mappings.Keys.Contains(Field.DatItem_PixClock))
|
if (mappings.Keys.Contains(Field.DatItem_PixClock))
|
||||||
PixClock = mappings[Field.DatItem_PixClock];
|
{
|
||||||
|
if (Int64.TryParse(mappings[Field.DatItem_PixClock], out long pixClock))
|
||||||
|
PixClock = pixClock;
|
||||||
|
}
|
||||||
|
|
||||||
if (mappings.Keys.Contains(Field.DatItem_HTotal))
|
if (mappings.Keys.Contains(Field.DatItem_HTotal))
|
||||||
HTotal = mappings[Field.DatItem_HTotal];
|
HTotal = mappings[Field.DatItem_HTotal];
|
||||||
@@ -298,9 +301,9 @@ namespace SabreTools.Library.DatItems
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Filter on pixclock
|
// Filter on pixclock
|
||||||
if (filter.DatItem_PixClock.MatchesPositiveSet(PixClock) == false)
|
if (filter.DatItem_PixClock.MatchesPositive(null, PixClock) == false)
|
||||||
return false;
|
return false;
|
||||||
if (filter.DatItem_PixClock.MatchesNegativeSet(PixClock) == true)
|
if (filter.DatItem_PixClock.MatchesNegative(null, PixClock) == true)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Filter on htotal
|
// Filter on htotal
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ namespace SabreTools.Library.Filtering
|
|||||||
public FilterItem<long?> DatItem_Width { get; private set; } = new FilterItem<long?>() { Positive = null, Negative = null, Neutral = null };
|
public FilterItem<long?> DatItem_Width { get; private set; } = new FilterItem<long?>() { Positive = null, Negative = null, Neutral = null };
|
||||||
public FilterItem<long?> DatItem_Height { get; private set; } = new FilterItem<long?>() { Positive = null, Negative = null, Neutral = null };
|
public FilterItem<long?> DatItem_Height { get; private set; } = new FilterItem<long?>() { Positive = null, Negative = null, Neutral = null };
|
||||||
public FilterItem<string> DatItem_Refresh { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_Refresh { get; private set; } = new FilterItem<string>();
|
||||||
public FilterItem<string> DatItem_PixClock { get; private set; } = new FilterItem<string>();
|
public FilterItem<long?> DatItem_PixClock { get; private set; } = new FilterItem<long?>() { Positive = null, Negative = null, Neutral = null };
|
||||||
public FilterItem<string> DatItem_HTotal { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_HTotal { get; private set; } = new FilterItem<string>();
|
||||||
public FilterItem<string> DatItem_HBEnd { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_HBEnd { get; private set; } = new FilterItem<string>();
|
||||||
public FilterItem<string> DatItem_HBStart { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_HBStart { get; private set; } = new FilterItem<string>();
|
||||||
@@ -859,7 +859,7 @@ namespace SabreTools.Library.Filtering
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case Field.DatItem_PixClock:
|
case Field.DatItem_PixClock:
|
||||||
SetStringFilter(DatItem_PixClock, value, negate);
|
SetOptionalLongFilter(DatItem_PixClock, value, negate);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Field.DatItem_HTotal:
|
case Field.DatItem_HTotal:
|
||||||
|
|||||||
Reference in New Issue
Block a user