예제 #1
0
        public static XQt8405OutBlock1[] ListFromQuery(XQt8405 query)
        {
            int count = query.GetBlockCount(XQt8405OutBlock1.BlockName);
            List <XQt8405OutBlock1> list = new List <XQt8405OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt8405OutBlock1 block = new XQt8405OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.date        = query.GetFieldData(block.GetBlockName(), "date", i).TrimEnd('?');                    // char 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
                    block.close       = query.GetFieldData(block.GetBlockName(), "close", i).ParseLong("close");             // 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.volume      = query.GetFieldData(block.GetBlockName(), "volume", i).ParseLong("volume");           // long 12
                    block.diff_vol    = query.GetFieldData(block.GetBlockName(), "diff_vol", i).ParseFloat("diff_vol");      // float 10.2
                    block.openyak     = query.GetFieldData(block.GetBlockName(), "openyak", i).ParseLong("openyak");         // long 8
                    block.openyakupdn = query.GetFieldData(block.GetBlockName(), "openyakupdn", i).ParseLong("openyakupdn"); // long 8
                    block.value       = query.GetFieldData(block.GetBlockName(), "value", i).ParseFloat("value");            // float 12
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
예제 #2
0
 public XQt8405OutBlock1[] GetBlock1s()
 {
     XQt8405OutBlock1[] instance = XQt8405OutBlock1.ListFromQuery(this);
     return(instance);
 }