예제 #1
0
        public override LiteralExpr ConstantBV(BigInteger decimalValue, int bitWidth)
        {
            // Get the right dictionary for the bitwidth
            Dictionary <BigInteger, LiteralExpr> mapping = null;

            try
            {
                mapping = BitVectorCache[bitWidth];
            }
            catch (KeyNotFoundException)
            {
                mapping = new Dictionary <BigInteger, LiteralExpr>();
                BitVectorCache.Add(bitWidth, mapping);
            }

            try
            {
                var constant = mapping[decimalValue];
                Debug.Assert(constant.isBvConst);
                return(constant);
            }
            catch (KeyNotFoundException)
            {
                var newBv = UB.ConstantBV(decimalValue, bitWidth);
                Debug.Assert(newBv.isBvConst);
                mapping.Add(decimalValue, newBv);
                return(newBv);
            }
        }
예제 #2
0
 /// <summary>
 /// Computes the next value of the following sub-indicators from the given state:
 /// StandardDeviation, MiddleBand, UpperBand, LowerBand, BandWidth, %B
 /// </summary>
 /// <param name="input">The input given to the indicator</param>
 /// <returns>The input is returned unmodified.</returns>
 protected override decimal ComputeNextValue(IndicatorDataPoint input)
 {
     BB.Update(input);
     LB.Add(BB.LowerBand);
     UB.Add(BB.UpperBand);
     return(BB.MiddleBand);
 }
예제 #3
0
 public void addUB()
 {
     UB++;
     PlayerPrefs.SetInt("UB", PlayerPrefs.GetInt("UB") + 1);
     textUB.text    = UB.ToString();
     imageUB.sprite = fUB;
 }
예제 #4
0
    // Start is called before the first frame update
    void Start()
    {
        HB = PlayerPrefs.GetInt("HB");
        SB = PlayerPrefs.GetInt("SB");
        UB = PlayerPrefs.GetInt("UB");

        if (HB > 0)
        {
            imageHB.sprite = fHB;
        }

        if (SB > 0)
        {
            imageSB.sprite = fSB;
        }

        if (UB > 0)
        {
            imageUB.sprite = fUB;
        }

        textHB.text = HB.ToString();
        textSB.text = SB.ToString();
        textUB.text = UB.ToString();
    }
예제 #5
0
        /// <summary>
        /// Resets this indicator and all sub-indicators (StandardDeviation, LowerBand, MiddleBand, UpperBand, BandWidth, %B)
        /// </summary>
        public override void Reset()
        {
            BB.Reset();
            LB.Reset();
            UB.Reset();

            base.Reset();
        }
예제 #6
0
        private void btnSendUB_Click(object sender, EventArgs e)
        {
            try
            {
                List <UB> list = new List <UB>();
                UB        ub   = new UB();
                ub.UBNO         = txtUBNO1.Text;
                ub.UBLine       = Convert.ToInt32(txtUBLine1.Text);
                ub.FacCode      = txtUBFacCode1.Text;
                ub.StorageCode  = txtUBStorageCode1.Text;
                ub.MCode        = txtUBMCode1.Text;
                ub.Unit         = txtUBUnit1.Text;
                ub.Qty          = Convert.ToDecimal(txtUBQty1.Text);
                ub.DocumentDate = Convert.ToInt32(txtUBDocumentDate1.Text);
                ub.MesTransNO   = txtUBMesTransNum1.Text;
                ub.ContactUser  = txtUBContactUser1.Text;
                ub.InOutFlag    = cbUBInOutFlag1.SelectedIndex == 0 ? "351" : "101";
                list.Add(ub);

                if (!string.IsNullOrEmpty(txtUBNO2.Text))
                {
                    UB ub2 = new UB();
                    ub2.UBNO         = txtUBNO2.Text;
                    ub2.UBLine       = Convert.ToInt32(txtUBLine2.Text);
                    ub2.FacCode      = txtUBFacCode2.Text;
                    ub2.StorageCode  = txtUBStorageCode2.Text;
                    ub2.MCode        = txtUBMCode2.Text;
                    ub2.Unit         = txtUBUnit2.Text;
                    ub2.Qty          = Convert.ToDecimal(txtUBQty2.Text);
                    ub2.DocumentDate = Convert.ToInt32(txtUBDocumentDate2.Text);
                    ub2.MesTransNO   = txtUBMesTransNum2.Text;
                    ub2.ContactUser  = txtUBContactUser2.Text;
                    ub2.InOutFlag    = cbUBInOutFlag2.SelectedIndex == 0 ? "351" : "101";
                    list.Add(ub2);
                }

                UBToSAP      ubToSAP = new UBToSAP();
                SAPRfcReturn msg     = ubToSAP.PostUBToSAP(list);
                ShowMessage("====================" + btnSendUB.Text + " " + DateTime.Now + "====================");
                ShowMessage("执行结果标识(S表示成功,E表示失败):" + msg.Result);
                ShowMessage("SAP物料凭证编码:" + msg.MaterialDocument);
                ShowMessage("执行结果信息:" + msg.Message + "\r\n");
            }
            catch (Exception ex)
            {
                ShowMessage("Exception:" + ex.Message);
            }
        }
