基于c#的工控软件版本v1.03_11.25(附源代码工程下载地址)

本文介绍了一款基于C#开发的工控软件,结合Securet的串口保存机制和传统调试助手,解决串口关闭和16进制显示问题。提供了百度云盘和115网盘的源代码下载链接,鼓励用户试用并提供反馈。软件包含串口配置、数据接收、16进制显示等功能。
摘要由CSDN通过智能技术生成

最近打算用c#做点实事,原来一直都在用串口调试,打算开发一种结合securt的串口保存机制及传统调试助手的便携串口配置模式的软件。今天发出第一个版本,这段时间慢慢积累打算把这个软件网上起来。

今天解决了串口关闭问题,及串口接收16进制显示的问题。

由于这里不能放置源代码压缩包。

源代码我放在百度云盘及115网盘了,大家可以下载试用,并提报告意见:

http://pan.baidu.com/share/link?shareid=3114178268&uk=588847378

源代码见如下链接

http://115.com/lb/5lbdpjgwemqt


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using System.IO.Ports;
using System.Threading;


namespace ComAssistant1
{
    public partial class Form1 : Form
    {
        public enum LogMsgType { Incoming, Outgoing, Normal, Warning, Error };
        public enum DataMode { Text, Hex }
        private Color[] LogMsgTypeColor = { Color.Orange, Color.Green, Color.Black, Color.Blue, Color.Red };
        /// 准备关闭串口=true
        /// </summary>
        private bool m_IsTryToClosePort = false;
        /// <summary>
        /// true表示正在接收数据
        /// </summary>
        private bool m_IsReceiving = false;
       
        public Form1()
        {
            InitializeComponent();


        }
        Mutex m_Mutex = null;//锁
        bool flag;
        private void Form1_Load(object sender, EventArgs e)
        {
            //判断串口打开或关闭
            if (serialPort1.IsOpen)
            {
                serialPort1.Close();
                pictureBox1.Image = Image.FromFile("E:\\C#\\图标\\PNG\\20091007130906335.png");
            }
            else
            {
                pictureBox1.Image = Image.FromFile("E:\\C#\\图标\\PNG\\20091007130902885.png");
            }
            RefrespictureBox1();


            int ii = 0;
            foreach (string s in SerialPort.GetPortNames())
            {
                if (ii >= 1)
                {
                    comboBox1.Items.Add(s);
                }
                ii++;
            }


            if (SerialPort.GetPortNames().Length != 0)
            {
                comboBox1.Text = (string)comboBox1.Items[0];
            }


            string[] ss = new string[] { "9600", "19200", "57600", "115200" };
            comboBox2.DataSource = ss;


            comboBox3.DataSource = Enum.GetNames(typeof(Parity));


            ss = new string[] { "5", "6", "7", "8" };
            comboBox4.DataSource = ss;
            comboBox4.Text = "8";


            comboBox5.DataSource = Enum.GetNames(typeof(StopBits));
            comboBox5.Text = Enum.Format(typeof(StopBits), StopBits.One, "G");

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值