Skip to content

Commit

Permalink
Ungenerate string, finish the rest of the log types
Browse files Browse the repository at this point in the history
  • Loading branch information
ThadHouse committed Feb 16, 2024
1 parent fbfc51f commit 20ba35f
Show file tree
Hide file tree
Showing 56 changed files with 637 additions and 908 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static void ConstructCall(LogData data, StringBuilder builder)
"System.UInt64" => ("LogInteger", "(long)", ""),
"System.Boolean" => ("LogBoolean", "", ""),
"System.Char" => ("LogChar", "", ""),
"System.String" => ("LogString", "", ""),
"System.String" => ("LogString", "", ".AsSpan()"),
"System.Single[]" => ("LogFloatArray", "", ".AsSpan()"),
"System.Double[]" => ("LogDoubleArray", "", ".AsSpan()"),
"System.Int64[]" => ("LogIntegerArray", "", ".AsSpan()"),
Expand Down
1 change: 0 additions & 1 deletion src/ntcore/Generated/BooleanArrayEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public bool[][] ReadQueueValues()
return timestamped;
}


public void Set(ReadOnlySpan<bool> value)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeBooleanArray(value, 0);
Expand Down
1 change: 0 additions & 1 deletion src/ntcore/Generated/BooleanArrayPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public interface IBooleanArrayPublisher : IPublisher
/// </summary>
new BooleanArrayTopic Topic { get; }


/// <summary>
/// Publish a new value using the current NT time.
/// </summary>
Expand Down
12 changes: 6 additions & 6 deletions src/ntcore/Generated/BooleanArrayTopic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public IBooleanArraySubscriber Subscribe(
NtCore.Subscribe(
Handle, NetworkTableType.BooleanArray,
"boolean[]"u8, options),
defaultValue);
defaultValue ?? []);
}

/// <summary>
Expand Down Expand Up @@ -91,7 +91,7 @@ public IBooleanArraySubscriber SubscribeEx(
NtCore.Subscribe(
Handle, NetworkTableType.BooleanArray,
typeString, options),
defaultValue);
defaultValue ?? []);
}

/// <summary>
Expand Down Expand Up @@ -120,7 +120,7 @@ public IBooleanArraySubscriber SubscribeEx(
NtCore.Subscribe(
Handle, NetworkTableType.BooleanArray,
typeString, options),
defaultValue);
defaultValue ?? []);
}

/// <summary>
Expand Down Expand Up @@ -292,7 +292,7 @@ public IBooleanArrayEntry GetEntry(
NtCore.GetEntry(
Handle, NetworkTableType.BooleanArray,
"boolean[]"u8, options),
defaultValue);
defaultValue ?? []);
}

/// <summary>
Expand Down Expand Up @@ -326,7 +326,7 @@ public IBooleanArrayEntry GetEntryEx(
NtCore.GetEntry(
Handle, NetworkTableType.BooleanArray,
typeString, options),
defaultValue);
defaultValue ?? []);
}

/// <summary>
Expand Down Expand Up @@ -360,7 +360,7 @@ public IBooleanArrayEntry GetEntryEx(
NtCore.GetEntry(
Handle, NetworkTableType.BooleanArray,
typeString, options),
defaultValue);
defaultValue ?? []);
}

}
1 change: 0 additions & 1 deletion src/ntcore/Generated/BooleanEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public bool[] ReadQueueValues()
return timestamped;
}


public void Set(bool value)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeBoolean(value, 0);
Expand Down
1 change: 0 additions & 1 deletion src/ntcore/Generated/BooleanPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public interface IBooleanPublisher : IPublisher
/// </summary>
new BooleanTopic Topic { get; }


/// <summary>
/// Publish a new value using the current NT time.
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion src/ntcore/Generated/DoubleArrayEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public double[][] ReadQueueValues()
return timestamped;
}


public void Set(ReadOnlySpan<double> value)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeDoubleArray(value, 0);
Expand Down
1 change: 0 additions & 1 deletion src/ntcore/Generated/DoubleArrayPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public interface IDoubleArrayPublisher : IPublisher
/// </summary>
new DoubleArrayTopic Topic { get; }


/// <summary>
/// Publish a new value using the current NT time.
/// </summary>
Expand Down
12 changes: 6 additions & 6 deletions src/ntcore/Generated/DoubleArrayTopic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public IDoubleArraySubscriber Subscribe(
NtCore.Subscribe(
Handle, NetworkTableType.DoubleArray,
"double[]"u8, options),
defaultValue);
defaultValue ?? []);
}

