Skip to content

Commit

Permalink
viewshedResolution should be an integer value.
Browse files Browse the repository at this point in the history
  • Loading branch information
shunter committed Mar 8, 2021
1 parent 76356a2 commit 4dfc687
Show file tree
Hide file tree
Showing 11 changed files with 114 additions and 111 deletions.
12 changes: 6 additions & 6 deletions DotNet/CesiumLanguageWriter/Generated/ConicSensorCesiumWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public class ConicSensorCesiumWriter : CesiumPropertyWriter<ConicSensorCesiumWri
private readonly Lazy<BooleanCesiumWriter> m_showViewshed = new Lazy<BooleanCesiumWriter>(() => new BooleanCesiumWriter(ShowViewshedPropertyName), false);
private readonly Lazy<ColorCesiumWriter> m_viewshedVisibleColor = new Lazy<ColorCesiumWriter>(() => new ColorCesiumWriter(ViewshedVisibleColorPropertyName), false);
private readonly Lazy<ColorCesiumWriter> m_viewshedOccludedColor = new Lazy<ColorCesiumWriter>(() => new ColorCesiumWriter(ViewshedOccludedColorPropertyName), false);
private readonly Lazy<DoubleCesiumWriter> m_viewshedResolution = new Lazy<DoubleCesiumWriter>(() => new DoubleCesiumWriter(ViewshedResolutionPropertyName), false);
private readonly Lazy<IntegerCesiumWriter> m_viewshedResolution = new Lazy<IntegerCesiumWriter>(() => new IntegerCesiumWriter(ViewshedResolutionPropertyName), false);

