Пример #1
0
        public static XRFC0OutBlock FromQuery(XRFC0 query)
        {
            XRFC0OutBlock block = new XRFC0OutBlock();

            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").ParseFloat("change");           // float 6.2
                block.drate       = query.GetFieldData(block.GetBlockName(), "drate").ParseFloat("drate");             // float 6.2
                block.price       = query.GetFieldData(block.GetBlockName(), "price").ParseFloat("price");             // float 6.2
                block.open        = query.GetFieldData(block.GetBlockName(), "open").ParseFloat("open");               // float 6.2
                block.high        = query.GetFieldData(block.GetBlockName(), "high").ParseFloat("high");               // float 6.2
                block.low         = query.GetFieldData(block.GetBlockName(), "low").ParseFloat("low");                 // float 6.2
                block.cgubun      = query.GetFieldData(block.GetBlockName(), "cgubun").FirstOrDefault();               // char 1
                block.cvolume     = query.GetFieldData(block.GetBlockName(), "cvolume").ParseLong("cvolume");          // long 6
                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.offerho1    = query.GetFieldData(block.GetBlockName(), "offerho1").ParseFloat("offerho1");       // float 6.2
                block.bidho1      = query.GetFieldData(block.GetBlockName(), "bidho1").ParseFloat("bidho1");           // float 6.2
                block.openyak     = query.GetFieldData(block.GetBlockName(), "openyak").ParseLong("openyak");          // long 8
                block.k200jisu    = query.GetFieldData(block.GetBlockName(), "k200jisu").ParseFloat("k200jisu");       // float 6.2
                block.theoryprice = query.GetFieldData(block.GetBlockName(), "theoryprice").ParseFloat("theoryprice"); // float 6.2
                block.kasis       = query.GetFieldData(block.GetBlockName(), "kasis").ParseFloat("kasis");             // float 6.2
                block.sbasis      = query.GetFieldData(block.GetBlockName(), "sbasis").ParseFloat("sbasis");           // float 6.2
                block.ibasis      = query.GetFieldData(block.GetBlockName(), "ibasis").ParseFloat("ibasis");           // float 6.2
                block.openyakcha  = query.GetFieldData(block.GetBlockName(), "openyakcha").ParseLong("openyakcha");    // long 8
                block.jgubun      = query.GetFieldData(block.GetBlockName(), "jgubun").TrimEnd('?');                   // char 2
                block.jnilvolume  = query.GetFieldData(block.GetBlockName(), "jnilvolume").ParseLong("jnilvolume");    // long 12
                block.futcode     = query.GetFieldData(block.GetBlockName(), "futcode").TrimEnd('?');                  // char 8
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Пример #2
0
        public XRFC0OutBlock GetBlock()
        {
            XRFC0OutBlock instance = XRFC0OutBlock.FromQuery(this);

            return(instance);
        }