Skip to content

Commit

Permalink
Merge pull request #177 from mcrossley/master
Browse files Browse the repository at this point in the history
v3.25.1
  • Loading branch information
mcrossley authored May 13, 2023
2 parents 86f3e7f + 9041938 commit 49979ee
Show file tree
Hide file tree
Showing 27 changed files with 730 additions and 959 deletions.
9 changes: 3 additions & 6 deletions CumulusMX/Alarm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ private void doTriggered(bool value)
try
{
// Prepare the process to run
var parser = new TokenParser();
parser.OnToken += cumulus.TokenParserOnToken;
var parser = new TokenParser(cumulus.TokenParserOnToken);
parser.InputText = ActionParams;
var args = parser.ToStringFromString();
cumulus.LogMessage($"Alarm ({Name}): Starting external program: '{Action}', with parameters: {args}");
Expand Down Expand Up @@ -276,8 +275,7 @@ private void doUpTriggered(bool value)
try
{
// Prepare the process to run
var parser = new TokenParser();
parser.OnToken += cumulus.TokenParserOnToken;
var parser = new TokenParser(cumulus.TokenParserOnToken);
parser.InputText = ActionParams;
var args = parser.ToStringFromString();
cumulus.LogMessage($"Alarm ({Name}): Starting external program: '{Action}', with parameters: {args}");
Expand Down Expand Up @@ -351,8 +349,7 @@ private void doDownTriggered(bool value)
try
{
// Prepare the process to run
var parser = new TokenParser();
parser.OnToken += cumulus.TokenParserOnToken;
var parser = new TokenParser(cumulus.TokenParserOnToken);
parser.InputText = ActionParams;
var args = parser.ToStringFromString();
cumulus.LogMessage($"Alarm ({Name}): Starting external program: '{Action}', with parameters: {args}");
Expand Down
6 changes: 2 additions & 4 deletions CumulusMX/ApiTagProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,11 @@ namespace CumulusMX
public class ApiTagProcessor
{
private readonly Cumulus cumulus;
private readonly TokenParser tokenParser;
private WebTags webtags;

internal ApiTagProcessor(Cumulus cumulus)
{
this.cumulus = cumulus;
tokenParser = new TokenParser();
tokenParser.OnToken += cumulus.TokenParserOnToken;
tokenParser.Encoding = new UTF8Encoding(false);
}

internal void SetWebTags(WebTags webtags)
Expand Down Expand Up @@ -91,6 +87,8 @@ public string ProcessText(IHttpRequest request)

cumulus.LogDataMessage($"API tag: Source = {request.RemoteEndPoint} Input string = {data}");

var tokenParser = new TokenParser(cumulus.TokenParserOnToken);
tokenParser.Encoding = new UTF8Encoding(false);
tokenParser.InputText = data;
var output = tokenParser.ToStringFromString();

Expand Down
Loading

0 comments on commit 49979ee

Please sign in to comment.