资源简介
此源码可以直接运行,示例如何接收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个文件信息
相关资源
- ST16C554扩展串口驱动程序
- 16*16点阵LED串口在线控制程序
- 串口调试助手V2.1,ModbusV1,BitBoy
- 串口读数据采集仪数据demo
- USR-TCP232-Test.exe
- 串口和网口调试助手
- qt gps 定位系统源代码
- 空间大地测量与GPS导航定位时间系统
- 用PIC汇编写的,有接收和发送程序.
- 单片机与单片机之间串口通信,注释
- CC2530协调器源代码
- 一个简单的 QT5编写的 串口工具代码
- 基于pic16f1947 和ADM2483、rs485电路发送接
- 基于zigbee的串口通信
- 树莓派 Ubuntu mate16.04 2个usb转串口互相
- 串口调试精灵 V1.023
- Xzhi_socket接收与发送图片(终结者)
- GM65之51单片机(串口+显示屏)程序
- 部标GPS车载终端上线指令集
- GPS及GPS接收机简介
- labview串口接收和波形显示,还有存储
- RAIM GPS接收机自主完好性监测算法
- C3-470B模块资料
- MTTTY (Multi-Threaded TTY)
- 串口JPEG格式图片上位机软件
- STM32F407 串口通讯
- Linux下串口数据发送程序
- 通过串口和51单片机控制舵机转动有
- 串口调试工具sscom5.11
- 蚁群算法 Ant_clony_of_alogrithm
评论
共有 条评论