use of com.exalttech.trex.remote.models.profiles.Mode in project trex-stateless-gui by cisco-system-traffic-generator.
the class StreamPropertiesViewController method handleMultiBurstModeSelection.
private void handleMultiBurstModeSelection() {
streamModeGroup.selectToggle(multiBurstMode);
streamModeGroup.setUserData(StreamMode.MULTI_BURST);
// disable numbers
numbersContainer.setDisable(false);
numOfPacketLabel.setDisable(true);
numOfPacketTB.setDisable(true);
numOfBurstLabel.setDisable(false);
numOfBurstTB.setDisable(false);
packetPBurstTitle.setDisable(false);
packetPBurstTB.setDisable(false);
// enable next stream
afterStreamContainer.setDisable(false);
// enable ibg
ibgTF.setDisable(false);
ibgTitle.setDisable(false);
// define gaps view
gapsImageContainer.setImage(new Image("/icons/" + StreamMode.MULTI_BURST.getImageName()));
// set numOf Burst value
Mode mode = selectedProfile.getStream().getMode();
int numOfBurst = mode.getCount();
if (numOfBurst < 2) {
numOfBurst = 2;
}
numOfBurstTB.setText(String.valueOf(numOfBurst));
}
use of com.exalttech.trex.remote.models.profiles.Mode in project trex-stateless-gui by cisco-system-traffic-generator.
the class StreamPropertiesViewController method fillStreamProperties.
private void fillStreamProperties(int currentSelectedIndex) {
Mode mode = selectedProfile.getStream().getMode();
enabledCB.setSelected(selectedProfile.getStream().isEnabled());
selfStartCB.setSelected(selectedProfile.getStream().isSelfStart());
numOfPacketTB.setText(String.valueOf(mode.getTotalPkts()));
packetPBurstTB.setText(String.valueOf(mode.getPacketsPerBurst()));
numOfBurstTB.setText(String.valueOf(mode.getCount()));
rateTypeCB.getSelectionModel().select(mode.getRate().getType().replace('_', ' '));
rateValueTF.setValue(mode.getRate().getValue());
isgTF.setText(convertNumToUnit(selectedProfile.getStream().getIsg()));
ibgTF.setText(convertNumToUnit(mode.getIbg()));
rxStreamID.setText(String.valueOf(selectedProfile.getStream().getFlowStats().getStreamID()));
rxEnableCB.setSelected(selectedProfile.getStream().getFlowStats().getEnabled());
fillGotoStreamOption(currentSelectedIndex);
stopRG.setSelected(true);
if (!"-1".equals(selectedProfile.getNext())) {
gotoRG.setSelected(true);
}
timeInLoopTF.setText(String.valueOf(selectedProfile.getStream().getActionCount()));
timeInLoopCB.setSelected(selectedProfile.getStream().getActionCount() > 0);
StreamMode streamMode = StreamMode.CONTINUOUS;
if (!Util.isNullOrEmpty(mode.getType())) {
streamMode = StreamMode.getMode(mode.getType());
}
switch(streamMode) {
case CONTINUOUS:
handleContinousModeSelection();
break;
case SINGLE_BURST:
handleBurstModeSelection();
break;
case MULTI_BURST:
handleMultiBurstModeSelection();
break;
default:
break;
}
}
use of com.exalttech.trex.remote.models.profiles.Mode in project trex-stateless-gui by cisco-system-traffic-generator.
the class TrafficProfile method convertProfilesToTableData.
/**
* Convert profiles to equivalent tableProfile data
*
* @param profilesList
* @return
*/
public List<TableProfileStream> convertProfilesToTableData(Profile[] profilesList) {
List<TableProfileStream> tableData = new ArrayList<>();
for (int index = 0; index < profilesList.length; index++) {
Profile p = profilesList[index];
TableProfileStream stream = new TableProfileStream();
Mode modeYaml = p.getStream().getMode();
stream.setIndex(String.valueOf(index + 1));
stream.setEnabled(p.getStream().isEnabled());
stream.setName(p.getName());
stream.setMode(modeYaml.getType());
String rateUnits = "";
switch(modeYaml.getRate().getType()) {
case Rate.RateTypes.PPS:
rateUnits = "pps";
break;
case Rate.RateTypes.BPS_L1:
rateUnits = "bps L1";
break;
case Rate.RateTypes.BPS_L2:
rateUnits = "bps L2";
break;
case Rate.RateTypes.PERCENTAGE:
rateUnits = "%";
break;
}
stream.setRate(Util.formattedData((long) modeYaml.getRate().getValue(), true) + rateUnits);
stream.setNextStream(getNextStreamValue(p.getNext()));
String packetBinary = p.getStream().getPacket().getBinary();
String packetModel = p.getStream().getPacket().getModel();
stream.setPcapBinary(packetBinary);
stream.setPktModel(packetModel);
PacketInfo packetInfo = getPacketInfo(packetBinary);
stream.setLength(String.valueOf(packetInfo.getLength() + Constants.EXTRA_BYTE));
stream.setPacketType(packetInfo.getType());
tableData.add(stream);
}
return tableData;
}
Aggregations