public static XQt1475OutBlock1[] ListFromQuery(XQt1475 query) { int count = query.GetBlockCount(XQt1475OutBlock1.BlockName); List <XQt1475OutBlock1> list = new List <XQt1475OutBlock1>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt1475OutBlock1 block = new XQt1475OutBlock1(); block.IsValidData = true; block.InvalidReason = ""; try { block.datetime = query.GetFieldData(block.GetBlockName(), "datetime", i).TrimEnd('?'); // char 10 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.todayvp = query.GetFieldData(block.GetBlockName(), "todayvp", i).ParseFloat("todayvp"); // float 8.2 block.ma5vp = query.GetFieldData(block.GetBlockName(), "ma5vp", i).ParseFloat("ma5vp"); // float 8.2 block.ma20vp = query.GetFieldData(block.GetBlockName(), "ma20vp", i).ParseFloat("ma20vp"); // float 8.2 block.ma60vp = query.GetFieldData(block.GetBlockName(), "ma60vp", i).ParseFloat("ma60vp"); // float 8.2 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public XQt1475OutBlock1[] GetBlock1s() { XQt1475OutBlock1[] instance = XQt1475OutBlock1.ListFromQuery(this); return(instance); }