diff --git a/Core.Tests/Core.Tests.csproj b/Core.Tests/Core.Tests.csproj
index 520a1c9..d59db7c 100644
--- a/Core.Tests/Core.Tests.csproj
+++ b/Core.Tests/Core.Tests.csproj
@@ -84,7 +84,9 @@
PreserveNewest
-
+
+ PreserveNewest
+
diff --git a/Core.Tests/MenuSetHelperTests.cs b/Core.Tests/MenuSetHelperTests.cs
index b11d540..424822a 100644
--- a/Core.Tests/MenuSetHelperTests.cs
+++ b/Core.Tests/MenuSetHelperTests.cs
@@ -77,5 +77,24 @@ public void TestJsons(string filename)
Assert.True(menuset.LiveviewQuality.Any(q => q.Value == "vga"));
}
+
+ [Theory]
+ [InlineData("TestMenuSetTS5.json")]
+ public void TestJsonsGh3(string filename)
+ {
+ using (var stream = File.OpenRead(filename))
+ {
+ var reader = new StreamReader(stream);
+ var str = reader.ReadToEnd();
+ var obj = JsonConvert.DeserializeObject(str);
+ var serializer = new XmlSerializer(typeof(MenuSetRequestResult));
+ var result = (MenuSetRequestResult)serializer.Deserialize(new StringReader(obj.Data));
+ CameraParser.TryParseMenuSet(result.MenuSet, "en", out menuset, new CameraParser[] { new GH3Parser() });
+ }
+
+ Assert.Equal(2, menuset.LiveviewQuality.Count);
+ Assert.True(menuset.LiveviewQuality.Any(q => q.Value == "vga"));
+
+ }
}
}
\ No newline at end of file
diff --git a/Core/Camera/CameraParser.cs b/Core/Camera/CameraParser.cs
index a13d235..dce72e0 100644
--- a/Core/Camera/CameraParser.cs
+++ b/Core/Camera/CameraParser.cs
@@ -9,6 +9,18 @@
public abstract class CameraParser
{
+ protected static readonly TitledList DefaultIsoValues = new List
+ {
+ "100",
+ "200",
+ "400",
+ "800",
+ "1600",
+ "3200",
+ "6400",
+ "12800"
+ }.Select(i => new CameraMenuItemText(i, i, "setsetting", "iso", i)).ToTitledList("ISO Values");
+
public IReadOnlyDictionary ApertureBinary { get; } = new Dictionary
{
{ 392, "1.7" },
@@ -227,6 +239,11 @@ public virtual MenuSet ParseMenuSet(RawMenuSet menuset, string lang)
protected CameraMenuItemText ToMenuItem(Item item)
{
+ if (item == null)
+ {
+ return null;
+ }
+
return new CameraMenuItemText(item, GetText(item.TitleId));
}
diff --git a/Core/Camera/GH3Parser.cs b/Core/Camera/GH3Parser.cs
index aabe1d6..4db0d72 100644
--- a/Core/Camera/GH3Parser.cs
+++ b/Core/Camera/GH3Parser.cs
@@ -69,11 +69,11 @@ protected override bool InnerParseMenuSet(MenuSet result, RawMenuSet menuset, st
result.MeteringMode = ToMenuItems(photosettings["menu_item_id_lightmet"]);
result.ExposureShifts = ToMenuItems(qmenu["menu_item_id_exposure2"]);
- result.IsoValues = ToMenuItems(qmenu["menu_item_id_sensitivity"]);
+ result.IsoValues = ToMenuItems(qmenu["menu_item_id_sensitivity"]) ?? DefaultIsoValues;
result.WhiteBalances = ToMenuItems(qmenu["menu_item_id_whitebalance"]);
result.SingleShootMode = ToMenuItem(driveMode["menu_item_id_1shoot"]);
- result.BurstModes = ToMenuItems(driveMode["menu_item_id_burst"]);
+ result.BurstModes = ToMenuItems(driveMode["menu_item_id_burst"]) ?? ToMenuItems(photosettings["menu_item_id_burst"]);
result.VideoFormat = null;