/// <summary>
/// Initializes a new instance.
Expand Down Expand Up @@ -2765,7 +2765,7 @@ public void WriteViewshedOccludedColorPropertyReference(string identifier, strin
/// Gets the writer for the <c>viewshedResolution</c> property. The returned instance must be opened by calling the <see cref="CesiumElementWriter.Open"/> method before it can be used for writing. The <c>viewshedResolution</c> property defines the resolution in pixels of the viewshed. If not specified, the default value is 2048.
/// </summary>
[NotNull]
public DoubleCesiumWriter ViewshedResolutionWriter
public IntegerCesiumWriter ViewshedResolutionWriter
{
get { return m_viewshedResolution.Value; }
}
Expand All @@ -2774,7 +2774,7 @@ public DoubleCesiumWriter ViewshedResolutionWriter
/// Opens and returns the writer for the <c>viewshedResolution</c> property. The <c>viewshedResolution</c> property defines the resolution in pixels of the viewshed. If not specified, the default value is 2048.
/// </summary>
[NotNull]
public DoubleCesiumWriter OpenViewshedResolutionProperty()
public IntegerCesiumWriter OpenViewshedResolutionProperty()
{
OpenIntervalIfNecessary();
return OpenAndReturn(ViewshedResolutionWriter);
Expand All @@ -2784,7 +2784,7 @@ public DoubleCesiumWriter OpenViewshedResolutionProperty()
/// Writes a value for the <c>viewshedResolution</c> property as a <c>number</c> value. The <c>viewshedResolution</c> property specifies the resolution in pixels of the viewshed. If not specified, the default value is 2048.
/// </summary>
/// <param name="value">The value.</param>
public void WriteViewshedResolutionProperty(double value)
public void WriteViewshedResolutionProperty(int value)
{
using (var writer = OpenViewshedResolutionProperty())
{
Expand All @@ -2797,7 +2797,7 @@ public void WriteViewshedResolutionProperty(double value)
/// </summary>
/// <param name="dates">The dates at which the value is specified.</param>
/// <param name="values">The values corresponding to each date.</param>
public void WriteViewshedResolutionProperty(IList<JulianDate> dates, IList<double> values)
public void WriteViewshedResolutionProperty(IList<JulianDate> dates, IList<int> values)
{
using (var writer = OpenViewshedResolutionProperty())
{
Expand All @@ -2812,7 +2812,7 @@ public void WriteViewshedResolutionProperty(IList<JulianDate> dates, IList<doubl
/// <param name="values">The value corresponding to each date.</param>
/// <param name="startIndex">The index of the first element to write.</param>
/// <param name="length">The number of elements to write.</param>
public void WriteViewshedResolutionProperty(IList<JulianDate> dates, IList<double> values, int startIndex, int length)
public void WriteViewshedResolutionProperty(IList<JulianDate> dates, IList<int> values, int startIndex, int length)
{
using (var writer = OpenViewshedResolutionProperty())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public class CustomPatternSensorCesiumWriter : CesiumPropertyWriter<CustomPatter
private readonly Lazy<BooleanCesiumWriter> m_showViewshed = new Lazy<BooleanCesiumWriter>(() => new BooleanCesiumWriter(ShowViewshedPropertyName), false);
private readonly Lazy<ColorCesiumWriter> m_viewshedVisibleColor = new Lazy<ColorCesiumWriter>(() => new ColorCesiumWriter(ViewshedVisibleColorPropertyName), false);
private readonly Lazy<ColorCesiumWriter> m_viewshedOccludedColor = new Lazy<ColorCesiumWriter>(() => new ColorCesiumWriter(ViewshedOccludedColorPropertyName), false);
private readonly Lazy<DoubleCesiumWriter> m_viewshedResolution = new Lazy<DoubleCesiumWriter>(() => new DoubleCesiumWriter(ViewshedResolutionPropertyName), false);
private readonly Lazy<IntegerCesiumWriter> m_viewshedResolution = new Lazy<IntegerCesiumWriter>(() => new IntegerCesiumWriter(ViewshedResolutionPropertyName), false);

/// <summary>
/// Initializes a new instance.
Expand Down Expand Up @@ -2378,7 +2378,7 @@ public void WriteViewshedOccludedColorPropertyReference(string identifier, strin
/// Gets the writer for the <c>viewshedResolution</c> property. The returned instance must be opened by calling the <see cref="CesiumElementWriter.Open"/> method before it can be used for writing. The <c>viewshedResolution</c> property defines the resolution in pixels of the viewshed. If not specified, the default value is 2048.
/// </summary>
[NotNull]
public DoubleCesiumWriter ViewshedResolutionWriter
public IntegerCesiumWriter ViewshedResolutionWriter
{
get { return m_viewshedResolution.Value; }
}
Expand All @@ -2387,7 +2387,7 @@ public DoubleCesiumWriter ViewshedResolutionWriter
/// Opens and returns the writer for the <c>viewshedResolution</c> property. The <c>viewshedResolution</c> property defines the resolution in pixels of the viewshed. If not specified, the default value is 2048.
/// </summary>
[NotNull]
public DoubleCesiumWriter OpenViewshedResolutionProperty()
public IntegerCesiumWriter OpenViewshedResolutionProperty()
{
OpenIntervalIfNecessary();
return OpenAndReturn(ViewshedResolutionWriter);
Expand All @@ -2397,7 +2397,7 @@ public DoubleCesiumWriter OpenViewshedResolutionProperty()
/// Writes a value for the <c>viewshedResolution</c> property as a <c>number</c> value. The <c>viewshedResolution</c> property specifies the resolution in pixels of the viewshed. If not specified, the default value is 2048.
/// </summary>
/// <param name="value">The value.</param>
public void WriteViewshedResolutionProperty(double value)
public void WriteViewshedResolutionProperty(int value)
{
using (var writer = OpenViewshedResolutionProperty())
{
Expand All @@ -2410,7 +2410,7 @@ public void WriteViewshedResolutionProperty(double value)
/// </summary>
/// <param name="dates">The dates at which the value is specified.</param>
/// <param name="values">The values corresponding to each date.</param>
public void WriteViewshedResolutionProperty(IList<JulianDate> dates, IList<double> values)
public void WriteViewshedResolutionProperty(IList<JulianDate> dates, IList<int> values)
{
using (var writer = OpenViewshedResolutionProperty())
{
Expand All @@ -2425,7 +2425,7 @@ public void WriteViewshedResolutionProperty(IList<JulianDate> dates, IList<doubl
/// <param name="values">The value corresponding to each date.</param>
/// <param name="startIndex">The index of the first element to write.</param>
/// <param name="length">The number of elements to write.</param>
public void WriteViewshedResolutionProperty(IList<JulianDate> dates, IList<double> values, int startIndex, int length)
public void WriteViewshedResolutionProperty(IList<JulianDate> dates, IList<int> values, int startIndex, int length)
{
using (var writer = OpenViewshedResolutionProperty())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public class RectangularSensorCesiumWriter : CesiumPropertyWriter<RectangularSen
private readonly Lazy<BooleanCesiumWriter> m_showViewshed = new Lazy<BooleanCesiumWriter>(() => new BooleanCesiumWriter(ShowViewshedPropertyName), false);
private readonly Lazy<ColorCesiumWriter> m_viewshedVisibleColor = new Lazy<ColorCesiumWriter>(() => new ColorCesiumWriter(ViewshedVisibleColorPropertyName), false);
private readonly Lazy<ColorCesiumWriter> m_viewshedOccludedColor = new Lazy<ColorCesiumWriter>(() => new ColorCesiumWriter(ViewshedOccludedColorPropertyName), false);
private readonly Lazy<DoubleCesiumWriter> m_viewshedResolution = new Lazy<DoubleCesiumWriter>(() => new DoubleCesiumWriter(ViewshedResolutionPropertyName), false);
private readonly Lazy<IntegerCesiumWriter> m_viewshedResolution = new Lazy<IntegerCesiumWriter>(() => new IntegerCesiumWriter(ViewshedResolutionPropertyName), false);

/// <summary>
/// Initializes a new instance.
Expand Down Expand Up @@ -2535,7 +2535,7 @@ public void WriteViewshedOccludedColorPropertyReference(string identifier, strin
/// Gets the writer for the <c>viewshedResolution</c> property. The returned instance must be opened by calling the <see cref="CesiumElementWriter.Open"/> method before it can be used for writing. The <c>viewshedResolution</c> property defines the resolution in pixels of the viewshed. If not specified, the default value is 2048.
/// </summary>
[NotNull]
public DoubleCesiumWriter ViewshedResolutionWriter
public IntegerCesiumWriter ViewshedResolutionWriter
{
get { return m_viewshedResolution.Value; }
}
Expand All @@ -2544,7 +2544,7 @@ public DoubleCesiumWriter ViewshedResolutionWriter
/// Opens and returns the writer for the <c>viewshedResolution</c> property. The <c>viewshedResolution</c> property defines the resolution in pixels of the viewshed. If not specified, the default value is 2048.
/// </summary>
[NotNull]
public DoubleCesiumWriter OpenViewshedResolutionProperty()
public IntegerCesiumWriter OpenViewshedResolutionProperty()
{
OpenIntervalIfNecessary();
return OpenAndReturn(ViewshedResolutionWriter);
Expand All @@ -2554,7 +2554,7 @@ public DoubleCesiumWriter OpenViewshedResolutionProperty()
/// Writes a value for the <c>viewshedResolution</c> property as a <c>number</c> value. The <c>viewshedResolution</c> property specifies the resolution in pixels of the viewshed. If not specified, the default value is 2048.
/// </summary>
/// <param name="value">The value.</param>
public void WriteViewshedResolutionProperty(double value)
public void WriteViewshedResolutionProperty(int value)
{
using (var writer = OpenViewshedResolutionProperty())
{
Expand All @@ -2567,7 +2567,7 @@ public void WriteViewshedResolutionProperty(double value)
/// </summary>
/// <param name="dates">The dates at which the value is specified.</param>
/// <param name="values">The values corresponding to each date.</param>
public void WriteViewshedResolutionProperty(IList<JulianDate> dates, IList<double> values)
public void WriteViewshedResolutionProperty(IList<JulianDate> dates, IList<int> values)
{
using (var writer = OpenViewshedResolutionProperty())
{
Expand All @@ -2582,7 +2582,7 @@ public void WriteViewshedResolutionProperty(IList<JulianDate> dates, IList<doubl
/// <param name="values">The value corresponding to each date.</param>
/// <param name="startIndex">The index of the first element to write.</param>
/// <param name="length">The number of elements to write.</param>
public void WriteViewshedResolutionProperty(IList<JulianDate> dates, IList<double> values, int startIndex, int length)
public void WriteViewshedResolutionProperty(IList<JulianDate> dates, IList<int> values, int startIndex, int length)
{
using (var writer = OpenViewshedResolutionProperty())
{
Expand Down
30 changes: 15 additions & 15 deletions DotNet/CesiumLanguageWriterTests/TestGenerateValidationDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1598,8 +1598,8 @@ private void WriteConstantValues()
}
using (var w2 = w.OpenViewshedResolutionProperty())
{
w2.WriteNumber(9164.0);
m_extensionsAssertionsWriter.WriteLine(" expect(e.conicSensor.viewshedResolution.getValue(date)).toEqual(9164.0);");
w2.WriteNumber(9164);
m_extensionsAssertionsWriter.WriteLine(" expect(e.conicSensor.viewshedResolution.getValue(date)).toEqual(9164);");
}
}
using (var w = packet.OpenCustomPatternSensorProperty())
Expand Down Expand Up @@ -1761,8 +1761,8 @@ private void WriteConstantValues()
}
using (var w2 = w.OpenViewshedResolutionProperty())
{
w2.WriteNumber(25862.0);
m_extensionsAssertionsWriter.WriteLine(" expect(e.customPatternSensor.viewshedResolution.getValue(date)).toEqual(25862.0);");
w2.WriteNumber(25862);
m_extensionsAssertionsWriter.WriteLine(" expect(e.customPatternSensor.viewshedResolution.getValue(date)).toEqual(25862);");
}
}
using (var w = packet.OpenRectangularSensorProperty())
Expand Down Expand Up @@ -1929,8 +1929,8 @@ private void WriteConstantValues()
}
using (var w2 = w.OpenViewshedResolutionProperty())
{
w2.WriteNumber(33690.0);
m_extensionsAssertionsWriter.WriteLine(" expect(e.rectangularSensor.viewshedResolution.getValue(date)).toEqual(33690.0);");
w2.WriteNumber(33690);
m_extensionsAssertionsWriter.WriteLine(" expect(e.rectangularSensor.viewshedResolution.getValue(date)).toEqual(33690);");
}
}
using (var w = packet.OpenFanProperty())
Expand Down Expand Up @@ -16375,9 +16375,9 @@ private void WriteSampledValues()
}
using (var w2 = w.OpenViewshedResolutionProperty())
{
w2.WriteNumber(CreateList(m_documentStartDate, m_documentStopDate), CreateList(38357.0, 30316.0));
m_extensionsAssertionsWriter.WriteLine(" expect(e.conicSensor.viewshedResolution.getValue(documentStartDate)).toEqual(38357.0);");
m_extensionsAssertionsWriter.WriteLine(" expect(e.conicSensor.viewshedResolution.getValue(documentStopDate)).toEqual(30316.0);");
w2.WriteNumber(CreateList(m_documentStartDate, m_documentStopDate), CreateList(38357, 30316));
m_extensionsAssertionsWriter.WriteLine(" expect(e.conicSensor.viewshedResolution.getValue(documentStartDate)).toEqual(38357);");
m_extensionsAssertionsWriter.WriteLine(" expect(e.conicSensor.viewshedResolution.getValue(documentStopDate)).toEqual(30316);");
}
}
using (var w = packet.OpenCustomPatternSensorProperty())
Expand Down Expand Up @@ -16486,9 +16486,9 @@ private void WriteSampledValues()
}
using (var w2 = w.OpenViewshedResolutionProperty())
{
w2.WriteNumber(CreateList(m_documentStartDate, m_documentStopDate), CreateList(44590.0, 31959.0));
m_extensionsAssertionsWriter.WriteLine(" expect(e.customPatternSensor.viewshedResolution.getValue(documentStartDate)).toEqual(44590.0);");
m_extensionsAssertionsWriter.WriteLine(" expect(e.customPatternSensor.viewshedResolution.getValue(documentStopDate)).toEqual(31959.0);");
w2.WriteNumber(CreateList(m_documentStartDate, m_documentStopDate), CreateList(44590, 31959));
m_extensionsAssertionsWriter.WriteLine(" expect(e.customPatternSensor.viewshedResolution.getValue(documentStartDate)).toEqual(44590);");
m_extensionsAssertionsWriter.WriteLine(" expect(e.customPatternSensor.viewshedResolution.getValue(documentStopDate)).toEqual(31959);");
}
}
using (var w = packet.OpenRectangularSensorProperty())
Expand Down Expand Up @@ -16609,9 +16609,9 @@ private void WriteSampledValues()
}
using (var w2 = w.OpenViewshedResolutionProperty())
{
w2.WriteNumber(CreateList(m_documentStartDate, m_documentStopDate), CreateList(24619.0, 54818.0));
m_extensionsAssertionsWriter.WriteLine(" expect(e.rectangularSensor.viewshedResolution.getValue(documentStartDate)).toEqual(24619.0);");
m_extensionsAssertionsWriter.WriteLine(" expect(e.rectangularSensor.viewshedResolution.getValue(documentStopDate)).toEqual(54818.0);");
w2.WriteNumber(CreateList(m_documentStartDate, m_documentStopDate), CreateList(24619, 54818));
m_extensionsAssertionsWriter.WriteLine(" expect(e.rectangularSensor.viewshedResolution.getValue(documentStartDate)).toEqual(24619);");
m_extensionsAssertionsWriter.WriteLine(" expect(e.rectangularSensor.viewshedResolution.getValue(documentStopDate)).toEqual(54818);");
}
}
using (var w = packet.OpenFanProperty())
Expand Down
Loading

0 comments on commit 4dfc687

Please sign in to comment.