/// <summary>
Expand Down Expand Up @@ -91,7 +91,7 @@ public IDoubleArraySubscriber SubscribeEx(
NtCore.Subscribe(
Handle, NetworkTableType.DoubleArray,
typeString, options),
defaultValue);
defaultValue ?? []);
}

/// <summary>
Expand Down Expand Up @@ -120,7 +120,7 @@ public IDoubleArraySubscriber SubscribeEx(
NtCore.Subscribe(
Handle, NetworkTableType.DoubleArray,
typeString, options),
defaultValue);
defaultValue ?? []);
}

/// <summary>
Expand Down Expand Up @@ -292,7 +292,7 @@ public IDoubleArrayEntry GetEntry(
NtCore.GetEntry(
Handle, NetworkTableType.DoubleArray,
"double[]"u8, options),
defaultValue);
defaultValue ?? []);
}

/// <summary>
Expand Down Expand Up @@ -326,7 +326,7 @@ public IDoubleArrayEntry GetEntryEx(
NtCore.GetEntry(
Handle, NetworkTableType.DoubleArray,
typeString, options),
defaultValue);
defaultValue ?? []);
}

/// <summary>
Expand Down Expand Up @@ -360,7 +360,7 @@ public IDoubleArrayEntry GetEntryEx(
NtCore.GetEntry(
Handle, NetworkTableType.DoubleArray,
typeString, options),
defaultValue);
defaultValue ?? []);
}

}
1 change: 0 additions & 1 deletion src/ntcore/Generated/DoubleEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public double[] ReadQueueValues()
return timestamped;
}


public void Set(double value)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeDouble(value, 0);
Expand Down
1 change: 0 additions & 1 deletion src/ntcore/Generated/DoublePublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public interface IDoublePublisher : IPublisher
/// </summary>
new DoubleTopic Topic { get; }


/// <summary>
/// Publish a new value using the current NT time.
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion src/ntcore/Generated/FloatArrayEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public float[][] ReadQueueValues()
return timestamped;
}


public void Set(ReadOnlySpan<float> value)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeFloatArray(value, 0);
Expand Down
1 change: 0 additions & 1 deletion src/ntcore/Generated/FloatArrayPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public interface IFloatArrayPublisher : IPublisher
/// </summary>
new FloatArrayTopic Topic { get; }


/// <summary>
/// Publish a new value using the current NT time.
/// </summary>
Expand Down
12 changes: 6 additions & 6 deletions src/ntcore/Generated/FloatArrayTopic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public IFloatArraySubscriber Subscribe(
NtCore.Subscribe(
Handle, NetworkTableType.FloatArray,
"float[]"u8, options),
defaultValue);
defaultValue ?? []);
}

/// <summary>
Expand Down Expand Up @@ -91,7 +91,7 @@ public IFloatArraySubscriber SubscribeEx(
NtCore.Subscribe(
Handle, NetworkTableType.FloatArray,
typeString, options),
defaultValue);
defaultValue ?? []);
}

/// <summary>
Expand Down Expand Up @@ -120,7 +120,7 @@ public IFloatArraySubscriber SubscribeEx(
NtCore.Subscribe(
Handle, NetworkTableType.FloatArray,
typeString, options),
defaultValue);
defaultValue ?? []);
}

/// <summary>
Expand Down Expand Up @@ -292,7 +292,7 @@ public IFloatArrayEntry GetEntry(
NtCore.GetEntry(
Handle, NetworkTableType.FloatArray,
"float[]"u8, options),
defaultValue);
defaultValue ?? []);
}

/// <summary>
Expand Down Expand Up @@ -326,7 +326,7 @@ public IFloatArrayEntry GetEntryEx(
NtCore.GetEntry(
Handle, NetworkTableType.FloatArray,
typeString, options),
defaultValue);
defaultValue ?? []);
}

/// <summary>
Expand Down Expand Up @@ -360,7 +360,7 @@ public IFloatArrayEntry GetEntryEx(
NtCore.GetEntry(
Handle, NetworkTableType.FloatArray,
typeString, options),
defaultValue);
defaultValue ?? []);
}

}
1 change: 0 additions & 1 deletion src/ntcore/Generated/FloatEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public float[] ReadQueueValues()
return timestamped;
}


