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

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt8429OutBlock1 block = new XQt8429OutBlock1();
                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.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());
        }
Exemple #2
0
 public XQt8429OutBlock1[] GetBlock1s()
 {
     XQt8429OutBlock1[] instance = XQt8429OutBlock1.ListFromQuery(this);
     return(instance);
 }