예제 #7
0
 public override LiteralExpr ConstantReal(BigDec value)
 {
     try
     {
         var cachedReal = RealCache[value];
         Debug.Assert(cachedReal.isBigDec);
         return(cachedReal);
     }
     catch (KeyNotFoundException)
     {
         var newReal = UB.ConstantReal(value);
         Debug.Assert(newReal.isBigDec);
         RealCache.Add(value, newReal);
         return(newReal);
     }
 }
예제 #8
0
 public override LiteralExpr ConstantInt(BigInteger decimalValue)
 {
     try
     {
         var cachedInt = IntegerCache[decimalValue];
         Debug.Assert(cachedInt.isBigNum);
         return(cachedInt);
     }
     catch (KeyNotFoundException)
     {
         var newInt = UB.ConstantInt(decimalValue);
         Debug.Assert(newInt.isBigNum);
         IntegerCache.Add(decimalValue, newInt);
         return(newInt);
     }
 }
예제 #9
0
    public void useUB()
    {
        if (UB > 0)
        {
            player.addUnhitEffect();
            UB -= 1;
            PlayerPrefs.SetInt("UB", PlayerPrefs.GetInt("UB") - 1);
        }

        textUB.text = UB.ToString();

        if (UB == 0)
        {
            imageUB.sprite = eUB;
        }
    }
예제 #10
0
        public IUB Create(
            ImmutableList <IUBParameterElement> value)
        {
            IUB parameter = null;

            try
            {
                parameter = new UB(
                    value);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(parameter);
        }
예제 #11
0
        protected override void OnCompile()
        {
            this.Add(this.FillStyles);
            this.Add(this.LineStyles);
            AB item = new AB(1);

            if (this.FillStyles.Count > 0)
            {
                this.nFillBits = UB.NumBits((long)this.FillStyles.Count);
            }
            if (this.LineStyles.Count > 0)
            {
                this.nLineBits = UB.NumBits((long)this.LineStyles.Count);
            }
            item.Append(new UB(4, this.nFillBits));
            item.Append(new UB(4, this.nLineBits));
            this.Add(item);
            this.Records.Add(new EndShapeRecord());
            this.Add(this.Records);
        }
예제 #12
0
        private void parseUB(SieDataItem di)
        {
            if (!KONTO.ContainsKey(di.GetString(1)))
            {
                KONTO.Add(di.GetString(1), new SieAccount()
                {
                    Number = di.GetString(1), Company = this.Company, Import = this.Import
                });
            }
            var v = new SiePeriodValue()
            {
                YearNr   = di.GetInt(0),
                Account  = KONTO[di.GetString(1)],
                Amount   = di.GetDecimal(2),
                Quantity = di.GetDecimal(3),
                Token    = di.ItemType
            };

            Callbacks.CallbackUB(v);
            if (!StreamValues)
            {
                UB.Add(v);
            }
        }