Skip to content

Commit

Permalink
Add Struct and StructArray
Browse files Browse the repository at this point in the history
  • Loading branch information
ThadHouse committed Jan 19, 2024
1 parent dca2353 commit cbcbd91
Show file tree
Hide file tree
Showing 44 changed files with 744 additions and 169 deletions.
10 changes: 5 additions & 5 deletions src/ntcore/Generated/BooleanArrayEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,19 @@ public bool[][] ReadQueueValues()
}


public void Set(params bool[] value)
public void Set(bool[] value)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeBooleanArray(0, value.AsSpan());
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeBooleanArray(value.AsSpan(), 0);
NtCore.SetEntryValue(Handle, ntValue);
}

public void Set(long time, params bool[] value)
public void Set(bool[] value, long time)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeBooleanArray(time, value.AsSpan());
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeBooleanArray(value.AsSpan(), time);
NtCore.SetEntryValue(Handle, ntValue);
}

public void SetDefault(params bool[] value)
public void SetDefault(bool[] value)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeBooleanArray(value.AsSpan());
NtCore.SetDefaultEntryValue(Handle, ntValue);
Expand Down
4 changes: 2 additions & 2 deletions src/ntcore/Generated/BooleanArrayPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface IBooleanArrayPublisher : IPublisher
* @param value value to publish
* @param time timestamp; 0 indicates current NT time should be used
*/
void Set(long time, params bool[] value);
void Set(bool[] value, long time);

/**
* Publish a default value.
Expand All @@ -40,5 +40,5 @@ public interface IBooleanArrayPublisher : IPublisher
*
* @param value value
*/
void SetDefault(params bool[] value);
void SetDefault(bool[] value);
}
7 changes: 4 additions & 3 deletions src/ntcore/Generated/BooleanEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// THIS FILE WAS AUTO-GENERATED BY ./ntcore/generate_topics.py. DO NOT MODIFY

using System;
using NetworkTables.Handles;
using NetworkTables.Natives;

Expand Down Expand Up @@ -92,13 +93,13 @@ public bool[] ReadQueueValues()

public void Set(bool value)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeBoolean(0, value);
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeBoolean(value, 0);
NtCore.SetEntryValue(Handle, ntValue);
}

public void Set(long time, bool value)
public void Set(bool value, long time)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeBoolean(time, value);
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeBoolean(value, time);
NtCore.SetEntryValue(Handle, ntValue);
}

Expand Down
2 changes: 1 addition & 1 deletion src/ntcore/Generated/BooleanPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface IBooleanPublisher : IPublisher
* @param value value to publish
* @param time timestamp; 0 indicates current NT time should be used
*/
void Set(long time, bool value);
void Set(bool value, long time);

/**
* Publish a default value.
Expand Down
10 changes: 5 additions & 5 deletions src/ntcore/Generated/DoubleArrayEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,19 @@ public double[][] ReadQueueValues()
}


public void Set(params double[] value)
public void Set(double[] value)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeDoubleArray(0, value.AsSpan());
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeDoubleArray(value.AsSpan(), 0);
NtCore.SetEntryValue(Handle, ntValue);
}

public void Set(long time, params double[] value)
public void Set(double[] value, long time)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeDoubleArray(time, value.AsSpan());
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeDoubleArray(value.AsSpan(), time);
NtCore.SetEntryValue(Handle, ntValue);
}

public void SetDefault(params double[] value)
public void SetDefault(double[] value)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeDoubleArray(value.AsSpan());
NtCore.SetDefaultEntryValue(Handle, ntValue);
Expand Down
4 changes: 2 additions & 2 deletions src/ntcore/Generated/DoubleArrayPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface IDoubleArrayPublisher : IPublisher
* @param value value to publish
* @param time timestamp; 0 indicates current NT time should be used
*/
void Set(long time, params double[] value);
void Set(double[] value, long time);

/**
* Publish a default value.
Expand All @@ -40,5 +40,5 @@ public interface IDoubleArrayPublisher : IPublisher
*
* @param value value
*/
void SetDefault(params double[] value);
void SetDefault(double[] value);
}
7 changes: 4 additions & 3 deletions src/ntcore/Generated/DoubleEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// THIS FILE WAS AUTO-GENERATED BY ./ntcore/generate_topics.py. DO NOT MODIFY

using System;
using NetworkTables.Handles;
using NetworkTables.Natives;

Expand Down Expand Up @@ -92,13 +93,13 @@ public double[] ReadQueueValues()

public void Set(double value)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeDouble(0, value);
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeDouble(value, 0);
NtCore.SetEntryValue(Handle, ntValue);
}

public void Set(long time, double value)
public void Set(double value, long time)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeDouble(time, value);
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeDouble(value, time);
NtCore.SetEntryValue(Handle, ntValue);
}

Expand Down
2 changes: 1 addition & 1 deletion src/ntcore/Generated/DoublePublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface IDoublePublisher : IPublisher
* @param value value to publish
* @param time timestamp; 0 indicates current NT time should be used
*/
void Set(long time, double value);
void Set(double value, long time);

/**
* Publish a default value.
Expand Down
10 changes: 5 additions & 5 deletions src/ntcore/Generated/FloatArrayEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,19 @@ public float[][] ReadQueueValues()
}


public void Set(params float[] value)
public void Set(float[] value)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeFloatArray(0, value.AsSpan());
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeFloatArray(value.AsSpan(), 0);
NtCore.SetEntryValue(Handle, ntValue);
}

public void Set(long time, params float[] value)
public void Set(float[] value, long time)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeFloatArray(time, value.AsSpan());
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeFloatArray(value.AsSpan(), time);
NtCore.SetEntryValue(Handle, ntValue);
}

public void SetDefault(params float[] value)
public void SetDefault(float[] value)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeFloatArray(value.AsSpan());
NtCore.SetDefaultEntryValue(Handle, ntValue);
Expand Down
4 changes: 2 additions & 2 deletions src/ntcore/Generated/FloatArrayPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface IFloatArrayPublisher : IPublisher
* @param value value to publish
* @param time timestamp; 0 indicates current NT time should be used
*/
void Set(long time, params float[] value);
void Set(float[] value, long time);

/**
* Publish a default value.
Expand All @@ -40,5 +40,5 @@ public interface IFloatArrayPublisher : IPublisher
*
* @param value value
*/
void SetDefault(params float[] value);
void SetDefault(float[] value);
}
7 changes: 4 additions & 3 deletions src/ntcore/Generated/FloatEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// THIS FILE WAS AUTO-GENERATED BY ./ntcore/generate_topics.py. DO NOT MODIFY

using System;
using NetworkTables.Handles;
using NetworkTables.Natives;

Expand Down Expand Up @@ -92,13 +93,13 @@ public float[] ReadQueueValues()

public void Set(float value)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeFloat(0, value);
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeFloat(value, 0);
NtCore.SetEntryValue(Handle, ntValue);
}

public void Set(long time, float value)
public void Set(float value, long time)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeFloat(time, value);
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeFloat(value, time);
NtCore.SetEntryValue(Handle, ntValue);
}

Expand Down
2 changes: 1 addition & 1 deletion src/ntcore/Generated/FloatPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface IFloatPublisher : IPublisher
* @param value value to publish
* @param time timestamp; 0 indicates current NT time should be used
*/
void Set(long time, float value);
void Set(float value, long time);

/**
* Publish a default value.
Expand Down
Loading

0 comments on commit cbcbd91

Please sign in to comment.