Changeset 432 in tmcsimulator for trunk/src/tmcsim


Ignore:
Timestamp:
07/07/2019 11:13:00 AM (7 years ago)
Author:
jdalbey
Message:

CADlogDisplay updated. jar target added for CADlogDisplay. "Log Entries" changed to "CAD Log Entries" in Sim Mgr panel.

Location:
trunk/src/tmcsim
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/application.properties

    r425 r432  
    1 #Mon, 24 Jun 2019 18:00:23 -0700 
     1#Sun, 07 Jul 2019 11:28:33 -0700 
    22 
    3 Application.revision=424 
     3Application.revision=431 
    44 
    5 Application.buildnumber=142 
     5Application.buildnumber=145 
  • trunk/src/tmcsim/cadsimulator/Coordinator.java

    r416 r432  
    116116    private static SimulationManagerInterface simMgr = null; 
    117117    private static LinkedList<CADClientInterface> clientList; 
     118    /** 'database' of cad Data shared by all clients and the sim mgr */ 
    118119    private static CADData cadData; 
     120    /** The 'rolodex' of contact info */ 
    119121    private static CardfileData cardfileData; 
     122    /** The model for the state of the CAD Server */ 
    120123    private CADSimulatorState cadModel; 
    121124     
  • trunk/src/tmcsim/client/CADlogDisplay.java

    r425 r432  
    44import java.awt.event.ActionListener; 
    55import java.io.FileInputStream; 
     6import java.io.FileWriter; 
     7import java.io.PrintWriter; 
    68import java.rmi.Naming; 
    79import java.rmi.RemoteException; 
     
    3840    private static Logger cadClientLogger = Logger.getLogger("tmcsim.client"); 
    3941 
    40     @Override 
    41     public void refresh() throws RemoteException 
    42     { 
    43         throw new UnsupportedOperationException("Not supported yet."); 
    44     } 
     42    private static final String CONFIG_FILE_NAME = "cad_client_config.properties"; 
     43    private static final String LOG_FILE_NAME = "CADcomments.log"; 
     44    private final static int TEN_SECONDS = 10000; 
    4545 
    4646    /** 
     
    8282     */ 
    8383    private CADClientInterface client = this; 
    84     private static final String CONFIG_FILE_NAME = "cad_client_config.properties"; 
    85     private final static int TEN_SECONDS = 10000; 
     84    /* 
     85     * PrintWriter handle for sending log to a file  
     86     */ 
     87    private PrintWriter writer; 
    8688 
    8789    /** 
     
    103105                cadClientProp.getProperty(PROPERTIES.CAD_RMI_PORT.name).trim()); 
    104106 
    105         //theView = new ClockView(); 
    106         //theView.setVisible(true); 
    107  
    108107        // Create a timer that fetches the simulation time every second. 
    109108        Timer timer = new Timer(TEN_SECONDS, new ActionListener() 
    110109        { 
    111             public void actionPerformed(ActionEvent e) 
     110            public void actionPerformed(ActionEvent evt) 
    112111            { 
    113112                try 
    114113                { 
    115114                    Vector<Incident> incList = theCoorInt.getIncidentList();  
    116                     StringBuffer sb = new StringBuffer(); 
     115                    StringBuffer output = new StringBuffer(); 
    117116 
    118117                    for (Incident incident: incList) 
     
    120119                    // DefaultTableModel noteTable = (DefaultTableModel) theCoorInt.getCadDataIncidentTable(INC_TABLE.COMMENTS_NOTES, incident.getLogNum()); 
    121120                     // Output noteTable 
    122                         sb.append("Incident # " + incident.logNum + "\n"); 
    123121                        // Retrieve the table of comments/notes the users created 
    124122                        DefaultTableModel notesTable = incident.getCommentsNotesTable(); 
     
    127125                        { 
    128126                            // Combine the fields into one export entry 
    129                             sb.append(notesTable.getValueAt(row,1) + " "); // time 
    130                             String initials = (String) notesTable.getValueAt(row,2); // initials 
     127                            //sb.append(notesTable.getValueAt(row,1) + " "); // time 
     128                            String initials = (String) notesTable.getValueAt(row,2); // user initials 
    131129                            // If there are user intials, include this item. 
    132                             // Zero length initials mean it's a scripted item 
     130                            // Zero length initials mean it's a scripted item, ignore it. 
    133131                            if (initials.length() > 0) 
    134                             { 
    135                                 sb.append(initials + " "); 
    136                                 sb.append(notesTable.getValueAt(row,4) + "\n"); // notes 
     132                            {//CAD Log Entry, Incident #187, Sharon: REQUEST EXTRA ANCHOVIES 
     133                                output.append("CAD log entry, "); 
     134                                output.append("Incident #" + incident.logNum + ", "); 
     135                                output.append(initials + ": "); 
     136                                output.append(notesTable.getValueAt(row,4) + "\n"); // notes 
    137137                            } 
    138138                        } 
    139139                    } 
    140                     System.out.println(sb); 
     140                    System.out.print(output); 
     141                    // Write output to a file 
     142                    try  
     143                    { 
     144                        writer = new PrintWriter(new FileWriter(LOG_FILE_NAME)); 
     145                        writer.print(output); 
     146                        writer.close(); 
     147                    } catch (Exception exc) { 
     148                        exc.printStackTrace(); 
     149                        }  
     150         
    141151                    //long simtime = theCoorInt.getCurrentSimulationTime(); 
    142152                    //theView.updateTime("" + formatInterval(simtime)); 
     
    256266    } 
    257267 
     268    @Override 
     269    public void refresh() throws RemoteException 
     270    { 
     271        throw new UnsupportedOperationException("Not supported yet."); 
     272    } 
     273 
    258274    /** 
    259275     * Construct the CADClient with the properties file path, either from the 
  • trunk/src/tmcsim/simulationmanager/IncidentHistoryPanel.java

    r11 r432  
    114114        logScrollPane.setViewportView(eventHistoryTable); 
    115115        logScrollPane.setBorder(BorderFactory.createTitledBorder( 
    116                 BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Log Entries")); 
     116                BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "CAD Log Entries")); 
    117117         
    118118     
Note: See TracChangeset for help on using the changeset viewer.