Changeset 310 in tmcsimulator


Ignore:
Timestamp:
03/13/2019 10:07:54 AM (7 years ago)
Author:
jdalbey
Message:

Fix defect #102. Also add revision number to filenames of deploy jars.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/IDE_metadata/NetBeans/TMCSim/build.xml

    r226 r310  
    176176 
    177177    <!--                   *** Build CAD Server Only Jar ***         --> 
    178       <jar destfile="${deploy.dir}/CADserver.jar" 
     178      <jar destfile="${deploy.dir}/CADserver_r${svna.version}.jar" 
    179179       basedir="${build.dir}/classes" 
    180180       includes="tmcsim/cadsimulator/**, tmcsim/common/**, tmcsim/interfaces/**, 
     
    189189 
    190190      <!--                   *** Build Sim Manager Only Jar ***         --> 
    191       <jar destfile="${deploy.dir}/SimManager.jar" 
     191      <jar destfile="${deploy.dir}/SimManager_r${svna.version}.jar" 
    192192       basedir="${build.dir}/classes" 
    193193       includes="tmcsim/simulationmanager/**, tmcsim/common/**, tmcsim/cadmodels/**, 
     
    201201 
    202202      <!--                   *** Build CAD Client Only Jar ***         --> 
    203       <jar destfile="${deploy.dir}/CADClient.jar" 
     203      <jar destfile="${deploy.dir}/CADClient_r${svna.version}.jar" 
    204204       basedir="${build.dir}/classes" 
    205205       includes="tmcsim/client/**, tmcsim/common/**, tmcsim/interfaces/**, 
     
    215215 
    216216      <!--                   *** Build Clock Client Only Jar ***         --> 
    217       <jar destfile="${deploy.dir}/ClockClient.jar" 
     217      <jar destfile="${deploy.dir}/ClockClient_r${svna.version}.jar" 
    218218       basedir="${build.dir}/classes" 
    219219       includes="tmcsim/client/ClockClient*.class, tmcsim/client/ClockView.class, 
  • trunk/src/tmcsim/application.properties

    r291 r310  
    1 #Sat, 02 Mar 2019 15:51:02 -0800 
     1#Wed, 13 Mar 2019 10:54:57 -0700 
    22 
    3 Application.revision=289 
     3Application.revision=306 
    44 
    5 Application.buildnumber=102 
     5Application.buildnumber=107 
  • trunk/src/tmcsim/cadsimulator/Coordinator.java

    r200 r310  
    500500 
    501501        CADServer.theIncidentMgr.addIncident(newIncident); 
    502  
     502        cadData.addIncident(newIncident); // fixes #102 
    503503        if (simMgr != null) 
    504504        { 
  • trunk/src/tmcsim/client/CADClient.java

    r33 r310  
    287287            theCoorInt.registerForCallback(this); 
    288288        } catch (Exception e) { 
    289             throw new SimulationException(SimulationException.CAD_SIM_CONNECT, 
     289            throw new SimulationException(SimulationException.CAD_SIM_CONNECT,hostname, 
    290290                    e); 
    291291        } 
  • trunk/src/tmcsim/client/cadclientgui/data/CADData.java

    r66 r310  
    155155        incidents = incident; 
    156156    } 
    157  
     157    /** 
     158     * Add a single new incident to the list of incidents. Fixes #102 
     159     * @param incident a single new incident to be added 
     160     * @author jdalbey 
     161     */ 
     162    public void addIncident(Incident incident) 
     163    { 
     164        incidents.add(incident); 
     165    } 
     166     
    158167    /** 
    159168     * Returns the specified unitNum 
  • trunk/src/tmcsim/client/cadclientgui/data/Incident.java

    r59 r310  
    263263 
    264264    public Long getIncidentLength() { 
     265        if (eventList.size() == 0) return 0L; 
    265266        return eventList.lastElement().secondsToOccurInIncident 
    266267                - eventList.firstElement().secondsToOccurInIncident; 
  • trunk/src/tmcsim/client/cadclientgui/screens/IncidentViewer.java

    r288 r310  
    387387    private void saveComment(String commentMsg) 
    388388    { 
    389                 DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy"); 
    390                 DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss"); 
    391                 // prepare fields to be added to comment table 
    392                 String[] fields = 
    393                 { 
    394                     dateFormat.format(new Date()), 
    395                     timeFormat.format(new Date()), 
    396                     ScreenManager.getUserName(), // Put username in "Initials" column 
    397                     "", // "Block" is left blank for now  
    398                     commentMsg 
    399                 }; 
    400                 try 
    401                 { 
    402                     // insert a new row in the comment table 
    403                     ScreenManager.theCoordinator.addCadDataIncidentTable( 
    404                             INC_TABLE.COMMENTS_NOTES, incidentId, fields); 
    405                     ((DefaultTableModel) commentsNotesTable.getModel()).insertRow(0, fields); 
    406                 } catch (RemoteException e) 
    407                 { 
    408                     e.printStackTrace(); 
    409                 } 
    410          
     389        DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy"); 
     390        DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss"); 
     391        // prepare fields to be added to comment table 
     392        String[] fields = 
     393        { 
     394            dateFormat.format(new Date()), 
     395            timeFormat.format(new Date()), 
     396            ScreenManager.getUserName(), // Put username in "Initials" column 
     397            "", // "Block" is left blank for now  
     398            commentMsg 
     399        }; 
     400        try 
     401        { 
     402            // insert a new row in the comment table 
     403            ScreenManager.theCoordinator.addCadDataIncidentTable( 
     404                    INC_TABLE.COMMENTS_NOTES, incidentId, fields); 
     405            ((DefaultTableModel) commentsNotesTable.getModel()).insertRow(0, fields); 
     406        } catch (RemoteException e) 
     407        { 
     408            e.printStackTrace(); 
     409        } 
    411410    } 
    412     // JD Add a mouselistener to the comments table to display a single cell 
    413     //  contents in a popup 
    414 //    public MouseListener newCommentsTableCellListener() 
    415 //    { 
    416 //        return new MouseListener() 
    417 //        { 
    418 //            public void mousePressed(MouseEvent event) 
    419 //            { 
    420 //            } 
    421 // 
    422 //            public void mouseReleased(MouseEvent event) 
    423 //            { 
    424 //            } 
    425 // 
    426 //            public void mouseEntered(MouseEvent event) 
    427 //            { 
    428 //            } 
    429 // 
    430 //            public void mouseExited(MouseEvent event) 
    431 //            { 
    432 //            } 
    433 // 
    434 //            public void mouseClicked(MouseEvent event) 
    435 //            { 
    436 //                Point point = event.getPoint(); 
    437 //                int row, column; 
    438 //                row = commentsNotesTable.rowAtPoint(point); 
    439 //                column = commentsNotesTable.columnAtPoint(point); 
    440 //                // See if the click was in column 4 (the comment column) 
    441 //                if (column == 4) 
    442 //                { 
    443 //                    JOptionPane.showMessageDialog(null, getWrappedText((String) commentsNotesTable.getValueAt(row, column)), 
    444 //                            "Comment/Note Text", JOptionPane.INFORMATION_MESSAGE); 
    445 //                } 
    446 // 
    447 //            } 
    448 //        }; 
    449 //    } 
     411 
    450412    private void initControllers() 
    451413    { 
     
    461423    } 
    462424 
    463     /** 
    464      * A custom renderer that sets a tool tip with the wrapped comment. JD 
    465      */ 
    466 // Obsolete JD 
    467 //    class LineWrapRenderer extends DefaultTableCellRenderer 
    468 //    { 
    469 //        public final static int kSegmentsize = 60; 
    470 // 
    471 //        protected void setValue(Object value) 
    472 //        { 
    473 //            String comment = (String) value; 
    474 //            setText(comment); 
    475 //            // Wrap long comments in a tooltip 
    476 //            setToolTipText(getWrappedText(comment)); 
    477 //        } 
    478 //    } 
    479 // 
    480 //    private String getWrappedText(String stringToWrap) 
    481 //    { 
    482 //        int limit = stringToWrap.length() / LineWrapRenderer.kSegmentsize; 
    483 //        StringBuilder toolTip = new StringBuilder("<html>"); 
    484 //        for (int jumper = 0; jumper <= limit; jumper++) 
    485 //        { 
    486 //            toolTip.append(stringToWrap.substring(jumper * LineWrapRenderer.kSegmentsize, Math.min((jumper + 1) * LineWrapRenderer.kSegmentsize, stringToWrap.length()))); 
    487 //            toolTip.append("<br>");  // Use html break to cause a line break 
    488 //        } 
    489 //        toolTip.append("</html>"); 
    490 //        return toolTip.toString(); 
    491 //    } 
    492425    private void initLayout() 
    493426    { 
  • trunk/src/tmcsim/common/SimulationException.java

    r2 r310  
    1919     * Error Message: "Unable to connect to the CAD Simulator." 
    2020     */ 
    21     public static final String CAD_SIM_CONNECT = "Unable to connect to the CAD Simulator."; 
     21    public static final String CAD_SIM_CONNECT = "Unable to connect to the CAD Server. "+ 
     22            "Check that server is running at "; 
    2223     
    2324    /**  
     
    2526     * Error Message: "Unable to communicate with the CAD Simulator." 
    2627     */ 
    27     public static final String CAD_SIM_COMM = "Unable to communicate with the CAD Simulator."; 
     28    public static final String CAD_SIM_COMM = "Unable to communicate with the CAD Server."; 
    2829     
    2930    /**  
     
    5051     * Error Message: "Unable to connect to the CAD Simulator." 
    5152     */ 
    52     public static final String NULL_VIEW = "Unable to connect to the CAD Simulator."; 
     53    public static final String NULL_VIEW = "Unable to connect to the CAD Server."; 
    5354         
    5455    /** 
Note: See TracChangeset for help on using the changeset viewer.