sign: remove streamsType and associated code

This commit is contained in:
Srivats P 2016-11-05 19:41:02 +05:30
parent 2f9769d0ed
commit 1986845bae
9 changed files with 0 additions and 78 deletions

View File

@ -98,8 +98,6 @@ public:
{ return d.is_exclusive_control(); }
OstProto::TransmitMode transmitMode()
{ return d.transmit_mode(); }
OstProto::StreamType streamsType()
{ return d.streams_type(); }
double averagePacketRate()
{ return avgPacketsPerSec_; }
double averageBitRate()

View File

@ -68,23 +68,9 @@ PortConfigDialog::PortConfigDialog(
exclusiveControlButton->setChecked(portConfig_.is_exclusive_control());
switch(portConfig_.streams_type())
{
case OstProto::kUnsignedStream:
signedStreamsButton->setChecked(false);
break;
case OstProto::kSignedStream:
signedStreamsButton->setChecked(true);
break;
default:
Q_ASSERT(false); // Unreachable!!!
break;
}
// Disable UI elements based on portState
if (portState.is_transmit_on()) {
transmitModeBox->setDisabled(true);
signedStreamsButton->setDisabled(true);
}
}
@ -118,11 +104,6 @@ void PortConfigDialog::accept()
pc.set_is_exclusive_control(exclusiveControlButton->isChecked());
if (signedStreamsButton->isChecked())
pc.set_streams_type(OstProto::kSignedStream);
else
pc.set_streams_type(OstProto::kUnsignedStream);
// Update fields that have changed, clear the rest
if (pc.transmit_mode() != portConfig_.transmit_mode())
portConfig_.set_transmit_mode(pc.transmit_mode());
@ -139,10 +120,5 @@ void PortConfigDialog::accept()
else
portConfig_.clear_is_exclusive_control();
if (pc.streams_type() != portConfig_.streams_type())
portConfig_.set_streams_type(pc.streams_type());
else
portConfig_.clear_streams_type();
QDialog::accept();
}

View File

@ -69,13 +69,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="signedStreamsButton" >
<property name="text" >
<string>Signed Streams</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >

View File

@ -726,7 +726,6 @@ void PortsWindow::on_actionPort_Configuration_triggered()
// which says copy only modifiable fields
//plm->port(current).protoDataCopyInto(&config);
config.set_transmit_mode(port.transmitMode());
config.set_streams_type(port.streamsType());
config.set_is_exclusive_control(port.hasExclusiveControl());
config.set_user_name(port.userName().toStdString());

View File

@ -196,11 +196,6 @@ enum TransmitMode {
kInterleavedTransmit = 1;
}
enum StreamType {
kUnsignedStream = 0; // FIXME: rename? convert to flags?
kSignedStream = 1;
}
message Port {
required PortId port_id = 1;
optional string name = 2;
@ -210,7 +205,6 @@ message Port {
optional bool is_exclusive_control = 6;
optional TransmitMode transmit_mode = 7 [default = kSequentialTransmit];
optional string user_name = 8;
optional StreamType streams_type = 9 [default = kUnsignedStream];
}
message PortConfigList {

View File

@ -78,12 +78,6 @@ bool AbstractPort::canModify(const OstProto::Port &port, bool *dirty)
allow = !isTransmitOn();
}
if (port.has_streams_type()
&& (port.streams_type() != data_.streams_type())) {
*dirty = true;
allow = !isTransmitOn();
}
return allow;
}
@ -104,9 +98,6 @@ bool AbstractPort::modify(const OstProto::Port &port)
if (port.has_transmit_mode())
data_.set_transmit_mode(port.transmit_mode());
if (port.has_streams_type())
setStreamsType(port.streams_type());
if (port.has_user_name()) {
data_.set_user_name(port.user_name());
}
@ -180,11 +171,6 @@ void AbstractPort::addNote(QString note)
data_.set_notes(notes.toStdString());
}
bool AbstractPort::setStreamsType(OstProto::StreamType type)
{
data_.set_streams_type(type);
}
AbstractPort::Accuracy AbstractPort::rateAccuracy()
{
return rateAccuracy_;

View File

@ -103,8 +103,6 @@ public:
bool isDirty() { return isSendQueueDirty_; }
void setDirty() { isSendQueueDirty_ = true; }
virtual bool setStreamsType(OstProto::StreamType type);
Accuracy rateAccuracy();
virtual bool setRateAccuracy(Accuracy accuracy);

View File

@ -117,26 +117,6 @@ void PcapPort::updateNotes()
arg(notes).toStdString());
}
bool PcapPort::setStreamsType(OstProto::StreamType type)
{
AbstractPort::setStreamsType(type);
transmitter_->useSignedStreams(type == OstProto::kSignedStream);
// XXX: Because of the way we implement signed tx stats, changing
// streamsType requires us to set sign tx stats equal to tx stats
// followed by clear stats; see note in PcapTxStats::run() for details
// FIXME: can we get away with clearing only sign stats?
// FIXME: Ideally PcapPort should *NOT* know how PcapTxStats implements
// sign stats
stats_.sign.txPkts = stats_.txPkts;
stats_.sign.txBytes = stats_.txBytes;
stats_.sign.rxPkts = stats_.rxPkts;
stats_.sign.rxBytes = stats_.rxBytes;
resetStats();
return true;
}
bool PcapPort::setRateAccuracy(AbstractPort::Accuracy accuracy)
{
if (transmitter_->setRateAccuracy(accuracy)) {

View File

@ -39,8 +39,6 @@ public:
virtual bool hasExclusiveControl() { return false; }
virtual bool setExclusiveControl(bool /*exclusive*/) { return false; }
virtual bool setStreamsType(OstProto::StreamType type);
virtual bool setRateAccuracy(AbstractPort::Accuracy accuracy);
virtual void clearPacketList() {