Example #1
0
        public static XRS3_OutBlock FromQuery(XRS3_ query)
        {
            XRS3_OutBlock block = new XRS3_OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            try
            {
                block.chetime    = query.GetFieldData(block.GetBlockName(), "chetime").TrimEnd('?');               // char 6
                block.sign       = query.GetFieldData(block.GetBlockName(), "sign").FirstOrDefault();              // char 1
                block.change     = query.GetFieldData(block.GetBlockName(), "change").ParseLong("change");         // long 8
                block.drate      = query.GetFieldData(block.GetBlockName(), "drate").ParseFloat("drate");          // float 6.2
                block.price      = query.GetFieldData(block.GetBlockName(), "price").ParseLong("price");           // long 8
                block.opentime   = query.GetFieldData(block.GetBlockName(), "opentime").TrimEnd('?');              // char 6
                block.open       = query.GetFieldData(block.GetBlockName(), "open").ParseLong("open");             // long 8
                block.hightime   = query.GetFieldData(block.GetBlockName(), "hightime").TrimEnd('?');              // char 6
                block.high       = query.GetFieldData(block.GetBlockName(), "high").ParseLong("high");             // long 8
                block.lowtime    = query.GetFieldData(block.GetBlockName(), "lowtime").TrimEnd('?');               // char 6
                block.low        = query.GetFieldData(block.GetBlockName(), "low").ParseLong("low");               // long 8
                block.cgubun     = query.GetFieldData(block.GetBlockName(), "cgubun").FirstOrDefault();            // char 1
                block.cvolume    = query.GetFieldData(block.GetBlockName(), "cvolume").ParseLong("cvolume");       // long 8
                block.volume     = query.GetFieldData(block.GetBlockName(), "volume").ParseLong("volume");         // long 12
                block.value      = query.GetFieldData(block.GetBlockName(), "value").ParseLong("value");           // long 12
                block.mdvolume   = query.GetFieldData(block.GetBlockName(), "mdvolume").ParseLong("mdvolume");     // long 12
                block.mdchecnt   = query.GetFieldData(block.GetBlockName(), "mdchecnt").ParseLong("mdchecnt");     // long 8
                block.msvolume   = query.GetFieldData(block.GetBlockName(), "msvolume").ParseLong("msvolume");     // long 12
                block.mschecnt   = query.GetFieldData(block.GetBlockName(), "mschecnt").ParseLong("mschecnt");     // long 8
                block.cpower     = query.GetFieldData(block.GetBlockName(), "cpower").ParseFloat("cpower");        // float 9.2
                block.w_avrg     = query.GetFieldData(block.GetBlockName(), "w_avrg").ParseLong("w_avrg");         // long 8
                block.offerho    = query.GetFieldData(block.GetBlockName(), "offerho").ParseLong("offerho");       // long 8
                block.bidho      = query.GetFieldData(block.GetBlockName(), "bidho").ParseLong("bidho");           // long 8
                block.status     = query.GetFieldData(block.GetBlockName(), "status").TrimEnd('?');                // char 2
                block.jnilvolume = query.GetFieldData(block.GetBlockName(), "jnilvolume").ParseLong("jnilvolume"); // long 12
                block.shcode     = query.GetFieldData(block.GetBlockName(), "shcode").TrimEnd('?');                // char 6
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Example #2
0
        public XRS3_OutBlock GetBlock()
        {
            XRS3_OutBlock instance = XRS3_OutBlock.FromQuery(this);

            return(instance);
        }