public static XQt1603OutBlock1[] ListFromQuery(XQt1603 query) { int count = query.GetBlockCount(XQt1603OutBlock1.BlockName); List <XQt1603OutBlock1> list = new List <XQt1603OutBlock1>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt1603OutBlock1 block = new XQt1603OutBlock1(); block.IsValidData = true; block.InvalidReason = ""; try { block.time = query.GetFieldData(block.GetBlockName(), "time", i).TrimEnd('?'); // char 8 block.tjjcode = query.GetFieldData(block.GetBlockName(), "tjjcode", i).TrimEnd('?'); // char 4 block.msvolume = query.GetFieldData(block.GetBlockName(), "msvolume", i).ParseLong("msvolume"); // long 8 block.mdvolume = query.GetFieldData(block.GetBlockName(), "mdvolume", i).ParseLong("mdvolume"); // long 8 block.msvalue = query.GetFieldData(block.GetBlockName(), "msvalue", i).ParseLong("msvalue"); // long 12 block.mdvalue = query.GetFieldData(block.GetBlockName(), "mdvalue", i).ParseLong("mdvalue"); // long 12 block.svolume = query.GetFieldData(block.GetBlockName(), "svolume", i).ParseLong("svolume"); // long 8 block.svalue = query.GetFieldData(block.GetBlockName(), "svalue", i).ParseLong("svalue"); // long 12 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public XQt1603OutBlock1[] GetBlock1s() { XQt1603OutBlock1[] instance = XQt1603OutBlock1.ListFromQuery(this); return(instance); }