Search in sources :

Example 1 with TableProfile

use of com.exalttech.trex.ui.views.models.TableProfile in project trex-stateless-gui by cisco-system-traffic-generator.

the class PacketTableView method loadStreamTable.

/**
 * Load stream table data
 *
 * @param fileToLoad
 * @return
 * @throws Exception
 */
public Profile[] loadStreamTable(File fileToLoad) throws Exception {
    this.loadedProfile = fileToLoad;
    Profile[] profileList;
    this.profileName = fileToLoad.getName();
    try {
        profileList = trafficProfile.getTrafficProfile(fileToLoad);
    } catch (IOException ex) {
        LOG.warn("Profile does not have any streams");
        profileList = new Profile[0];
    }
    List<TableProfileStream> packetDataList = trafficProfile.convertProfilesToTableData(profileList);
    TableProfile tableData = new TableProfile(new ArrayList<>(Arrays.asList(profileList)), packetDataList, fileToLoad.getPath());
    setPacketData(tableData);
    return profileList;
}
Also used : TableProfile(com.exalttech.trex.ui.views.models.TableProfile) TableProfileStream(com.exalttech.trex.ui.views.models.TableProfileStream) IOException(java.io.IOException) Profile(com.exalttech.trex.remote.models.profiles.Profile) TableProfile(com.exalttech.trex.ui.views.models.TableProfile) TrafficProfile(com.exalttech.trex.util.TrafficProfile)

Aggregations

Profile (com.exalttech.trex.remote.models.profiles.Profile)1 TableProfile (com.exalttech.trex.ui.views.models.TableProfile)1 TableProfileStream (com.exalttech.trex.ui.views.models.TableProfileStream)1 TrafficProfile (com.exalttech.trex.util.TrafficProfile)1 IOException (java.io.IOException)1