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

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1308OutBlock1 block = new XQt1308OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.chetime  = query.GetFieldData(block.GetBlockName(), "chetime", i).TrimEnd('?');                // char 8
                    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.cvolume  = query.GetFieldData(block.GetBlockName(), "cvolume", i).ParseLong("cvolume");        // long 8
                    block.chdegvol = query.GetFieldData(block.GetBlockName(), "chdegvol", i).ParseFloat("chdegvol");     // float 8.2
                    block.chdegcnt = query.GetFieldData(block.GetBlockName(), "chdegcnt", i).ParseFloat("chdegcnt");     // float 8.2
                    block.volume   = query.GetFieldData(block.GetBlockName(), "volume", i).ParseLong("volume");          // long 12
                    block.mdvolume = query.GetFieldData(block.GetBlockName(), "mdvolume", i).ParseLong("mdvolume");      // long 12
                    block.mdchecnt = query.GetFieldData(block.GetBlockName(), "mdchecnt", i).ParseLong("mdchecnt");      // long 8
                    block.msvolume = query.GetFieldData(block.GetBlockName(), "msvolume", i).ParseLong("msvolume");      // long 12
                    block.mschecnt = query.GetFieldData(block.GetBlockName(), "mschecnt", i).ParseLong("mschecnt");      // long 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
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Exemple #2
0
 public XQt1308OutBlock1[] GetBlock1s()
 {
     XQt1308OutBlock1[] instance = XQt1308OutBlock1.ListFromQuery(this);
     return(instance);
 }