public static XQt1305OutBlock1[] ListFromQuery(XQt1305 query) { int count = query.GetBlockCount(XQt1305OutBlock1.BlockName); List <XQt1305OutBlock1> list = new List <XQt1305OutBlock1>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt1305OutBlock1 block = new XQt1305OutBlock1(); 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).ParseLong("open"); // long 8 block.high = query.GetFieldData(block.GetBlockName(), "high", i).ParseLong("high"); // long 8 block.low = query.GetFieldData(block.GetBlockName(), "low", i).ParseLong("low"); // long 8 block.close = query.GetFieldData(block.GetBlockName(), "close", i).ParseLong("close"); // 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.diff_vol = query.GetFieldData(block.GetBlockName(), "diff_vol", i).ParseFloat("diff_vol"); // float 10.2 block.chdegree = query.GetFieldData(block.GetBlockName(), "chdegree", i).ParseFloat("chdegree"); // float 6.2 block.sojinrate = query.GetFieldData(block.GetBlockName(), "sojinrate", i).ParseFloat("sojinrate"); // float 6.2 block.changerate = query.GetFieldData(block.GetBlockName(), "changerate", i).ParseFloat("changerate"); // float 6.2 block.fpvolume = query.GetFieldData(block.GetBlockName(), "fpvolume", i).ParseLong("fpvolume"); // long 12 block.covolume = query.GetFieldData(block.GetBlockName(), "covolume", i).ParseLong("covolume"); // long 12 block.shcode = query.GetFieldData(block.GetBlockName(), "shcode", i).TrimEnd('?'); // char 6 block.value = query.GetFieldData(block.GetBlockName(), "value", i).ParseLong("value"); // long 12 block.ppvolume = query.GetFieldData(block.GetBlockName(), "ppvolume", i).ParseLong("ppvolume"); // long 12 block.o_sign = query.GetFieldData(block.GetBlockName(), "o_sign", i).FirstOrDefault(); // char 1 block.o_change = query.GetFieldData(block.GetBlockName(), "o_change", i).ParseLong("o_change"); // long 8 block.o_diff = query.GetFieldData(block.GetBlockName(), "o_diff", i).ParseFloat("o_diff"); // float 6.2 block.h_sign = query.GetFieldData(block.GetBlockName(), "h_sign", i).FirstOrDefault(); // char 1 block.h_change = query.GetFieldData(block.GetBlockName(), "h_change", i).ParseLong("h_change"); // long 8 block.h_diff = query.GetFieldData(block.GetBlockName(), "h_diff", i).ParseFloat("h_diff"); // float 6.2 block.l_sign = query.GetFieldData(block.GetBlockName(), "l_sign", i).FirstOrDefault(); // char 1 block.l_change = query.GetFieldData(block.GetBlockName(), "l_change", i).ParseLong("l_change"); // long 8 block.l_diff = query.GetFieldData(block.GetBlockName(), "l_diff", i).ParseFloat("l_diff"); // float 6.2 block.marketcap = query.GetFieldData(block.GetBlockName(), "marketcap", i).ParseLong("marketcap"); // long 12 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public XQt1305OutBlock1[] GetBlock1s() { XQt1305OutBlock1[] instance = XQt1305OutBlock1.ListFromQuery(this); return(instance); }