コード例 #1
0
        public new static DoubleVariable Random()
        {
            var x = new DoubleVariable();

            x.SetRandomValues();
            return(x);
        }
コード例 #2
0
 public void IsEmptyTest()
 {
     Assert.IsFalse(Obj.IsEmpty());
     Assert.IsFalse(new DoubleVariable().IsEmpty());
     Assert.IsFalse(DoubleVariable.Random().IsEmpty());
     Assert.IsTrue(DoubleVariable.Empty.IsEmpty());
 }
コード例 #3
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        DoubleVariable myScript = (DoubleVariable)target;

        if (GUILayout.Button("Invoke"))
        {
            myScript.ValueChangedEvent.Invoke();
        }
    }
コード例 #4
0
        private static DoubleVariableSerializer CreateSerializer(BitStream stream, int minValue, int maxValue, int decimalPlace)
        {
            DoubleVariable variable = new DoubleVariable(0, "DoubleVar")
            {
                MinValue      = minValue,
                MaxValue      = maxValue,
                DecimalPlaces = decimalPlace
            };
            var serializer = new DoubleVariableSerializer(variable);

            return(serializer);
        }
コード例 #5
0
        public void EditorSetVariableData(DoubleVariable global, DoubleVariableInstanced instanced, double constant,
                                          AssignmentType type, IDTokenHolder tokenHolder)
        {
            _assignmentType = type;
            EditorSetTokenHolder(tokenHolder);

            switch (type)
            {
            case AssignmentType.Constant:
                _constantValue = constant;
                break;

            case AssignmentType.GlobalVariable:
                _globalVariable = global;
                break;

            case AssignmentType.PersonalVariable:
                _instancedVariable = instanced;
                break;
            }
        }
コード例 #6
0
        public virtual void Run(Product product)
        {
            DateTime start = DateTime.Now;

            ErrorCode = 0;
            try
            {
                product.Engine = this;
                ErrorCode      = product.Run(Context);
                SetErrorcode(ErrorCode);
            }
            catch (TeflonDoubleAssertFailException e)
            {
                SetErrorcode(e.ErrorCode);
            }
            catch (TeflonBoolAssertFailException e)
            {
                SetErrorcode(e.ErrorCode);
            }
            catch (TeflonIntAssertFailException e)
            {
                SetErrorcode(e.ErrorCode);
            }
            catch (TeflonStringAssertFailException e)
            {
                SetErrorcode(e.ErrorCode);
            }
            catch (TeflonCommunicationException e)
            {
                SetErrorcode(e.ErrorCode);
            }
            finally
            {
                DoubleVariable time = (DateTime.Now - start).TotalSeconds;
                time.Name = "TotalTestTime";
                product.Dispose();
            }
        }
コード例 #7
0
 public DoubleVariableSerializer(DoubleVariable variable)
 {
     _variable  = variable;
     _bitLength = LenghtSerializer.GetBitsLengthDouble(variable.MinValue, variable.MaxValue, variable.DecimalPlaces);
 }
コード例 #8
0
 internal static double?Convert(this DoubleVariable variable) => variable?.Value;