Skip to content

Commit

Permalink
Merge pull request #79 from arup-group/bugfix-COMPSGH-151-designcode-…
Browse files Browse the repository at this point in the history
…component-deseria

COMPSGH-151 fixed deserialze bool bug
  • Loading branch information
Kristjan Nielsen authored Aug 19, 2022
2 parents 9d1a324 + 85a92f7 commit 6201ff6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ComposGH/Components/5_Member/2_Secondary/CreateDesignCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,6 @@ internal override void SetSelected(int i, int j)
base.UpdateUI();
}



internal override void UpdateUIFromSelectedItems()
{
for (int i = 0; i < this.DesignCodePretty.Count; i++)
Expand Down Expand Up @@ -342,7 +340,7 @@ public override void VariableParameterMaintenance()

private void CheckBoxToggles(List<bool> newcheckboxes)
{
for (int i = 0; i < this.Checkboxes.Count; i++)
for (int i = 0; i < newcheckboxes.Count; i++)
this.Checkboxes[i] = newcheckboxes[i];
this.DesignOptions.ProppedDuringConstruction = this.Checkboxes[0];
this.DesignOptions.InclSteelBeamWeight = this.Checkboxes[1];
Expand Down Expand Up @@ -420,16 +418,18 @@ public override bool Read(GH_IO.Serialization.GH_IReader reader)
{
// bool list
int checkboxCount = reader.GetInt32("checkboxCount");
this.Checkboxes = new List<bool>();
List<bool> newcheckboxes = new List<bool>();
for (int i = 0; i < checkboxCount; i++)
this.Checkboxes.Add(reader.GetBoolean("checkbox" + i));
newcheckboxes.Add(reader.GetBoolean("checkbox" + i));

// checkbox names
int namesCount = reader.GetInt32("checkboxnamesCount");
this.CheckboxNames = new List<string>();
for (int i = 0; i < namesCount; i++)
this.CheckboxNames.Add(reader.GetString("checkboxname" + i));

CheckBoxToggles(newcheckboxes);

return base.Read(reader);
}
#endregion
Expand Down

0 comments on commit 6201ff6

Please sign in to comment.