示例#1
0
        public void ExecuteSimulation()
        {
            try
            {
                var timestamp = DateTimeOffset.Now;

                var dict = new Dictionary <string, object>();
                dict["Timestamp"] = timestamp;

                foreach (var field in MyModFieldStore.TheValues)
                {
                    double rndVal = TheCommonUtils.GetRandomDouble() * 1000.0;
                    if (field.SourceType == "double")
                    {
                        dict[field.PropertyName] = rndVal;
                    }
                    else if (field.SourceType == "float")
                    {
                        dict[field.PropertyName] = rndVal;
                    }
                }
                MyBaseThing.SetProperties(dict, timestamp);
            }
            catch (Exception)
            {
                // Console.WriteLine("Ignoring exception: " + ex.Message);
                //Console.WriteLine(ex.StackTrace);
            }
        }