Skip to content

Commit 052a4b8

Browse files
v2.1.10 : Fixed Parenthesis Equations and Added Group Control Refresh
1 parent 8f3c4e1 commit 052a4b8

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

EZCode/EZCode.cs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using EZCode.GControls;
2-
using EZCode.Debug;
1+
using EZCode.Debug;
2+
using EZCode.GControls;
33
using EZCode.Methods;
44
using EZCode.Variables;
55
using EZCode.Windows;
@@ -2905,6 +2905,8 @@ async Task<Group> DoGroup(string[] parts, int _index, string keyword, bool globa
29052905
group1.SetRelativeChenges(control);
29062906
else
29072907
group1.SetAbsoluteChenges(tempc, control);
2908+
control.Refresh();
2909+
if (control is GShape a) a.Refresh();
29082910
}
29092911
}
29102912
catch
@@ -4855,6 +4857,11 @@ string[] getString_value(string[] parts, int next, bool all = false, bool useVar
48554857
if (ended == 1)
48564858
{
48574859
count++;
4860+
var varstring = texts[l].Replace("\\(", texts[l].StartsWith("\\(") ? "" : "\\(").Replace(")\\", texts[l].EndsWith(")\\") ? "" : ")\\");
4861+
if (getVar(varstring).isSet)
4862+
{
4863+
texts[l] = $"{(texts[l].StartsWith("\\(") ? "\\(" : "")}{getVar(varstring).Value}{(texts[l].EndsWith(")\\") ? ")\\" : "")}";
4864+
}
48584865
brackets += texts[l];
48594866
if (l < texts.Count - 1) brackets += " ";
48604867
}
@@ -4988,6 +4995,11 @@ float[] getEquationWithNext(string value, int a, string[] parts)
49884995
if (ended == 1)
49894996
{
49904997
next++;
4998+
var varstring = parts[l].Replace("(", parts[l].StartsWith("(") ? "" : "(").Replace(")", parts[l].EndsWith(")") ? "" : ")");
4999+
if (getVar(varstring).isSet)
5000+
{
5001+
parts[l] = $"{(parts[l].StartsWith("(") ? "(" : "")}{getVar(varstring).Value}{(parts[l].EndsWith(")") ? ")" : "")}";
5002+
}
49915003
brackets.Append(parts[l]);
49925004
if (l < parts.Length - 1) brackets.Append(" ");
49935005
}
@@ -5048,12 +5060,6 @@ float[] find_value(string[] parts, int next, int def, bool? var = true, bool col
50485060
{
50495061
try
50505062
{
5051-
// Replace variables with their values
5052-
foreach (Var variable in vars)
5053-
{
5054-
equation = equation.Replace(variable.Name, variable.Value);
5055-
}
5056-
50575063
DataTable dt = new DataTable();
50585064
dt.Columns.Add("expression", typeof(string), equation);
50595065
DataRow row = dt.NewRow();

0 commit comments

Comments
 (0)