四模拟量采集器组zigbee转串口数据采集
来源:互联网 发布:linux 系统软件测试 编辑:程序博客网 时间:2024/05/17 03:37
xaml:
<Window x:Class="wsd.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded_1"> <Grid> <ComboBox HorizontalAlignment="Left" Margin="191,10,0,0" VerticalAlignment="Top" Width="120"/> <Label Name="wendu" Content="N/A" HorizontalAlignment="Left" Margin="271,64,0,0" VerticalAlignment="Top"/> <Label Name="shidu" Content="N/A" HorizontalAlignment="Left" Margin="271,132,0,0" VerticalAlignment="Top"/> <Label Name="guangzhao" Content="N/A" HorizontalAlignment="Left" Margin="271,206,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.024,1.244"/> <Label Content="温度" HorizontalAlignment="Left" Margin="171,64,0,0" VerticalAlignment="Top" RenderTransformOrigin="1.483,0.193"/> <Label Content="湿度" HorizontalAlignment="Left" Margin="171,132,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.252,1.811"/> <Label Content="光照" HorizontalAlignment="Left" Margin="171,206,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.924,0.364"/> </Grid></Window>
<pre name="code" class="csharp">cs:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;using ZigBeeLibrary;using System.Windows.Threading;namespace wsd{ /// <summary> /// MainWindow.xaml 的交互逻辑 /// </summary> public partial class MainWindow : Window { ZigBee zigbee = null; ComSettingModel model = new ComSettingModel(); DispatcherTimer timer = new DispatcherTimer(); private Dictionary<string, ZigBee> mdic = new Dictionary<string, ZigBee>(); public MainWindow() { InitializeComponent(); } private void Window_Loaded_1(object sender, RoutedEventArgs e) { if (model.ZigbeeCom == null) { MessageBox.Show("请检查串口"); return; } else { model.ZigbeeCom = "COM3"; if(!mdic.TryGetValue(model.ZigbeeCom,out zigbee)) { zigbee = new ZigBee(model); zigbee.InitSerialPort(); } // zigbee.GetSet(); // wendu.Content = zigbee.temperatureValue; // shidu.Content = zigbee.humidityValue; // guangzhao.Content = zigbee.lightValue; timer.Tick+=new EventHandler(timertick); timer.Interval = TimeSpan.FromSeconds(1); timer.Start(); } } private void timertick(object sender, EventArgs e) { zigbee.GetSet(); wendu.Content = zigbee.temperatureValue; shidu.Content = zigbee.humidityValue; guangzhao.Content = zigbee.lightValue; } }}
0 0
- 四模拟量采集器组zigbee转串口数据采集
- AIO 模拟量采集 电路
- matlab串口采集数据
- 树莓派通过ADC0832采集模拟量
- STM32L152 ADC单通道采集模拟量
- 多线程模拟数据采集、显示
- 无线采集,模拟量采集,模拟量传输----西安达泰电子
- 在安卓中实现Zigbee串口设备采集模块
- ZigBee基础实验(七)--AD采集温度串口显示
- C-V测试仪中上位机串口采集数据采集
- 用VB进行串口实时数据采集
- vb.net 串口数据采集类
- Delphi实现远程串口的数据采集
- Matlab---串口操作---数据采集篇
- c#串口温度数据的波形采集
- c#串口温度数据的波形采集
- matlab之串口数据采集绘图
- c#串口通信之adc数据采集
- 《Monkey Android》第10课TextView和EditText
- 每天进步一点点——五分钟理解一致性哈希算法(consistent hashing)
- 项目管理: Maven 让事情变得简单
- android的m、mm、mmm编译命令的使用
- 该用哪一种nosql
- 四模拟量采集器组zigbee转串口数据采集
- 为什么super()和this()调用语句不能同时在一个构造函数中出现的解释
- HDU 1021 Fibonacci Again
- 计算机视觉和模式识别的code
- jquery json 三级省市联动
- Android中线程池的使用与分析
- 将shell脚本执行情况写入Rsyslog日志服务器
- 课程设计——图书管理新系统
- C#难点逐个击破2out返回参数