/**
     * Gets the transformation time as a double for the transformation property. If none found or parse error, return as a defult double.
     */

    protected double GetTransformationTime(string timeProperty)
    {
        double time;

        if (!this.transformationPropClass.Values.ContainsKey(timeProperty))
        {
            return(this.defaultTransformationTime);
        }

        if (!StringParsers.TryParseDouble(this.transformationPropClass.Values[timeProperty].Trim(), out time))
        {
            Log.Warning("Could not parse double for " + timeProperty + ". Using default time of " + this.defaultTransformationTime + ".");
            return(this.defaultTransformationTime);
        }
        return(time);
    }
Exemple #2
0
    /**
     * Reads the time string from the TransformationData string.
     */

    private static void ReadTime(string _s, ref TransformationData tData)
    {
        MatchCollection timeCheck = TransformationCollection.readParser["tTimeParse"].Matches(_s);

        if (timeCheck.Count == 0)
        {
            throw new Exception("No time parameter found in string " + _s + ".");
        }

        double time;

        if (!StringParsers.TryParseDouble(timeCheck[0].Groups[1].ToString(), out time))
        {
            throw new Exception("Could not parse " + timeCheck[0].Value.ToString() + " as a double.");
        }
        tData.transformationTime = time;
    }