public void Set(float value)
{
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeFloat(value, 0);
Expand Down
1 change: 0 additions & 1 deletion src/ntcore/Generated/FloatPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public interface IFloatPublisher : IPublisher
/// </summary>
new FloatTopic Topic { get; }


/// <summary>
/// Publish a new value using the current NT time.
/// </summary>
Expand Down
50 changes: 0 additions & 50 deletions src/ntcore/Generated/GenericEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,31 +112,6 @@ public bool SetDefaultDouble(double value)
return NtCore.SetDefaultEntryValue(Handle, RefNetworkTableValue.MakeDouble(value));
}

public string GetString(string defaultValue)
{
NetworkTableValue value = NtCore.GetEntryValue(Handle);
if (value.IsString)
{
return value.GetString();
}
return defaultValue;
}

public bool SetString(string value)
{
return SetString(value, 0);
}

public bool SetString(string value, long time)
{
return NtCore.SetEntryValue(Handle, RefNetworkTableValue.MakeString(value, time));
}

public bool SetDefaultString(string value)
{
return NtCore.SetDefaultEntryValue(Handle, RefNetworkTableValue.MakeString(value));
}

public byte[] GetRaw(byte[] defaultValue)
{
NetworkTableValue value = NtCore.GetEntryValue(Handle);
Expand Down Expand Up @@ -262,31 +237,6 @@ public bool SetDefaultDoubleArray(double[] value)
return NtCore.SetDefaultEntryValue(Handle, RefNetworkTableValue.MakeDoubleArray(value));
}

public string[] GetStringArray(string[] defaultValue)
{
NetworkTableValue value = NtCore.GetEntryValue(Handle);
if (value.IsStringArray)
{
return value.GetStringArray();
}
return defaultValue;
}

public bool SetStringArray(string[] value)
{
return SetStringArray(value, 0);
}

public bool SetStringArray(string[] value, long time)
{
return NtCore.SetEntryValue(Handle, RefNetworkTableValue.MakeStringArray(value, time));
}

public bool SetDefaultStringArray(string[] value)
{
return NtCore.SetDefaultEntryValue(Handle, RefNetworkTableValue.MakeStringArray(value));
}


public void Unpublish()
{
Expand Down
44 changes: 0 additions & 44 deletions src/ntcore/Generated/GenericPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,28 +97,6 @@ public partial interface IGenericPublisher
/// <returns>False if the entry already exists with a different type</returns>
bool SetDefaultDouble(double defaultValue);

/// <summary>
/// Publish a new value.
/// </summary>
/// <param name="value">value to publish</param>
/// <param name="time">timestamp; 0 indicates current NT time should be used</param>
/// <returns>False if the topic already exists with a different type</returns>
bool SetString(string value, long time);

/// <summary>
/// Publish a new value.
/// </summary>
/// <param name="value">value to publish</param>
/// <returns>False if the topic already exists with a different type</returns>
bool SetString(string value);

/// <summary>
/// Sets the entry's value if it does not exist.
/// </summary>
/// <param name="defaultValue">the default value to set</param>
/// <returns>False if the entry already exists with a different type</returns>
bool SetDefaultString(string defaultValue);

/// <summary>
/// Publish a new value.
/// </summary>
Expand Down Expand Up @@ -229,26 +207,4 @@ public partial interface IGenericPublisher
/// <returns>False if the entry already exists with a different type</returns>
bool SetDefaultDoubleArray(double[] defaultValue);

/// <summary>
/// Publish a new value.
/// </summary>
/// <param name="value">value to publish</param>
/// <param name="time">timestamp; 0 indicates current NT time should be used</param>
/// <returns>False if the topic already exists with a different type</returns>
bool SetStringArray(string[] value, long time);

/// <summary>
/// Publish a new value.
/// </summary>
/// <param name="value">value to publish</param>
/// <returns>False if the topic already exists with a different type</returns>
bool SetStringArray(string[] value);

/// <summary>
/// Sets the entry's value if it does not exist.
/// </summary>
/// <param name="defaultValue">the default value to set</param>
/// <returns>False if the entry already exists with a different type</returns>
bool SetDefaultStringArray(string[] defaultValue);

}
Loading

0 comments on commit 20ba35f

Please sign in to comment.