Example #1
0
        internal static void MakeMsgToRequestDataCalc(int sensorid, string filePath, DateTime acqTime)
        {
            var msg = new RequestDataCalcMessage
            {
                Id       = Guid.NewGuid(),
                SensorID = sensorid,
                DateTime = acqTime,
                FilePath = filePath,
                RoundNum = string.Empty
            };

            System.Threading.Tasks.Task task = new System.Threading.Tasks.Task(
                () =>
            {
                WarningThread.GetWarningThread().SendWarningProcessMessage(msg);
            });
            task.Start();
            task.ContinueWith(
                t =>
            {
                if (t.Exception != null)
                {
                    Log.Error("发送振动计算请求失败:" + t.Exception.Message, t.Exception);
                }
                else
                {
                    Log.Info("发送振动计算请求成功");
                }
            });
        }
Example #2
0
        public static RequestDataCalcMessage MakeMsgToRequestDataCalc(int project, DateTime time)
        {
            var msg = new RequestDataCalcMessage
            {
                Id       = Guid.NewGuid(),
                StructId = project,
                DateTime = time,
                RoundNum = string.Empty
            };
            Task task = new Task(
                () =>
            {
                WarningThread.GetWarningThread().SendWarningProcessMessage(msg);
            });

            task.Start();
            task.ContinueWith(
                t =>
            {
                if (t.Exception != null)
                {
                    Log.Error("发送数据计算请求失败:" + t.Exception.Message, t.Exception);
                }
                else
                {
                    Log.Info("发送数据计算请求成功");
                }
            });
            return(msg);
        }
Example #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            comboBox_mode.SelectedIndex = 0;
            comboBox_show.SelectedIndex = 0;

            // added by xiezhen
            // 读取应用配置
            GetAppSettings();

            // 启动后开始采集
            toolStripButton_start.PerformClick();
            // end of added
            //MakeMsgToRequestDataCalc(4, DateTime.Now);
            WarningThread.GetWarningThread().Start();
        }