public static TreeNode GetActionNode() { SceneControlNode nodeAction = new SceneControlNode(); nodeAction.Text = nodeAction.KNXMainNumber + "." + nodeAction.KNXSubNumber + " " + nodeAction.Name; DatapointActionNode actionScene1 = new DatapointActionNode(); actionScene1.Name = actionScene1.Text = ResourceMng.GetString("Scene1"); actionScene1.Value = 0; DatapointActionNode actionScene2 = new DatapointActionNode(); actionScene2.Name = actionScene2.Text = ResourceMng.GetString("Scene2"); actionScene2.Value = 1; DatapointActionNode actionScene3 = new DatapointActionNode(); actionScene3.Name = actionScene3.Text = ResourceMng.GetString("Scene3"); actionScene3.Value = 2; nodeAction.Nodes.Add(actionScene1); nodeAction.Nodes.Add(actionScene2); nodeAction.Nodes.Add(actionScene3); return(nodeAction); }
private void buttonAddAction_Click(object sender, EventArgs e) { foreach (TreeNode it in this.treeViewDefaultActions.SelectedNode.Nodes) { DatapointActionNode actionNode = it as DatapointActionNode; if (null != actionNode) { bool r = addActionToList(actionNode, true); if (!r) { return; } } else { foreach (var node in it.Nodes) { DatapointActionNode actNode = node as DatapointActionNode; if (null != actNode) { bool r = addActionToList(actNode, true); if (!r) { return; } } } } } }
private void listBoxActios_SelectedIndexChanged(object sender, EventArgs e) { //Console.Write("\nlistBoxActios_SelectedIndexChanged() selected: "+this.listBoxActios.SelectedIndex); this.buttonAddAction.Enabled = false; this.buttonDeleteAction.Enabled = true; string actionName = (string)this.listBoxActios.SelectedItem; DatapointActionNode action = getActionAccrodingToActionName(actionName); if (null != action) { this.textBoxActionName.Text = action.Name; this.comboBoxActionValue.Text = action.Value.ToString(); // if (action.CanBeDelete) // { // this.buttonDeleteAction.Enabled = true; // } // else // { // this.buttonDeleteAction.Enabled = false; // } } else { this.textBoxActionName.Text = ""; this.comboBoxActionValue.Text = ""; } }
public static TreeNode GetActionNode() { ScalingNode nodeAction = new ScalingNode(); nodeAction.Text = nodeAction.KNXMainNumber + "." + nodeAction.KNXSubNumber + " " + nodeAction.Name; DatapointActionNode actionAdjustTo30per = new DatapointActionNode(); actionAdjustTo30per.Name = actionAdjustTo30per.Text = ResourceMng.GetString("AdjustTo30per"); actionAdjustTo30per.Value = 76; DatapointActionNode actionAdjustTo60per = new DatapointActionNode(); actionAdjustTo60per.Name = actionAdjustTo60per.Text = ResourceMng.GetString("AdjustTo60per"); actionAdjustTo60per.Value = 153; DatapointActionNode actionAdjustTo90per = new DatapointActionNode(); actionAdjustTo90per.Name = actionAdjustTo90per.Text = ResourceMng.GetString("AdjustTo90per"); actionAdjustTo90per.Value = 229; nodeAction.Nodes.Add(actionAdjustTo30per); nodeAction.Nodes.Add(actionAdjustTo60per); nodeAction.Nodes.Add(actionAdjustTo90per); return(nodeAction); }
private void buttonDeleteAction_Click(object sender, EventArgs e) { string actionName = (string)this.listBoxActios.SelectedItem; DatapointActionNode action = getActionAccrodingToActionName(actionName); if (null != action) { Address.Actions.Remove(action); this.listBoxActios.Items.Remove(actionName); this.textBoxActionName.Text = ""; this.comboBoxActionValue.Text = ""; this.listBoxActios.Refresh(); } }
public static TreeNode GetActionNode() { ControlDimmingNode nodeAction = new ControlDimmingNode(); nodeAction.Text = nodeAction.KNXMainNumber + "." + nodeAction.KNXSubNumber + " " + nodeAction.Name; DatapointActionNode actionBrighter25per = new DatapointActionNode(); actionBrighter25per.Name = actionBrighter25per.Text = ResourceMng.GetString("Brighter25per"); actionBrighter25per.Value = 0x0B; DatapointActionNode actionBrighter50per = new DatapointActionNode(); actionBrighter50per.Name = actionBrighter50per.Text = ResourceMng.GetString("Brighter50per"); actionBrighter50per.Value = 0x0A; DatapointActionNode actionBrighter100per = new DatapointActionNode(); actionBrighter100per.Name = actionBrighter100per.Text = ResourceMng.GetString("Brighter100per"); actionBrighter100per.Value = 0x09; DatapointActionNode actionDim25per = new DatapointActionNode(); actionDim25per.Name = actionDim25per.Text = ResourceMng.GetString("Dim25per"); actionDim25per.Value = 0x03; DatapointActionNode actionDim50per = new DatapointActionNode(); actionDim50per.Name = actionDim50per.Text = ResourceMng.GetString("Dim50per"); actionDim50per.Value = 0x02; DatapointActionNode actionDim100per = new DatapointActionNode(); actionDim100per.Name = actionDim100per.Text = ResourceMng.GetString("Dim100per"); actionDim100per.Value = 0x01; nodeAction.Nodes.Add(actionBrighter25per); nodeAction.Nodes.Add(actionBrighter50per); nodeAction.Nodes.Add(actionBrighter100per); nodeAction.Nodes.Add(actionDim25per); nodeAction.Nodes.Add(actionDim50per); nodeAction.Nodes.Add(actionDim100per); return(nodeAction); }
private void listBoxActios_SelectedIndexChanged(object sender, EventArgs e) { this.buttonAddAction.Enabled = false; this.buttonDeleteAction.Enabled = true; string actionName = (string)this.listBoxActios.SelectedItem; DatapointActionNode action = Address.Actions.GetActionAccrodingToActionName(actionName); if (null != action) { this.textBoxActionName.Text = action.ActionName; this.comboBoxActionValue.Text = action.Value.ToString(); } else { this.textBoxActionName.Text = ""; this.comboBoxActionValue.Text = ""; } }
public static TreeNode GetActionNode() { SwitchNode nodeAction = new SwitchNode(); nodeAction.Text = nodeAction.KNXMainNumber + "." + nodeAction.KNXSubNumber + " " + nodeAction.DPTName; DatapointActionNode actionOn = new DatapointActionNode(); actionOn.ActionName = actionOn.Text = KNXResMang.GetString("On"); actionOn.Value = 1; DatapointActionNode actionOff = new DatapointActionNode(); actionOff.ActionName = actionOff.Text = KNXResMang.GetString("Off"); actionOff.Value = 0; nodeAction.Nodes.Add(actionOn); nodeAction.Nodes.Add(actionOff); return(nodeAction); }
public static List <DatapointActionNode> GetActionNodes(string text) { List <DatapointActionNode> listActionNodes = new List <DatapointActionNode>(); TreeNode typeNode = null; foreach (TreeNode node in MyCache.NodeActions) { typeNode = GetNode(node, text); if (null != typeNode) { break; } } if (null != typeNode) { foreach (TreeNode node in typeNode.Nodes) { DatapointActionNode dptActNode = node as DatapointActionNode; if (null != dptActNode) { listActionNodes.Add(dptActNode); } else { foreach (TreeNode it in node.Nodes) { DatapointActionNode actNode = it as DatapointActionNode; if (null != actNode) { listActionNodes.Add(actNode); } } } } } return(listActionNodes); }
private bool addActionToList(DatapointActionNode newAction, bool duplicateTip) { if (null == Address.Actions) { Address.Actions = new List <DatapointActionNode>(); } DatapointActionNode action = getActionAccrodingToActionName(newAction.Name); if (null != action) { if (duplicateTip) { MessageBox.Show(ResourceMng.GetString("Message32"), ResourceMng.GetString("Message6"), MessageBoxButtons.OK, MessageBoxIcon.Error); } return(false); } if (KNXDataType.Bit1 == Address.Type) { if ((0 > newAction.Value) || (1 < newAction.Value)) { MessageBox.Show(ResourceMng.GetString("Message33"), ResourceMng.GetString("Message6"), MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } } else if (KNXDataType.Bit4 == Address.Type) { if ((0 > newAction.Value) || (15 < newAction.Value)) { MessageBox.Show(ResourceMng.GetString("Message34"), ResourceMng.GetString("Message6"), MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } } else if (KNXDataType.Bit8 == Address.Type) { if ((-127 > newAction.Value) || (255 < newAction.Value)) { MessageBox.Show(ResourceMng.GetString("Message35"), ResourceMng.GetString("Message6"), MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if ((DatapointType.DPT_5 == Address.KnxMainNumber) && (DatapointType.DPST_1 == Address.KnxSubNumber)) { if ((0 > newAction.Value) || (255 < newAction.Value)) { MessageBox.Show(ResourceMng.GetString("Message36"), ResourceMng.GetString("Message6"), MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } } else if ((DatapointType.DPT_18 == Address.KnxMainNumber) && (DatapointType.DPST_1 == Address.KnxSubNumber)) { if ((0 > newAction.Value) || (255 < newAction.Value)) { MessageBox.Show(ResourceMng.GetString("Message36"), ResourceMng.GetString("Message6"), MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } } } Address.Actions.Add(newAction); this.listBoxActios.Items.Add(newAction.Name); this.textBoxActionName.Text = ""; this.comboBoxActionValue.Text = ""; this.listBoxActios.Refresh(); return(true); }
public void RemoveActionNode(DatapointActionNode node) { this.Actions.Remove(node); }
public void AddActionNode(DatapointActionNode node) { this.Actions.Add(node); }
public static TreeNode GetActionNode() { ScalingNode nodeAction = new ScalingNode(); nodeAction.Text = nodeAction.KNXMainNumber + "." + nodeAction.KNXSubNumber + " " + nodeAction.DPTName; DatapointActionNode actionAdjustTo0per = new DatapointActionNode(); actionAdjustTo0per.ActionName = actionAdjustTo0per.Text = KNXResMang.GetString("AdjustTo0per"); actionAdjustTo0per.Value = 0; DatapointActionNode actionAdjustTo10per = new DatapointActionNode(); actionAdjustTo10per.ActionName = actionAdjustTo10per.Text = KNXResMang.GetString("AdjustTo10per"); actionAdjustTo10per.Value = 26; DatapointActionNode actionAdjustTo20per = new DatapointActionNode(); actionAdjustTo20per.ActionName = actionAdjustTo20per.Text = KNXResMang.GetString("AdjustTo20per"); actionAdjustTo20per.Value = 51; DatapointActionNode actionAdjustTo30per = new DatapointActionNode(); actionAdjustTo30per.ActionName = actionAdjustTo30per.Text = KNXResMang.GetString("AdjustTo30per"); actionAdjustTo30per.Value = 77; DatapointActionNode actionAdjustTo40per = new DatapointActionNode(); actionAdjustTo40per.ActionName = actionAdjustTo40per.Text = KNXResMang.GetString("AdjustTo40per"); actionAdjustTo40per.Value = 102; DatapointActionNode actionAdjustTo50per = new DatapointActionNode(); actionAdjustTo50per.ActionName = actionAdjustTo50per.Text = KNXResMang.GetString("AdjustTo50per"); actionAdjustTo50per.Value = 128; DatapointActionNode actionAdjustTo60per = new DatapointActionNode(); actionAdjustTo60per.ActionName = actionAdjustTo60per.Text = KNXResMang.GetString("AdjustTo60per"); actionAdjustTo60per.Value = 153; DatapointActionNode actionAdjustTo70per = new DatapointActionNode(); actionAdjustTo70per.ActionName = actionAdjustTo70per.Text = KNXResMang.GetString("AdjustTo70per"); actionAdjustTo70per.Value = 179; DatapointActionNode actionAdjustTo80per = new DatapointActionNode(); actionAdjustTo80per.ActionName = actionAdjustTo80per.Text = KNXResMang.GetString("AdjustTo80per"); actionAdjustTo80per.Value = 204; DatapointActionNode actionAdjustTo90per = new DatapointActionNode(); actionAdjustTo90per.ActionName = actionAdjustTo90per.Text = KNXResMang.GetString("AdjustTo90per"); actionAdjustTo90per.Value = 230; DatapointActionNode actionAdjustTo100per = new DatapointActionNode(); actionAdjustTo100per.ActionName = actionAdjustTo100per.Text = KNXResMang.GetString("AdjustTo100per"); actionAdjustTo100per.Value = 255; nodeAction.Nodes.Add(actionAdjustTo0per); nodeAction.Nodes.Add(actionAdjustTo10per); nodeAction.Nodes.Add(actionAdjustTo20per); nodeAction.Nodes.Add(actionAdjustTo30per); nodeAction.Nodes.Add(actionAdjustTo40per); nodeAction.Nodes.Add(actionAdjustTo50per); nodeAction.Nodes.Add(actionAdjustTo60per); nodeAction.Nodes.Add(actionAdjustTo70per); nodeAction.Nodes.Add(actionAdjustTo80per); nodeAction.Nodes.Add(actionAdjustTo90per); nodeAction.Nodes.Add(actionAdjustTo100per); return(nodeAction); }
public static TreeNode GetActionNode() { ControlDimmingNode nodeAction = new ControlDimmingNode(); nodeAction.Text = nodeAction.KNXMainNumber + "." + nodeAction.KNXSubNumber + " " + nodeAction.DPTName; DatapointActionNode actionIncreasing1per = new DatapointActionNode(); actionIncreasing1per.ActionName = actionIncreasing1per.Text = KNXResMang.GetString("Increasing1per"); actionIncreasing1per.Value = 0x0F; DatapointActionNode actionIncreasing3per = new DatapointActionNode(); actionIncreasing3per.ActionName = actionIncreasing3per.Text = KNXResMang.GetString("Increasing3per"); actionIncreasing3per.Value = 0x0E; DatapointActionNode actionIncreasing6per = new DatapointActionNode(); actionIncreasing6per.ActionName = actionIncreasing6per.Text = KNXResMang.GetString("Increasing6per"); actionIncreasing6per.Value = 0x0D; DatapointActionNode actionIncreasing12per = new DatapointActionNode(); actionIncreasing12per.ActionName = actionIncreasing12per.Text = KNXResMang.GetString("Increasing12per"); actionIncreasing12per.Value = 0x0C; DatapointActionNode actionIncreasing25per = new DatapointActionNode(); actionIncreasing25per.ActionName = actionIncreasing25per.Text = KNXResMang.GetString("Increasing25per"); actionIncreasing25per.Value = 0x0B; DatapointActionNode actionIncreasing50per = new DatapointActionNode(); actionIncreasing50per.ActionName = actionIncreasing50per.Text = KNXResMang.GetString("Increasing50per"); actionIncreasing50per.Value = 0x0A; DatapointActionNode actionIncreasing100per = new DatapointActionNode(); actionIncreasing100per.ActionName = actionIncreasing100per.Text = KNXResMang.GetString("Increasing100per"); actionIncreasing100per.Value = 0x09; DatapointActionNode actionDecreasing1per = new DatapointActionNode(); actionDecreasing1per.ActionName = actionDecreasing1per.Text = KNXResMang.GetString("Decreasing1per"); actionDecreasing1per.Value = 0x07; DatapointActionNode actionDecreasing3per = new DatapointActionNode(); actionDecreasing3per.ActionName = actionDecreasing3per.Text = KNXResMang.GetString("Decreasing3per"); actionDecreasing3per.Value = 0x06; DatapointActionNode actionDecreasing6per = new DatapointActionNode(); actionDecreasing6per.ActionName = actionDecreasing6per.Text = KNXResMang.GetString("Decreasing6per"); actionDecreasing6per.Value = 0x05; DatapointActionNode actionDecreasing12per = new DatapointActionNode(); actionDecreasing12per.ActionName = actionDecreasing12per.Text = KNXResMang.GetString("Decreasing12per"); actionDecreasing12per.Value = 0x05; DatapointActionNode actionDecreasing25per = new DatapointActionNode(); actionDecreasing25per.ActionName = actionDecreasing25per.Text = KNXResMang.GetString("Decreasing25per"); actionDecreasing25per.Value = 0x03; DatapointActionNode actionDecreasing50per = new DatapointActionNode(); actionDecreasing50per.ActionName = actionDecreasing50per.Text = KNXResMang.GetString("Decreasing50per"); actionDecreasing50per.Value = 0x02; DatapointActionNode actionDecreasing100per = new DatapointActionNode(); actionDecreasing100per.ActionName = actionDecreasing100per.Text = KNXResMang.GetString("Decreasing100per"); actionDecreasing100per.Value = 0x01; nodeAction.Nodes.Add(actionIncreasing1per); nodeAction.Nodes.Add(actionIncreasing3per); nodeAction.Nodes.Add(actionIncreasing6per); nodeAction.Nodes.Add(actionIncreasing12per); nodeAction.Nodes.Add(actionIncreasing25per); nodeAction.Nodes.Add(actionIncreasing50per); nodeAction.Nodes.Add(actionIncreasing100per); nodeAction.Nodes.Add(actionDecreasing1per); nodeAction.Nodes.Add(actionDecreasing3per); nodeAction.Nodes.Add(actionDecreasing6per); nodeAction.Nodes.Add(actionDecreasing12per); nodeAction.Nodes.Add(actionDecreasing25per); nodeAction.Nodes.Add(actionDecreasing50per); nodeAction.Nodes.Add(actionDecreasing100per); return(nodeAction); }