mirror of
https://github.com/lewismoten/data-over-audio.git
synced 2026-04-20 13:16:23 +08:00
convert speed panel
This commit is contained in:
41
Panels/SpeedPanel.js
Normal file
41
Panels/SpeedPanel.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import BasePanel from './BasePanel';
|
||||
import * as Humanize from '../Humanize';
|
||||
|
||||
class SpeedPanel extends BasePanel {
|
||||
constructor() {
|
||||
super('Speed');
|
||||
this.addSection('Bits per second');
|
||||
|
||||
this.openField('Packetization');
|
||||
this.addDynamicText('bps-packetization', 'n/a');
|
||||
this.closeField();
|
||||
|
||||
this.openField('Data');
|
||||
this.addDynamicText('bps-data', 'n/a');
|
||||
this.closeField();
|
||||
|
||||
this.addSection('Duration');
|
||||
|
||||
this.openField('Transfer');
|
||||
this.addDynamicText('transfer-duration', 'n/a');
|
||||
this.closeField();
|
||||
|
||||
this.addSection('Maximum');
|
||||
|
||||
this.openField('Packets');
|
||||
this.addDynamicText('max-packets', 'n/a');
|
||||
this.closeField();
|
||||
|
||||
this.openField('Duration');
|
||||
this.addDynamicText('max-duration', 'n/a');
|
||||
this.closeField();
|
||||
};
|
||||
|
||||
setMaximumPackets = (count) => this.setValueById('max-packets', count.toLocaleString());
|
||||
setMaximumDurationMilliseconds = (milliseconds) => this.setValueById('max-duration', Humanize.durationMilliseconds(milliseconds));
|
||||
setPacketizationBitsPerSecond = (bps) => this.setValueById('bps-packetization', Humanize.bitsPerSecond(bps));
|
||||
setDataBitsPerSecond = (bps) => this.setValueById('bps-data', Humanize.bitsPerSecond(bps));
|
||||
setTransferDurationMilliseconds = (milliseconds) => this.setValueById('transfer-duration', Humanize.durationMilliseconds(milliseconds))
|
||||
}
|
||||
|
||||
export default SpeedPanel;
|
||||
Reference in New Issue
Block a user