public RelationalItem2(KeyValue kv, RelationalContainer parent, RelationalBuilder2 topparent, string val) { InitializeComponent(); isScript = false; this.parent = parent; this.topParent = topparent; keyvalue = kv; upperKV = kv; lowerKV = kv; CloseBracket = false; OpenBracket = false; CBO_Type.Visible = false; indent = new String(' ', parent.Level * 2); SetSelected(false); if (kv.Instance.StartsWith("Relational") && kv.AttributeName == "Open" || kv.AttributeName == "Close") { try { CBO_Type.SelectedIndex = val != "" && !val.StartsWith("FD") ? int.Parse(val.Substring(0, 2), NumberStyles.AllowHexSpecifier) - 1 : 0; } catch { CBO_Type.SelectedIndex = 0; } switch (kv.AttributeName) { case "Open": LBL_Name.Text = indent + (kv.Instance.Contains("Array") ? "[" : "{"); CBO_Type.Visible = true; OpenBracket = true; break; case "Close": LBL_Name.Text = indent + (kv.Instance.Contains("Array") ? "]" : "}"); CloseBracket = true; break; default: break; } parent.type = kv.Instance.Split('_')[1]; parent.datatype = val != "" && !val.StartsWith("FD") ? val.Substring(0, 2) : "01"; if (parent.type == "Envelope" && CBO_Type.Visible) { CBO_Type.Items.Clear(); for (int i = 0; i < topparent.relationalTypes.Count; i++) { CBO_Type.Items.Add(topparent.relationalTypes[i].AttributeName + " (0x" + topparent.relationalTypes[i].KeyID + ")"); if (topparent.relationalTypes[i].KeyID == "FD020001") { CBO_Type.SelectedIndex = i; } } } else { /*if (SymbIOT.dm_name == "Cooking") * { * //CBO_Type.Visible = false; * //parent.datatype = "02"; * }*/ } TB_Value.Visible = true; CBO_Value.Visible = false; TB_Value.Text = val; } else { LBL_Name.Text = indent + kv.Instance + "." + kv.AttributeName; if (kv.EnumName != null) { TB_Value.Visible = false; CBO_Value.Visible = true; for (int j = 0; j < kv.EnumName.Enums.Count; j++) { if (kv.EnumName.Enums[j] != null) { CBO_Value.Items.Add(j.ToString("X2") + "=" + kv.EnumName.Enums[j]); if (val == kv.EnumName.Enums[j].ToString()) { CBO_Value.SelectedItem = j.ToString("X2") + "=" + kv.EnumName.Enums[j]; } } } /*foreach (string s in kv.EnumName.Enums) * { * if (s != null) * { * CBO_Value.Items.Add(s); * } * } * if (val != null) * { * CBO_Value.SelectedItem = val; * }*/ } else { TB_Value.Visible = true; CBO_Value.Visible = false; if (val != null) { TB_Value.Text = val; } } } }
public RelationalBuilder(SymbIOT p, List <Cycle> cy, string temp, string time, string probe, string done, string pow, KeyValue cplt) { InitializeComponent(); relationalItems = new List <RelationalItem>(); cycles = cy; tempKey = temp; timeKey = time; probeAmtKey = probe; cpltKey = cplt; doneKey = done; powKey = pow; cyclekeys = ""; parent = p; foreach (Cycle c in cycles) { if (!cyclekeys.Contains(c.KeyID)) { cyclekeys += c.KeyID + ";"; } } }
public RelationalItem2(KeyValue kv, Scripter parent, Panel pan, string val, bool send) { InitializeComponent(); isScript = true; //this.parent = parent; //this.topParent = topparent; this.scriptParent = parent; this.panParent = pan; keyvalue = kv; upperKV = kv; lowerKV = kv; CloseBracket = false; OpenBracket = false; CBO_Type.Visible = false; TB_Value.Left = TB_Value.Left - CBO_Type.Width; CBO_Value.Left = CBO_Value.Left - CBO_Type.Width; this.Width = this.Width - CBO_Type.Width; //indent = new String(' ', parent.Level * 2); SetSelected(false); IsSend = send; { LBL_Name.Text = indent + kv.Instance + "." + kv.AttributeName; if (kv.EnumName != null) { TB_Value.Visible = false; CBO_Value.Visible = true; for (int j = 0; j < kv.EnumName.Enums.Count; j++) { if (kv.EnumName.Enums[j] != null) { CBO_Value.Items.Add(j.ToString("X2") + "=" + kv.EnumName.Enums[j]); if (val == kv.EnumName.Enums[j].ToString() || val == j.ToString("X2")) { CBO_Value.SelectedItem = j.ToString("X2") + "=" + kv.EnumName.Enums[j]; } } } /*foreach (string s in kv.EnumName.Enums) * { * if (s != null) * { * CBO_Value.Items.Add(s); * } * } * if (val != null) * { * CBO_Value.SelectedItem = val; * }*/ } else { TB_Value.Visible = true; CBO_Value.Visible = false; if (val != null) { TB_Value.Text = val; } } } }