//public List<DatapointAction.DatapointActionNode> Actions { get; set; } public DatapointType() { this.KNXMainNumber = DPT_1; this.KNXSubNumber = "*"; this.Name = ""; this.Type = KNXDataType.Bit1; this.Text = ""; }
public static KNXDataType GetDPTType(string sizeInBit) { KNXDataType type = KNXDataType.Bit1; switch (sizeInBit) { case "1": type = KNXDataType.Bit1; break; case "2": type = KNXDataType.Bit2; break; case "4": type = KNXDataType.Bit4; break; case "8": type = KNXDataType.Bit8; break; case "16": type = KNXDataType.Bit16; break; case "24": type = KNXDataType.Bit24; break; case "32": type = KNXDataType.Bit32; break; case "48": type = KNXDataType.Bit48; break; case "64": type = KNXDataType.Bit64; break; case "80": type = KNXDataType.Bit80; break; case "112": type = KNXDataType.Bit112; break; default: MessageBox.Show(UIResMang.GetString("Message41"), UIResMang.GetString("Message6"), MessageBoxButtons.OK, MessageBoxIcon.Error); break; } return(type); }
private void btnConfirm_Click(object sender, EventArgs e) { var selectedText = this.comboxType.SelectedItem; if (selectedText != null) { KNXDataType dataType = KNXDataType.Bit1; Enum.TryParse(selectedText.ToString(), out dataType); type = dataType; this.DialogResult = DialogResult.OK; } else { this.DialogResult = DialogResult.Ignore; } }
public static string GetDPTMainName(KNXDataType type) { string text = ""; if (KNXDataType.None != type) { foreach (DatapointType node in MyCache.NodeTypes) { if (type == node.Type) { text = node.Text; break; } } } return(text); }
public static string GetDPTMainName(KNXDataType type) { string text = ""; if (KNXDataType.None != type) { foreach (DatapointType node in MyCache.NodeTypes) { if (type == node.Type) { text = node.Text; break; } } } return text; }
public static KNXDataType GetKnxDataType(string objectSize) { KNXDataType type = KNXDataType.Bit1; switch (objectSize) { case "1 Bit": type = KNXDataType.Bit1; break; case "2 Bit": type = KNXDataType.Bit2; break; case "3 Bit": type = KNXDataType.Bit3; break; case "4 Bit": type = KNXDataType.Bit4; break; case "5 Bit": type = KNXDataType.Bit5; break; case "6 Bit": type = KNXDataType.Bit6; break; case "7 Bit": type = KNXDataType.Bit7; break; case "1 Byte": type = KNXDataType.Bit8; break; case "2 Bytes": case "2 Byte": type = KNXDataType.Bit16; break; case "3 Bytes": case "3 Byte": type = KNXDataType.Bit24; break; case "4 Bytes": case "4 Byte": type = KNXDataType.Bit32; break; case "6 Bytes": case "6 Byte": type = KNXDataType.Bit48; break; case "8 Bytes": case "8 Byte": type = KNXDataType.Bit64; break; case "10 Bytes": case "10 Byte": type = KNXDataType.Bit80; break; case "14 Bytes": case "14 Byte": type = KNXDataType.Bit112; break; default: type = KNXDataType.None; //MessageBox.Show(UIResMang.GetString("Message41"), UIResMang.GetString("Message6"), MessageBoxButtons.OK, MessageBoxIcon.Error); Console.WriteLine(objectSize + " ===> " + UIResMang.GetString("Message41")); break; } return(type); }
public static string GetSize(KNXDataType type) { string size = ""; switch (type) { case KNXDataType.Bit1: size = "1 Bit"; break; case KNXDataType.Bit2: size = "2 Bit"; break; case KNXDataType.Bit3: size = "3 Bit"; break; case KNXDataType.Bit4: size = "4 Bit"; break; case KNXDataType.Bit5: size = "5 Bit"; break; case KNXDataType.Bit6: size = "6 Bit"; break; case KNXDataType.Bit7: size = "7 Bit"; break; case KNXDataType.Bit8: size = "1 Byte"; break; case KNXDataType.Bit16: size = "2 Bytes"; break; case KNXDataType.Bit24: size = "3 Bytes"; break; case KNXDataType.Bit32: size = "4 Bytes"; break; case KNXDataType.Bit48: size = "6 Bytes"; break; case KNXDataType.Bit64: size = "8 Bytes"; break; case KNXDataType.Bit80: size = "10 Bytes"; break; case KNXDataType.Bit112: size = "14 Bytes"; break; default: MessageBox.Show(UIResMang.GetString("Message41"), UIResMang.GetString("Message6"), MessageBoxButtons.OK, MessageBoxIcon.Error); break; } return(size); }