public static XQt2405OutBlock FromQuery(XQt2405 query) { XQt2405OutBlock block = new XQt2405OutBlock(); block.IsValidData = true; block.InvalidReason = ""; if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { block.IsValidData = false; block.InvalidReason = query.ReceiveMessage; return(block); } try { block.mdvolume = query.GetFieldData(block.GetBlockName(), "mdvolume", 0).ParseDouble("mdvolume"); // double 12.0 block.mdchecnt = query.GetFieldData(block.GetBlockName(), "mdchecnt", 0).ParseLong("mdchecnt"); // long 8 block.msvolume = query.GetFieldData(block.GetBlockName(), "msvolume", 0).ParseDouble("msvolume"); // double 12.0 block.mschecnt = query.GetFieldData(block.GetBlockName(), "mschecnt", 0).ParseLong("mschecnt"); // long 8 block.cts_time = query.GetFieldData(block.GetBlockName(), "cts_time", 0).TrimEnd('?'); // char 6 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }
public XQt2405OutBlock GetBlock() { XQt2405OutBlock instance = XQt2405OutBlock.FromQuery(this); return(instance); }