mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2026-04-28 03:08:08 +00:00
63 lines
1.5 KiB
C++
63 lines
1.5 KiB
C++
#include "PulseLengthStatAnalyzerSettings.h"
|
|
#include <AnalyzerHelpers.h>
|
|
|
|
PulseLengthStatAnalyzerSettings::PulseLengthStatAnalyzerSettings()
|
|
: mInputChannel(UNDEFINED_CHANNEL),
|
|
mInputChannelInterface()
|
|
{
|
|
mInputChannelInterface.SetTitleAndTooltip(
|
|
"Input",
|
|
"Digital channel: one frame per stable level between edges (duration in samples / us).");
|
|
mInputChannelInterface.SetChannel(mInputChannel);
|
|
|
|
AddInterface(&mInputChannelInterface);
|
|
|
|
AddExportOption(0, "Export as text/csv file");
|
|
AddExportExtension(0, "text", "txt");
|
|
AddExportExtension(0, "csv", "csv");
|
|
|
|
ClearChannels();
|
|
AddChannel(mInputChannel, "Input", false);
|
|
}
|
|
|
|
PulseLengthStatAnalyzerSettings::~PulseLengthStatAnalyzerSettings()
|
|
{
|
|
}
|
|
|
|
bool PulseLengthStatAnalyzerSettings::SetSettingsFromInterfaces()
|
|
{
|
|
mInputChannel = mInputChannelInterface.GetChannel();
|
|
|
|
ClearChannels();
|
|
AddChannel(mInputChannel, "Pulse Length Stat", true);
|
|
|
|
return true;
|
|
}
|
|
|
|
void PulseLengthStatAnalyzerSettings::UpdateInterfacesFromSettings()
|
|
{
|
|
mInputChannelInterface.SetChannel(mInputChannel);
|
|
}
|
|
|
|
void PulseLengthStatAnalyzerSettings::LoadSettings(const char* settings)
|
|
{
|
|
SimpleArchive text_archive;
|
|
text_archive.SetString(settings);
|
|
|
|
text_archive >> mInputChannel;
|
|
|
|
ClearChannels();
|
|
AddChannel(mInputChannel, "Pulse Length Stat", true);
|
|
|
|
UpdateInterfacesFromSettings();
|
|
}
|
|
|
|
const char* PulseLengthStatAnalyzerSettings::SaveSettings()
|
|
{
|
|
SimpleArchive text_archive;
|
|
|
|
text_archive << mInputChannel;
|
|
|
|
return SetReturnString(text_archive.GetString());
|
|
}
|