类 SerialPortTool

java.lang.Object
javafx.application.Application
com.tlcsdm.frame.SampleBase
com.tlcsdm.qe.QeSample
com.tlcsdm.qe.tools.SerialPortTool
所有已实现的接口:
Sample, javafx.fxml.Initializable

public class SerialPortTool extends QeSample implements javafx.fxml.Initializable
串口助手
从以下版本开始:
1.0.0
作者:
unknowIfGuestInDream
  • 字段详细资料

    • serPort

      private javafx.scene.control.ComboBox<com.fazecast.jSerialComm.SerialPort> serPort
    • serPortSpeed

      private javafx.scene.control.ComboBox<String> serPortSpeed
    • serPortCheckBit

      private javafx.scene.control.ComboBox<String> serPortCheckBit
    • serPortDataBit

      private javafx.scene.control.ComboBox<String> serPortDataBit
    • serPortStopBit

      private javafx.scene.control.ComboBox<String> serPortStopBit
    • serFlowControl

      private javafx.scene.control.ComboBox<String> serFlowControl
    • serPortOpenBtn

      private javafx.scene.control.Button serPortOpenBtn
    • recvShowHex

      private javafx.scene.control.CheckBox recvShowHex
    • recvShowTime

      private javafx.scene.control.CheckBox recvShowTime
    • recvStopShow

      private javafx.scene.control.CheckBox recvStopShow
    • recvClear

      private javafx.scene.control.Button recvClear
    • sendHex

      private javafx.scene.control.CheckBox sendHex
    • sendCycle

      private javafx.scene.control.CheckBox sendCycle
    • sendCycleRap

      private javafx.scene.control.TextField sendCycleRap
    • sendClear

      private javafx.scene.control.Button sendClear
    • sendCount

      private javafx.scene.control.Label sendCount
    • recvCount

      private javafx.scene.control.Label recvCount
    • CountReset

      private javafx.scene.control.Button CountReset
    • sendTextAear

      private javafx.scene.control.TextArea sendTextAear
    • recvTextAear

      private javafx.scene.control.TextArea recvTextAear
    • sendBtn

      private javafx.scene.control.Button sendBtn
    • circularSending

      private final javafx.animation.Timeline circularSending
    • waitTime

      private volatile long waitTime
    • cellFactory

      javafx.util.Callback<javafx.scene.control.ListView<com.fazecast.jSerialComm.SerialPort>,javafx.scene.control.ListCell<com.fazecast.jSerialComm.SerialPort>> cellFactory
  • 构造器详细资料

    • SerialPortTool

      public SerialPortTool()
  • 方法详细资料

    • getPanel

      public javafx.scene.Node getPanel(javafx.stage.Stage stage)
      从接口复制的说明: Sample
      Returns the main sample panel.
      指定者:
      getPanel 在接口中 Sample
    • main

      public static void main(String[] args)
    • getSampleId

      public String getSampleId()
      从接口复制的说明: Sample
      组件id.
      指定者:
      getSampleId 在接口中 Sample
    • getSampleName

      public String getSampleName()
      从接口复制的说明: Sample
      A short, most likely single-word, name to show to the user - e.g. "CheckBox".
      指定者:
      getSampleName 在接口中 Sample
    • getOrderKey

      public String getOrderKey()
      从接口复制的说明: Sample
      排序字段.
      指定者:
      getOrderKey 在接口中 Sample
    • getSampleDescription

      public String getSampleDescription()
      从类复制的说明: SampleBase
      A short, multiple sentence description of the sample.
      指定者:
      getSampleDescription 在接口中 Sample
      覆盖:
      getSampleDescription 在类中 SampleBase
    • getSampleVersion

      public String getSampleVersion()
      从接口复制的说明: Sample
      sample version.
      指定者:
      getSampleVersion 在接口中 Sample
    • hasControlPanel

      public boolean hasControlPanel()
      从接口复制的说明: Sample
      是否有右侧区域.
      指定者:
      hasControlPanel 在接口中 Sample
      覆盖:
      hasControlPanel 在类中 SampleBase
    • isVisible

      public boolean isVisible()
      从类复制的说明: SampleBase
      If true this sample is shown to users, if false it is not.
      指定者:
      isVisible 在接口中 Sample
      覆盖:
      isVisible 在类中 SampleBase
    • initialize

      public void initialize(URL location, ResourceBundle resources)
      指定者:
      initialize 在接口中 javafx.fxml.Initializable
    • getSampleImageIcon

      public javafx.scene.image.ImageView getSampleImageIcon()
      设置断开连接按钮点击时的事件处理器: 断开串口连接
      指定者:
      getSampleImageIcon 在接口中 Sample
      覆盖:
      getSampleImageIcon 在类中 SampleBase
    • initializeUI

      public void initializeUI()
    • initializeBindings

      public void initializeBindings()
      从类复制的说明: SampleBase
      将在getPanel要设置的binding提取出来.
      覆盖:
      initializeBindings 在类中 SampleBase
    • initializeUserDataBindings

      public void initializeUserDataBindings()
      从类复制的说明: SampleBase
      将在getPanel要设置的userData binding提取出来.
      覆盖:
      initializeUserDataBindings 在类中 SampleBase
    • dispose

      public void dispose()
      从接口复制的说明: Sample
      Provides a place to dispose of any resources when sample is deselected.
      指定者:
      dispose 在接口中 Sample
      覆盖:
      dispose 在类中 SampleBase
    • findPorts

      private List<String> findPorts()
      获得当前计算机所有的串口的名称列表
      返回:
      串口名称列表
    • openPort

      private com.fazecast.jSerialComm.SerialPort openPort(String portName, int baudRate)
      打开串口
      参数:
      portName - 端口名称
      baudRate - 波特率
      返回:
      串口对象
    • readFromPort

      private byte[] readFromPort(com.fazecast.jSerialComm.SerialPort serialPort)
      从串口读取数据
      参数:
      serialPort - 当前已建立连接的SerialPort对象
      返回:
      读取到的数据
    • hexStringToBytes

      private byte[] hexStringToBytes(String hexString) throws Exception
      抛出:
      Exception
    • charToByte

      private byte charToByte(char c) throws Exception
      Convert char to byte
      参数:
      c - char
      返回:
      byte
      抛出:
      Exception
    • bytesToHexString

      public String bytesToHexString(byte[] bArray)