Esempio n. 1
0
        public static XQt8404OutBlock1[] ListFromQuery(XQt8404 query)
        {
            int count = query.GetBlockCount(XQt8404OutBlock1.BlockName);
            List <XQt8404OutBlock1> list = new List <XQt8404OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt8404OutBlock1 block = new XQt8404OutBlock1();
                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).ParseLong("price");               // long 8
                    block.sign         = query.GetFieldData(block.GetBlockName(), "sign", i).FirstOrDefault();                  // char 1
                    block.change       = query.GetFieldData(block.GetBlockName(), "change", i).ParseFloat("change");            // float 8
                    block.cvolume      = query.GetFieldData(block.GetBlockName(), "cvolume", i).ParseLong("cvolume");           // long 8
                    block.chdegree     = query.GetFieldData(block.GetBlockName(), "chdegree", i).ParseFloat("chdegree");        // float 8.2
                    block.offerho      = query.GetFieldData(block.GetBlockName(), "offerho", i).ParseLong("offerho");           // long 8
                    block.bidho        = query.GetFieldData(block.GetBlockName(), "bidho", i).ParseLong("bidho");               // long 8
                    block.volume       = query.GetFieldData(block.GetBlockName(), "volume", i).ParseDouble("volume");           // double 12.0
                    block.openyak      = query.GetFieldData(block.GetBlockName(), "openyak", i).ParseLong("openyak");           // long 8
                    block.jnilopenupdn = query.GetFieldData(block.GetBlockName(), "jnilopenupdn", i).ParseLong("jnilopenupdn"); // long 8
                    block.ibasis       = query.GetFieldData(block.GetBlockName(), "ibasis", i).ParseLong("ibasis");             // long 8
                    block.sbasis       = query.GetFieldData(block.GetBlockName(), "sbasis", i).ParseLong("sbasis");             // long 8
                    block.kasis        = query.GetFieldData(block.GetBlockName(), "kasis", i).ParseFloat("kasis");              // float 6.2
                    block.value        = query.GetFieldData(block.GetBlockName(), "value", i).ParseDouble("value");             // double 12.0
                    block.j_openupdn   = query.GetFieldData(block.GetBlockName(), "j_openupdn", i).ParseLong("j_openupdn");     // long 8
                    block.n_msvolume   = query.GetFieldData(block.GetBlockName(), "n_msvolume", i).ParseDouble("n_msvolume");   // double 12.0
                    block.n_mdvolume   = query.GetFieldData(block.GetBlockName(), "n_mdvolume", i).ParseDouble("n_mdvolume");   // double 12.0
                    block.s_msvolume   = query.GetFieldData(block.GetBlockName(), "s_msvolume", i).ParseDouble("s_msvolume");   // double 12.0
                    block.n_mschecnt   = query.GetFieldData(block.GetBlockName(), "n_mschecnt", i).ParseLong("n_mschecnt");     // long 8
                    block.n_mdchecnt   = query.GetFieldData(block.GetBlockName(), "n_mdchecnt", i).ParseLong("n_mdchecnt");     // long 8
                    block.s_mschecnt   = query.GetFieldData(block.GetBlockName(), "s_mschecnt", i).ParseLong("s_mschecnt");     // long 8
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Esempio n. 2
0
 public XQt8404OutBlock1[] GetBlock1s()
 {
     XQt8404OutBlock1[] instance = XQt8404OutBlock1.ListFromQuery(this);
     return(instance);
 }