Changeset 210

Show
Ignore:
Timestamp:
04/09/11 11:29:12 (14 months ago)
Author:
stefan
Message:

implemented issue #252: rename all occurrences of "COM port" to "serial port"

Location:
trunk
Files:
10 modified
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/CHANGELOG

    r209 r210  
    55* [stefan]  * fixed bug #182: JErgometer wants to update even if it's a bleeding edge version 
    66            * implemented issue #247: display error message when JErgometer is started without RXTX library 
     7            * implemented issue #252: rename all occurrences of "COM port" to "serial port" 
    78 
    89== 0.7.11 == 
  • trunk/src/org/jergometer/communication/BikeConnectionTester.java

    r88 r210  
    5050          try { 
    5151            if(portId.isCurrentlyOwned()) { 
    52               System.out.println("COM port is currently owned by another application!"); 
     52              System.out.println("Serial port is currently owned by another application!"); 
    5353            } 
    5454            serialPort = (SerialPort) portId.open("BikeConnector", 2000); 
  • trunk/src/org/jergometer/communication/BikeConnectorSerial.java

    r209 r210  
    4949// dynamic 
    5050 
    51   private String serialName; 
    5251  private SerialPort serialPort; 
    5352  private BikeReader reader = null; 
     
    5958 
    6059  public void connect(String serialName) throws BikeException, UnsupportedCommOperationException, IOException { 
    61     this.serialName = serialName; 
    62  
    6360    Enumeration portList = CommPortIdentifier.getPortIdentifiers(); 
    6461 
     
    6966        if(portId.getName().equals(serialName)) { 
    7067          if(portId.isCurrentlyOwned()) { 
    71             throw new BikeException(I18n.getString("msg.com_port_used_by_the_following_application", portId.getCurrentOwner())); 
     68            throw new BikeException(I18n.getString("msg.serial_port_used_by_the_following_application", portId.getCurrentOwner())); 
    7269          } 
    7370          try { 
    7471            serialPort = (SerialPort) portId.open("JErgometer", 2000); 
    7572          } catch (PortInUseException e) { 
    76             throw new BikeException(I18n.getString("msg.com_port_used_by_the_following_application", portId.getCurrentOwner())); 
     73            throw new BikeException(I18n.getString("msg.serial_port_used_by_the_following_application", portId.getCurrentOwner())); 
    7774          } 
    7875 
  • trunk/src/org/jergometer/communication/BikeException.java

    r94 r210  
    44 
    55/** 
    6  * Special IO exception related to the COM port connection to the ergometer. 
     6 * Special IO exception related to the serial port connection to the ergometer. 
    77 */ 
    88public class BikeException extends Exception { 
  • trunk/src/org/jergometer/communication/UnconfiguredSerialPortException.java

    r94 r210  
    22 
    33/** 
    4  * Unconfigured COM port exception. 
     4 * Unconfigured serial port exception. 
    55 */ 
    6 public class UnconfiguredComPortException extends Exception { 
    7   public UnconfiguredComPortException() { 
    8     super("The COM port has not been configured yet."); 
     6public class UnconfiguredSerialPortException extends Exception { 
     7  public UnconfiguredSerialPortException() { 
     8    super("The serial port has not been configured yet."); 
    99  } 
    1010} 
  • trunk/src/org/jergometer/gui/SettingsWindow.form

    r126 r210  
    2222            </constraints> 
    2323            <properties> 
    24               <text resource-bundle="org/jergometer/translation/jergometer" key="settings.com_port"/> 
     24              <text resource-bundle="org/jergometer/translation/jergometer" key="settings.serial_port"/> 
    2525            </properties> 
    2626          </component> 
  • trunk/src/org/jergometer/gui/SettingsWindow.java

    r209 r210  
    4646    panel1.setBorder(BorderFactory.createTitledBorder(ResourceBundle.getBundle("org/jergometer/translation/jergometer").getString("label.global_settings"))); 
    4747    final JLabel label1 = new JLabel(); 
    48     this.$$$loadLabelText$$$(label1, ResourceBundle.getBundle("org/jergometer/translation/jergometer").getString("settings.com_port")); 
     48    this.$$$loadLabelText$$$(label1, ResourceBundle.getBundle("org/jergometer/translation/jergometer").getString("settings.serial_port")); 
    4949    gbc = new GridBagConstraints(); 
    5050    gbc.gridx = 0; 
     
    296296    updatePortsButton.addActionListener(new ActionListener() { 
    297297      public void actionPerformed(ActionEvent e) { 
    298         updateComPorts(null); 
     298        updateSerialPorts(null); 
    299299      } 
    300300    }); 
     
    316316          @Override 
    317317          public void run() { 
    318             testComPort(settingsWindow); 
     318            testSerialPort(settingsWindow); 
    319319          } 
    320320        }.start(); 
     
    339339  } 
    340340 
    341   private void testComPort(final SettingsWindow settingsWindow) { 
     341  private void testSerialPort(final SettingsWindow settingsWindow) { 
    342342    BikeConnectionTester bikeConnectionTester = new BikeConnectionTester(settingsWindow, comPortComboBox.getSelectedItem().toString()); 
    343343    String id = bikeConnectionTester.test(); 
     
    356356   */ 
    357357  public ReturnCode showDialog(JergometerSettings settings) { 
    358     updateComPorts(settings); 
     358    updateSerialPorts(settings); 
    359359 
    360360    if (settings != null) { 
     
    372372  } 
    373373 
    374   private void updateComPorts(JergometerSettings settings) { 
     374  private void updateSerialPorts(JergometerSettings settings) { 
    375375    String comPort = null; 
    376376    if (settings != null) { 
    377       comPort = settings.getComPort(); 
     377      comPort = settings.getSerialPort(); 
    378378    } 
    379379    int comPortIndex = -1; 
     
    413413  public void saveSettings(JergometerSettings settings) { 
    414414    settings.setCheckForUpdatesOnStart(checkForUpdatesOnStartCheckBox.isSelected()); 
    415     settings.setComPort((String) comPortComboBox.getSelectedItem()); 
     415    settings.setSerialPort((String) comPortComboBox.getSelectedItem()); 
    416416    settings.setXmlEditor(xmlEditorTextField.getText()); 
    417417  } 
  • trunk/src/org/jergometer/Jergometer.java

    r209 r210  
    188188  /** 
    189189   * Connects to the serial port. 
    190    */ 
    191   private void connectToSerialPort() throws BikeException, UnsupportedCommOperationException, IOException, UnconfiguredComPortException { 
    192     String comPort = jergometerSettings.getComPort(); 
     190   * 
     191   * @throws gnu.io.UnsupportedCommOperationException if communication operation is not supported 
     192   * @throws java.io.IOException if an I/O error occurs 
     193   * @throws org.jergometer.communication.BikeException if the bike communication fails 
     194   * @throws org.jergometer.communication.UnconfiguredSerialPortException if the serial port is not configured yet 
     195   */ 
     196  private void connectToSerialPort() throws BikeException, UnsupportedCommOperationException, IOException, UnconfiguredSerialPortException { 
     197    String comPort = jergometerSettings.getSerialPort(); 
    193198    if (comPort == null) { 
    194       throw new UnconfiguredComPortException(); 
     199      throw new UnconfiguredSerialPortException(); 
    195200    } 
    196201    bikeConnector = new BikeConnectorSerial(comPort); 
     
    360365        JOptionPane.showMessageDialog(mainWindow, e.getMessage(), I18n.getString("error_dialog.title"), JOptionPane.ERROR_MESSAGE); 
    361366        return; 
    362       } catch (UnconfiguredComPortException e) { 
     367      } catch (UnconfiguredSerialPortException e) { 
    363368        e.printStackTrace(); 
    364369        JOptionPane.showMessageDialog(mainWindow, I18n.getString("msg.configure_comport_first")); 
     
    480485    for (BikeSession selectedSession : selectedSessions) { 
    481486      this.userData.getSessions().remove(selectedSession); 
     487      //noinspection ResultOfMethodCallIgnored 
    482488      selectedSession.getFile().delete(); 
    483489    } 
     
    490496   * 
    491497   * @param bikeSession bike session 
     498   * @throws java.io.IOException if an I/O error occurs 
    492499   */ 
    493500  private void visualizeBikeSession(BikeSession bikeSession) throws IOException { 
  • trunk/src/org/jergometer/JergometerSettings.java

    r187 r210  
    1515 * Jergometer settings. 
    1616 */ 
     17@SuppressWarnings({"ResultOfMethodCallIgnored"}) 
    1718public class JergometerSettings { 
    1819 
     
    4748  private ArrayList<String> userNames = new ArrayList<String>(); 
    4849  private String lastUserName; 
    49   private String comPort; 
     50  private String serialPort; 
    5051  private String xmlEditor; 
    5152 
     
    138139 
    139140    lastUserName = properties.getString("last_user"); 
    140     comPort = properties.getString("comport"); 
     141    serialPort = properties.getString("comport"); 
    141142    xmlEditor = properties.getString("xml_editor"); 
    142143 
     
    152153        if (users != null) lastUserName = users.getAttribute("lastUser"); 
    153154        XMLElement comport = root.getChildElement("comport"); 
    154         if (comport != null) comPort = comport.getAttribute("name"); 
     155        if (comport != null) serialPort = comport.getAttribute("name"); 
    155156        XMLElement xmlEditor = root.getChildElement("xmlEditor"); 
    156157        if (xmlEditor != null) this.xmlEditor = xmlEditor.getAttribute("name"); 
     
    174175 
    175176    properties.setString("last_user", lastUserName); 
    176     properties.setString("comport", comPort); 
     177    properties.setString("comport", serialPort); 
    177178    properties.setString("xml_editor", xmlEditor); 
    178179 
     
    241242  } 
    242243 
    243   public String getComPort() { 
    244     return comPort; 
    245   } 
    246  
    247   public void setComPort(String comPort) { 
    248     this.comPort = comPort; 
     244  public String getSerialPort() { 
     245    return serialPort; 
     246  } 
     247 
     248  public void setSerialPort(String serialPort) { 
     249    this.serialPort = serialPort; 
    249250  } 
    250251 
  • trunk/src/org/jergometer/translation/jergometer_de.properties

    r209 r210  
    8989  </html> 
    9090label.global_settings=Globale Einstellungen 
    91 settings.com_port=COM-Port: 
    92 settings.enter_port_name=Lass mich den Namen eingeben 
    93 settings.update_ports=Aktualisieren 
    94 settings.test_port=Testen 
     91settings.serial_port=Serial-Port: 
     92settings.enter_port_name=Lass mich den Namen &eingeben 
     93settings.update_ports=Akt&ualisieren 
     94settings.test_port=&Testen 
    9595settings.update=Update: 
    96 settings.check_for_updates_on_start=Suche nach neuen Versionen beim Start 
    97 label.save=Speichern 
    98 label.abort=Abbrechen 
     96settings.check_for_updates_on_start=Suche beim Start nach neuen &Versionen von JErgometer 
     97label.save=&Speichern 
     98label.abort=&Abbrechen 
    9999settings_dialog.title=JErgometer-Einstellungen 
    100 msg.configure_comport_first=Bitte geben Sie zunächst den COM-Port zur Datenübertragung an! 
     100msg.configure_comport_first=Bitte konfigurieren Sie zunächst den seriellen Port für die Kommunikation mit dem Ergometer! 
    101101msg.not_implemented_yet=Diese Funktion ist noch nicht implementiert. 
    102102menu.sessions.delete_selected=Lösche selektierte 
     
    109109choose_new_program_dialog.explanation=Dies könnte durch die Löschung oder Umbenennung von Trainingsprogrammen entstanden sein. Falls es sich nur um eine Umbenennung handelt, können Sie den betroffenen Sitzungen nun das zugehörige Programm zuweisen. 
    110110choose_new_program_dialog.title=Neues Programm auswählen 
    111 msg.connection_failed=Verbindung zum Ergometer fehlgeschlagen! Weitere Informationen finden Sie im Konsolenfenster.\nUm das Problem zu beheben, sollten Sie Ihre COM-Port-Konfiguration (siehe Einstellungen) überprüfen. 
     111msg.connection_failed=Verbindung zum Ergometer fehlgeschlagen! Weitere Informationen finden Sie im Konsolenfenster.\nUm das Problem zu beheben, sollten Sie Ihre Serial-Port-Konfiguration (siehe Einstellungen) überprüfen. 
    112112connection_tester.testing_connection_to_ergometer=Teste Verbindung zum Ergometer... 
    113113connection_tester.connection_successful=Verbindung zum Ergometer war erfolgreich! (ID=%s) 
     
    116116connection_tester.wait_for_reset_finished=Warte auf Reset-Ende 
    117117connection_tester.retrieving_ergometer_id=Hole Ergometer-ID 
    118 msg.com_port_used_by_the_following_application=Der COM-Port wird derzeit von der Anwendung "%s" genutzt! 
     118msg.serial_port_used_by_the_following_application=Der serielle Port wird derzeit von der Anwendung "%s" genutzt! 
    119119msg.unsatisfied_link_error=JErgometer konnte leider nicht die Serial-Port-Bibliothek für Ihr Betriebssystem laden.\nBitte melden Sie das Problem dem Entwickler, indem Sie ihm eine Mail schreiben oder auf jergometer.org ein einen Fehlerbericht (neues Ticket) verfassen.\nVergessen Sie dabei bitte nicht, Ihr Betriebsystem und die Fehlerausschriften im Konsolenfenster anzugeben. Danke. 
    120120error_dialog.title=Fehler! 
     
    144144main_window.title=JErgometer %s 
    145145label.xml_editor=XML-Editor: 
    146 label.file_choosing=>>> 
     146label.file_choosing=&>>> 
    147147msg.error_during_execution_of=Fehler während der Ausführung von "%s"! 
    148148msg.could_not_open_xml_editor=XML-Editor konnte nicht geöffnet werden 
  • trunk/src/org/jergometer/translation/jergometer.properties

    r209 r210  
    6868about_dialog.text=<html><head><style>body { color: #000000; }th { text-align: left; }.vm { font-size:8px; margin-left: 10px; margin-top: 6px; } </style></head><body><br><br><table><tr><th>Version:</th><td>%1s</td></tr><tr><th>Website:</th><td>www.jergometer.org</td></tr><tr><th>Authors:</th><td>Stefan Endrullis,</td></tr><tr><th></th><td>Jörg Endrullis</td></tr><tr><th>License:</th><td>GPLv2</td></tr><tr><th>Java Version:</th><td>%2s</td></tr></table> <div class="vm">%3s</div></body></html> 
    6969label.global_settings=Global Settings 
    70 settings.com_port=COM port: 
    71 settings.enter_port_name=Let me enter the port name 
    72 settings.update_ports=Update 
    73 settings.test_port=Test 
     70settings.serial_port=Serial port: 
     71settings.enter_port_name=Let me &enter the port name 
     72settings.update_ports=&Update 
     73settings.test_port=&Test 
    7474settings.update=Update: 
    75 settings.check_for_updates_on_start=Check for updates on start 
    76 label.save=Save 
    77 label.abort=Abort 
     75settings.check_for_updates_on_start=&Check for updates on start 
     76label.save=&Save 
     77label.abort=&Abort 
    7878settings_dialog.title=JErgometer settings 
    79 msg.configure_comport_first=Please configure the COM port first! 
     79msg.configure_comport_first=Please configure the serial port first! 
    8080msg.not_implemented_yet=This function is not implemented yet. 
    8181menu.sessions.delete_selected=Delete selected 
     
    8888label.skip=Skip 
    8989choose_new_program_dialog.title=Choose a new program 
    90 msg.connection_failed=Connection to ergometer failed! See console output for additional information.\nTo solve this problem take a look at your COM port configuration (see settings). 
     90msg.connection_failed=Connection to ergometer failed! See console output for additional information.\nTo solve this problem take a look at your serial port configuration (see settings). 
    9191connection_tester.testing_connection_to_ergometer=Testing connection to ergometer... 
    9292connection_tester.connection_successful=Connection to ergoemter was successful! (ID=%s) 
     
    9595connection_tester.wait_for_reset_finished=Waiting for reset finished 
    9696connection_tester.retrieving_ergometer_id=Retrieving ergometer id 
    97 msg.com_port_used_by_the_following_application=COM port is currently owned by application "%s"! 
     97msg.serial_port_used_by_the_following_application=Serial port is currently owned by application "%s"! 
    9898msg.unsatisfied_link_error=JErgometer could not load the serial port library for your operating system.\nPlease file a bug report on jergometer.org and include the console output and the info which OS you are using. Thanks. 
    9999error_dialog.title=Error! 
     
    123123main_window.title=JErgometer %s 
    124124label.xml_editor=XML editor: 
    125 label.file_choosing=>>> 
     125label.file_choosing=&>>> 
    126126msg.error_during_execution_of=Error during execution of "%s"! 
    127127msg.could_not_open_xml_editor=Could not open XML editor