Exemple #1
0
        public static XQt1485OutBlock1[] ListFromQuery(XQt1485 query)
        {
            int count = query.GetBlockCount(XQt1485OutBlock1.BlockName);
            List <XQt1485OutBlock1> list = new List <XQt1485OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1485OutBlock1 block = new XQt1485OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.chetime = query.GetFieldData(block.GetBlockName(), "chetime", i).TrimEnd('?');                   // char 6
                    block.jisu    = query.GetFieldData(block.GetBlockName(), "jisu", i).ParseFloat("jisu");                // float 10.2
                    block.sign    = query.GetFieldData(block.GetBlockName(), "sign", i).FirstOrDefault();                  // char 1
                    block.change  = query.GetFieldData(block.GetBlockName(), "change", i).ParseFloat("change");            // float 10.2
                    block.volume  = query.GetFieldData(block.GetBlockName(), "volume", i).ParseLong("volume");             // long 12
                    block.volcha  = query.GetFieldData(block.GetBlockName(), "volcha", i).ParseLong("volcha");             // long 12
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Exemple #2
0
 public XQt1485OutBlock1[] GetBlock1s()
 {
     XQt1485OutBlock1[] instance = XQt1485OutBlock1.ListFromQuery(this);
     return(instance);
 }