public virtual void Show(QuantityModel quantity) { //按钮颜色,存储的表达式等等 this.quantity = quantity; formulaController.Initialize(); formulaController.gameObject.SetActive(false); Title1.text = $"{quantity.Symbol}的平均值\n\n="; Title2.text = $"{quantity.Symbol}的A类不确定度\n\n="; Title3.text = $"{quantity.Symbol}的B类不确定度\n\n="; Title4.text = $"{quantity.Symbol}的合成不确定度\n\n="; if (quantity.AverageExpression != null && quantity.AverageExpression.Count != 0) { Value1.text = "=" + StaticMethods.NumberFormat(quantity.AverageExpression.GetExpressionExecuted()); CallButton1.image.sprite = Sprites[2]; } else { Value1.text = "=0"; CallButton1.image.sprite = Sprites[0]; } if (quantity.UaExpression != null && quantity.UaExpression.Count != 0) { Value2.text = "=" + StaticMethods.NumberFormat(quantity.UaExpression.GetExpressionExecuted()); CallButton2.image.sprite = Sprites[2]; } else { Value2.text = "=0"; CallButton2.image.sprite = Sprites[0]; } if (quantity.UbExpression != null && quantity.UbExpression.Count != 0) { Value3.text = "=" + StaticMethods.NumberFormat(quantity.UbExpression.GetExpressionExecuted()); CallButton3.image.sprite = Sprites[2]; } else { Value3.text = "=0"; CallButton3.image.sprite = Sprites[0]; } if (quantity.ComplexExpression != null && quantity.ComplexExpression.Count != 0) { Value4.text = "=" + StaticMethods.NumberFormat(quantity.ComplexExpression.GetExpressionExecuted()); CallButton4.image.sprite = Sprites[2]; } else { Value4.text = "=0"; CallButton4.image.sprite = Sprites[0]; } }
public void Show() { RenderFormula(); formulaController.Initialize(); formulaController.gameObject.SetActive(false); model = RecordManager.tempRecord.complexQuantityModel; if (RecordManager.tempRecord.quantities.Where(x => x.processMethod == 4).Any()) { HidePanel.SetActive(false); } else { HidePanel.SetActive(true); } if (model.AverageExpression != null && model.AverageExpression.Count != 0) { Value1.text = "=" + StaticMethods.NumberFormat(model.AverageExpression.GetExpressionExecuted()); CallButton1.image.sprite = Sprites[2]; } else { Value1.text = "=0"; CallButton1.image.sprite = Sprites[0]; } if (model.UncertainExpression != null && model.UncertainExpression.Count != 0) { Value2.text = "=" + StaticMethods.NumberFormat(model.UncertainExpression.GetExpressionExecuted()); CallButton2.image.sprite = Sprites[2]; } else { Value2.text = "=0"; CallButton2.image.sprite = Sprites[0]; } MainValue.text = model.AnswerAverage; Uncertain.text = model.AnswerUncertain; Unit.text = model.Unit; }