public static XQt8416OutBlock1[] ListFromQuery(XQt8416 query) { int count = query.GetBlockCount(XQt8416OutBlock1.BlockName); List <XQt8416OutBlock1> list = new List <XQt8416OutBlock1>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt8416OutBlock1 block = new XQt8416OutBlock1(); block.IsValidData = true; block.InvalidReason = ""; try { block.date = query.GetFieldData(block.GetBlockName(), "date", i).TrimEnd('?'); // char 8 block.open = query.GetFieldData(block.GetBlockName(), "open", i).ParseFloat("open"); // float 6.2 block.high = query.GetFieldData(block.GetBlockName(), "high", i).ParseFloat("high"); // float 6.2 block.low = query.GetFieldData(block.GetBlockName(), "low", i).ParseFloat("low"); // float 6.2 block.close = query.GetFieldData(block.GetBlockName(), "close", i).ParseFloat("close"); // float 6.2 block.jdiff_vol = query.GetFieldData(block.GetBlockName(), "jdiff_vol", i).ParseLong("jdiff_vol"); // long 12 block.value = query.GetFieldData(block.GetBlockName(), "value", i).ParseLong("value"); // long 12 block.openyak = query.GetFieldData(block.GetBlockName(), "openyak", i).ParseLong("openyak"); // long 12 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public XQt8416OutBlock1[] GetBlock1s() { XQt8416OutBlock1[] instance = XQt8416OutBlock1.ListFromQuery(this); return(instance); }