Exemple #1
0
        /// <summary>
        /// Creates a new camera value
        /// </summary>
        /// <param name="Value">The value as a string</param>
        /// <param name="ValueType">The property ID of the value</param>
        public CameraValue(string Value, PropertyID ValueType)
            : this()
        {
            this.ValueType = ValueType;
            StringValue    = Value;
            switch (ValueType)
            {
            case PropertyID.Av:
                IntValue    = AvValues.GetValue(Value).IntValue;
                DoubleValue = AvValues.GetValue(Value).DoubleValue;
                break;

            case PropertyID.Tv:
                IntValue    = TvValues.GetValue(Value).IntValue;
                DoubleValue = TvValues.GetValue(Value).DoubleValue;
                break;

            case PropertyID.ISO:
                IntValue    = ISOValues.GetValue(Value).IntValue;
                DoubleValue = ISOValues.GetValue(Value).DoubleValue;
                break;

            case PropertyID.ColorTemperature:
                int utmp;
                IntValue    = (int.TryParse(Value, out utmp)) ? utmp : 5600;
                DoubleValue = utmp;
                break;

            case PropertyID.AEMode:
                IntValue    = AEModeValues.GetValue(Value).IntValue;
                DoubleValue = AEModeValues.GetValue(Value).DoubleValue;
                break;

            case PropertyID.MeteringMode:
                IntValue    = MeteringModeValues.GetValue(Value).IntValue;
                DoubleValue = MeteringModeValues.GetValue(Value).DoubleValue;
                break;

            case PropertyID.ExposureCompensation:
                IntValue    = ExpCompValues.GetValue(Value).IntValue;
                DoubleValue = ExpCompValues.GetValue(Value).DoubleValue;
                break;
            }
        }
Exemple #2
0
        /// <summary>
        /// Creates a new camera value
        /// </summary>
        /// <param name="Value">The value as a double</param>
        /// <param name="ValueType">The property ID of the value</param>
        public CameraValue(double Value, PropertyID ValueType)
            : this()
        {
            this.ValueType = ValueType;
            DoubleValue    = Value;
            switch (ValueType)
            {
            case PropertyID.Av:
                StringValue = AvValues.GetValue(Value).StringValue;
                IntValue    = AvValues.GetValue(Value).IntValue;
                break;

            case PropertyID.Tv:
                StringValue = TvValues.GetValue(Value).StringValue;
                IntValue    = TvValues.GetValue(Value).IntValue;
                break;

            case PropertyID.ISO:
                StringValue = ISOValues.GetValue(Value).StringValue;
                IntValue    = ISOValues.GetValue(Value).IntValue;
                break;

            case PropertyID.ColorTemperature:
                StringValue = Value.ToString("F0");
                IntValue    = (int)Value;
                break;

            case PropertyID.AEMode:
                StringValue = AEModeValues.GetValue(Value).StringValue;
                IntValue    = AEModeValues.GetValue(Value).IntValue;
                break;

            case PropertyID.MeteringMode:
                StringValue = MeteringModeValues.GetValue(Value).StringValue;
                IntValue    = MeteringModeValues.GetValue(Value).IntValue;
                break;

            case PropertyID.ExposureCompensation:
                StringValue = ExpCompValues.GetValue(Value).StringValue;
                IntValue    = ExpCompValues.GetValue(Value).IntValue;
                break;
            }
        }