public override DmmInformation GetIdentification() { var props = new DmmPropertyDictionary(); props.Add("Model", "Random"); return(new DmmInformation(props)); }
public override DmmInformation GetIdentification() { var result = this.SendScpi("*IDN?"); var props = new DmmPropertyDictionary(); if (result != null) { var parts = result.Split(','); if (parts.Length == 4) { props.Add("Manufacturer", parts[0]); props.Add("Model", parts[1]); props.Add("Serial", parts[2]); if (parts[3].StartsWith("V", StringComparison.Ordinal)) { props.Add("FirmwareVersion", parts[3].Substring(1)); } else { props.Add("Other", parts[3]); } } } return(new DmmInformation(props)); }
public void DmmPropertyDictionary_ReadOnly3() { var props = new DmmPropertyDictionary(); props.Add("Item1", "Value1"); props.Add("Item2", "Value2"); props = props.AsReadOnly(); props.Add("Item3", "Value3"); }
public void DmmPropertyDictionary_Basic() { var props = new DmmPropertyDictionary(); props.Add("Item1", "Value1"); props.Add("Item2", "Value2"); Assert.AreEqual(2, props.Count); Assert.AreEqual("Value1", props["Item1"]); Assert.AreEqual("Value2", props["Item2"]); }