示例#1
0
        private void button_Copy3_Click(object sender, RoutedEventArgs e)
        {
            var port = CreateSerialPort();

            if (port != null)
            {
                Core.AddSerialPort(port);

                Dictionary <string, string> dics = new Dictionary <string, string>();
                var view = new SerialPortView(port, dics);
                view.Title = $"模拟光电({port.PortName})";

                view.Show();
            }
        }
示例#2
0
        /// <summary>
        /// 称重
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button_Copy_Click(object sender, RoutedEventArgs e)
        {
            var port = CreateSerialPort();

            if (port != null)
            {
                Core.AddSerialPort(port);

                Dictionary <string, string> dics = new Dictionary <string, string>();
                dics.Add("02 33 17 47 44 17 30 30 30 30 17 43 33 03", "02 33 17 47 44 17 06 17 30 30 31 36 17 30 30 30 32 17 30 30 31 30 17 1E 00 17 30 31 17 36 39 03");

                var view = new SerialPortView(port, dics);
                view.Title = $"模拟称重({port.PortName})";

                view.Show();
            }
        }
示例#3
0
        /// <summary>
        /// 速度
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button_Click(object sender, RoutedEventArgs e)
        {
            var port = CreateSerialPort();

            if (port != null)
            {
                Core.AddSerialPort(port);

                Dictionary <string, string> dics = new Dictionary <string, string>();
                dics.Add("02 31 17 4C 44 17 30 30 30 30 17 43 36 03", "02 31 17 4C 44 17 06 17 30 30 30 30 17 31 30 03 ");
                dics.Add("02 31 17 47 44 17 30 30 30 30 17 43 31 03", "02 31 17 47 44 17 06 17 30 30 31 30 17 30 30 30 2E 30 30 17 00 00 17 34 33 03");
                dics.Add("02 31 17 4C 55 17 30 30 30 30 17 47 37 03", "02 31 17 4C 55 17 06 17 30 30 30 30 17 32 37 03 ");

                var view = new SerialPortView(port, dics);
                view.Title = $"模拟速度({port.PortName})";

                view.Show();
            }
        }