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); } }
/// <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); }
public void addUB() { UB++; PlayerPrefs.SetInt("UB", PlayerPrefs.GetInt("UB") + 1); textUB.text = UB.ToString(); imageUB.sprite = fUB; }
// 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(); }
/// <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(); }
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); } }
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); } }
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); } }
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; } }
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); }
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); }
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); } }