public static string DcResistans_To_75(Numerics.PhysicalVariable Value) { if (Value.value != null) { double TempValue = Convert.ToDouble(Value.value * 310 / 255); return(Numerics.NumericsConverter.Value2Text(TempValue, 2, -6, " ", "Ω", false, false)); } return(string.Empty); }
public static MeasurementItemStruct FromDataRow(System.Data.DataRow row) { MeasurementItemStruct mi = new MeasurementItemStruct((MeasurementFunction)(int)row["function"]); if (mi.Winding != null) { mi.Winding = new WindingType((int)row["windingtype"]); } if ((row["terimal"]).ToString().Length > 0) { List <WindingTerimal> wts = new List <WindingTerimal>(); foreach (var s in ((string)row["terimal"]).Split(';')) { wts.Add(new WindingTerimal(int.Parse(s))); } mi.Terimal = wts.ToArray(); } mi.WindingConfig = (TransformerWindingConfigName)(int)row["windingconfig"]; if ((row["taplabel"]).ToString().Length > 0) { List <string> ss = new List <string>(); foreach (var s in ((string)row["taplabel"]).Split(';')) { //ss.Add(new WindingTerimal(int.Parse(s))); } mi.TapLabel = ((string)row["taplabel"]).Split(';'); } mi.Text = row["text"].ToString(); try { mi.failed = (bool)row["failed"]; } catch { } mi.completed = (bool)row["completed"]; SCEEC.Numerics.PhysicalVariable[] pv = new Numerics.PhysicalVariable[9]; for (int i = 0; i < 9; i++) { string pvs = row["result_pv" + (i + 1).ToString()].ToString(); pv[i] = SCEEC.Numerics.NumericsConverter.Text2Value(pvs); } try { short[] waves = Bytes2Shorts(System.Convert.FromBase64String(Convert.ToString(row["waves"]))); mi.result = new MeasurementResult(mi.Function, pv, waves, false, (DateTime)row["recordtime"]); } catch { } if (mi.Function == MeasurementFunction.Leakagecurrent) { var data = JsonConvert.DeserializeObject <TTM.LeakCurJson>(Convert.ToString(row["waves"])); short[] waves = new short[] { (short)data.H_L10kV, (short)data.L_H10kV, (short)data.HL10kV, (short)data.H_L20kV, (short)data.L_H20kV, (short)data.HL20kV, (short)data.H_L40kV, (short)data.L_H40kV, (short)data.HL40kV }; mi.result = new MeasurementResult(mi.Function, pv, waves, false, (DateTime)row["recordtime"]); } return(mi); }
public static string DcResistans_To_75(Numerics.PhysicalVariable Value) { double TempValue = Convert.ToDouble(Value.value * 310 / 255); return(Numerics.NumericsConverter.Value2Text(TempValue, 2, -23, " ", "F", false, false)); }