Exemplo n.º 1
0
        public static XQt2209OutBlock1[] ListFromQuery(XQt2209 query)
        {
            int count = query.GetBlockCount(XQt2209OutBlock1.BlockName);
            List <XQt2209OutBlock1> list = new List <XQt2209OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt2209OutBlock1 block = new XQt2209OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.chetime     = query.GetFieldData(block.GetBlockName(), "chetime", i).TrimEnd('?');                   // char 10
                    block.price       = query.GetFieldData(block.GetBlockName(), "price", i).ParseFloat("price");              // float 6.2
                    block.sign        = query.GetFieldData(block.GetBlockName(), "sign", i).FirstOrDefault();                  // char 1
                    block.change      = query.GetFieldData(block.GetBlockName(), "change", i).ParseFloat("change");            // float 6.2
                    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.volume      = query.GetFieldData(block.GetBlockName(), "volume", i).ParseDouble("volume");           // double 12.0
                    block.value       = query.GetFieldData(block.GetBlockName(), "value", i).ParseDouble("value");             // double 12.0
                    block.openyak     = query.GetFieldData(block.GetBlockName(), "openyak", i).ParseLong("openyak");           // long 8
                    block.openupdn    = query.GetFieldData(block.GetBlockName(), "openupdn", i).ParseLong("openupdn");         // long 8
                    block.cvolume     = query.GetFieldData(block.GetBlockName(), "cvolume", i).ParseLong("cvolume");           // long 8
                    block.s_mschecnt  = query.GetFieldData(block.GetBlockName(), "s_mschecnt", i).ParseLong("s_mschecnt");     // long 8
                    block.s_mdchecnt  = query.GetFieldData(block.GetBlockName(), "s_mdchecnt", i).ParseLong("s_mdchecnt");     // long 8
                    block.ss_mschecnt = query.GetFieldData(block.GetBlockName(), "ss_mschecnt", i).ParseLong("ss_mschecnt");   // long 8
                    block.s_mschevol  = query.GetFieldData(block.GetBlockName(), "s_mschevol", i).ParseDouble("s_mschevol");   // double 12.0
                    block.s_mdchevol  = query.GetFieldData(block.GetBlockName(), "s_mdchevol", i).ParseDouble("s_mdchevol");   // double 12.0
                    block.ss_mschevol = query.GetFieldData(block.GetBlockName(), "ss_mschevol", i).ParseDouble("ss_mschevol"); // double 12.0
                    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
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Exemplo n.º 2
0
 public XQt2209OutBlock1[] GetBlock1s()
 {
     XQt2209OutBlock1[] instance = XQt2209OutBlock1.ListFromQuery(this);
     return(instance);
 }