资源简介
此源码可以直接运行,示例如何接收GPS卫星报文、如何解析、如何使用的功能,可供参考。

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace GPSSerialPortData
{
public partial class ConfigForm : Form
{
public ConfigForm()
{
InitializeComponent();
}
private void ConfigForm_Load(object sender EventArgs e)
{
/*获取当前计算机上所有的串口*/
string[] ports = System.IO.Ports.SerialPort.GetPortNames();
//checkedListBox1.set
foreach (string port in ports)
{
checkedListBox1.Items.Add(port);
}
//for (int i = 1; i < 10; i++)
//{
// checkedListBox1.Items.Add(“COM“ + i.ToString());
//}
InitForm();
}
private void InitForm()
{
for (int i = 0; i < checkedListBox1.Items.Count; i++)
{
if (SerialPortConfig.IsExistPort(checkedListBox1.Items[i].ToString()))
{
checkedListBox1.SetItemChecked(i true);
}
else
{
checkedListBox1.SetItemChecked(i false);
}
}
cbBaudRate.Text = SerialPortConfig.BaudRate.ToString();
switch (SerialPortConfig.Parity)
{
case System.IO.Ports.Parity.Even:
cbParity.Text = “E“;
break;
case System.IO.Ports.Parity.Mark:
cbParity.Text = “M“;
break;
case System.IO.Ports.Parity.None:
cbParity.Text = “N“;
break;
case System.IO.Ports.Parity.Odd:
cbParity.Text = “O“;
break;
case System.IO.Ports.Parity.Space:
cbParity.Text = “S“;
break;
}
cbDataBits.Text = SerialPortConfig.DataBits.ToString();
switch (SerialPortConfig.StopBits)
{
case System.IO.Ports.StopBits.None:
cbStopBits.Text = “0“;
break;
case System.IO.Ports.StopBits.One:
cbStopBits.Text = “1“;
break;
case System.IO.Ports.StopBits.OnePointFive:
cbStopBits.Text = “1.5“;
break;
case System.IO.Ports.StopBits.Two:
cbStopBits.Text = “2“;
break;
}
}
private void btnCancel_Click(object sender EventArgs e)
{
this.Close();
}
private void btnSave_Click(object sender EventArgs e)
{
try
{
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 9984 2006-06-15 15:56 DBConfigForm.Designer.cs
文件 6019 2006-06-15 15:56 DBConfigForm.resx
文件 6821 2006-06-12 14:01 EchoplexOperationForm.cs
文件 9313 2006-06-12 10:35 EchoplexOperationForm.Designer.cs
文件 5814 2006-06-12 10:35 EchoplexOperationForm.resx
文件 6777 2006-06-09 11:20 GPSSerialPortData.csproj
文件 168 2006-06-09 11:20 GPSSerialPortData.csproj.user
文件 1608 2006-06-26 19:41 GPSSerialPortData.sln
..A..H. 53248 2006-06-27 11:12 GPSSerialPortData.suo
文件 18112 2006-06-27 11:08 MainFrom.cs
文件 13936 2006-06-13 10:16 MainFrom.Designer.cs
文件 13182 2006-06-13 10:16 MainFrom.resx
文件 94208 2006-02-10 16:28 Microsoft.Practices.EnterpriseLibrary.Common.dll
文件 69632 2006-02-10 16:29 Microsoft.Practices.EnterpriseLibrary.Data.dll
文件 61440 2006-02-10 16:28 Microsoft.Practices.ob
文件 3200 2006-06-15 16:03 Program.cs
文件 0 2006-05-29 09:31 ReceiveData.txt
文件 20369 2006-04-25 13:41 SerialLCD.cs
文件 5714 2006-06-13 10:15 SetTimeForm.cs
文件 8721 2006-06-13 10:15 SetTimeForm.Designer.cs
文件 5814 2006-06-13 10:15 SetTimeForm.resx
文件 592 2006-06-07 17:13 TestForm.cs
文件 2038 2006-06-07 16:48 TestForm.Designer.cs
文件 5814 2006-06-07 16:48 TestForm.resx
文件 94208 2006-02-10 16:28 bin\Debug\Microsoft.Practices.EnterpriseLibrary.Common.dll
文件 69632 2006-02-10 16:29 bin\Debug\Microsoft.Practices.EnterpriseLibrary.Data.dll
文件 61440 2006-02-10 16:28 bin\Debug\Microsoft.Practices.ob
文件 0 2006-05-29 09:31 bin\Debug\ReceiveData.txt
文件 675 2006-06-27 10:41 bin\Debug\GPSSerialPortData.exe.config
文件 69632 2006-06-27 11:08 bin\Debug\GPSSerialPortData.exe
............此处省略45个文件信息
相关资源
- Modbus协议官方文档中、英文全
- stm32f407上的两个can发送和接收例程
- 易语言OTG串口通信
- delphi 串口通讯
- STM32蓝牙和串口程序
- LCD显示温度+串口接收温度.rar
- WPF USB 网络 串口 通信软件
- DELPHI与西门子200PLC的串口通信实例
- Verilog FPGA UART串口控制器
- USB转串口驱动,FT232R驱动程序,最新
- msp430F149操作红外接收模块源码
- 武汉大学 科傻GPS 静态后处理软件
- PC -- 单片机的串口数据传输系统设计
- STM32F103 串口程序(完整版)
- stm32 ds18b20 温度传感器 测试通过
- GPRS(MC35型号)的发送短信程序
- PC 串口调试软件
- 51单片机读取温度数据存储到SD卡中并
- 单片机与PC机串口通讯仿真
- 串口调试助手V5.0
- 双串口调试助手 V4.0 _ 可同时调试两个
- 读取串口数据并画实时曲线的VC 程序
- 开源的nmealib
- 网络(UDP)转串口程序
- 串口绘制曲线 将收到的数据进行曲线
- 基于ARM蓝牙传输源程序
- 红外接收头资料(各种品牌的红外接
- 基于8051单片机的红外接收程序
- JS操作本地网页串口源码
- 相干与非相干实现捕获与跟踪GPS
评论
共有 条评论