public static XQt1771OutBlock2[] ListFromQuery(XQt1771 query) { int count = query.GetBlockCount(XQt1771OutBlock2.BlockName); List <XQt1771OutBlock2> list = new List <XQt1771OutBlock2>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt1771OutBlock2 block = new XQt1771OutBlock2(); block.IsValidData = true; block.InvalidReason = ""; try { block.traddate = query.GetFieldData(block.GetBlockName(), "traddate", i).TrimEnd('?'); // char 8 block.tradtime = query.GetFieldData(block.GetBlockName(), "tradtime", i).TrimEnd('?'); // char 8 block.price = query.GetFieldData(block.GetBlockName(), "price", i).ParseLong("price"); // long 8 block.sign = query.GetFieldData(block.GetBlockName(), "sign", i).FirstOrDefault(); // char 1 block.change = query.GetFieldData(block.GetBlockName(), "change", i).ParseLong("change"); // long 8 block.diff = query.GetFieldData(block.GetBlockName(), "diff", i).ParseFloat("diff"); // float 6.2 block.volume = query.GetFieldData(block.GetBlockName(), "volume", i).ParseLong("volume"); // long 12 block.tradmdcha = query.GetFieldData(block.GetBlockName(), "tradmdcha", i).ParseLong("tradmdcha"); // long 12 block.tradmscha = query.GetFieldData(block.GetBlockName(), "tradmscha", i).ParseLong("tradmscha"); // long 12 block.tradmdval = query.GetFieldData(block.GetBlockName(), "tradmdval", i).ParseLong("tradmdval"); // long 18 block.tradmsval = query.GetFieldData(block.GetBlockName(), "tradmsval", i).ParseLong("tradmsval"); // long 18 block.tradmsscha = query.GetFieldData(block.GetBlockName(), "tradmsscha", i).ParseLong("tradmsscha"); // long 12 block.tradmttvolume = query.GetFieldData(block.GetBlockName(), "tradmttvolume", i).ParseLong("tradmttvolume"); // long 12 block.tradavg = query.GetFieldData(block.GetBlockName(), "tradavg", i).ParseLong("tradavg"); // long 8 block.tradmttavg = query.GetFieldData(block.GetBlockName(), "tradmttavg", i).ParseLong("tradmttavg"); // long 8 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public XQt1771OutBlock2[] GetBlock2s() { XQt1771OutBlock2[] instance = XQt1771OutBlock2.ListFromQuery(this); return(instance); }