<commit_before>#include "awg.hpp"

#include "pulseTrain.hpp"

std::string awg::programmingString() {
	// Say where we're going to store this one
	std::string programmingString = "DATA:DESTINATION \"" + _waveName + "\"\n";

	// Load up our points in temp buffers
	unsigned long numPoints = outputPulses.numPoints(_sampleRate, true);
	std::string curveString = outputPulses.waveChars(_sampleRate, numPoints, true);
	std::string markerString = outputPulses.markerChars(_sampleRate, numPoints, true, round(_startPulseLength/_sampleRate));
	char buffer[128];
	unsigned int charLength = sprintf(buffer, "%lu", numPoints);
	sprintf(buffer, "#%u%lu", charLength, numPoints);
	std::string lengthString = buffer;

	// Set up configuration
	programmingString += "DATA:WIDTH 1\n";
	// Copy the curve
	programmingString += "CURVE " + lengthString;
	programmingString.append(curveString);
	programmingString += "\n";
	// Copy the markers
	programmingString += "MARKER:DATA " + lengthString;
	programmingString.append(markerString);
	programmingString += "\n";
	// Set clock frequency
	snprintf(buffer, 128, "CLOCK:FREQUENCY %fMHz\n", _clockFrequency);
	programmingString += buffer;
	// Set the file to use
	programmingString += "CH1:WAVEFORM \"" + _waveName + "\"\n";

	return programmingString;
}
<commit_msg>AWG wants sample in multiples of 32<commit_after>#include "awg.hpp"

#include "pulseTrain.hpp"

std::string awg::programmingString() {
	// Say where we're going to store this one
	std::string programmingString = "DATA:DESTINATION \"" + _waveName + "\"\n";

	// Load up our points in temp buffers
	unsigned long numPoints = outputPulses.numPoints(_sampleRate, true);
	std::string curveString = outputPulses.waveChars(_sampleRate, numPoints, true);
	std::string markerString = outputPulses.markerChars(_sampleRate, numPoints, true, round(_startPulseLength/_sampleRate));

	// Figure out how many times to double the length
	unsigned long paddedPoints;
	for(paddedPoints=numPoints; (paddedPoints % 32) > 0; paddedPoints = (paddedPoints << 1));
	curveString.reserve(paddedPoints);
	markerString.reserve(paddedPoints);
	// Double it that many times
	while(paddedPoints != curveString.length()) {
		curveString += curveString;
		markerString += markerString;
	}
	numPoints = paddedPoints;

	// Grab the actual output lengths
	char buffer[128];
	unsigned int charLength = sprintf(buffer, "%lu", numPoints);
	sprintf(buffer, "#%u%lu", charLength, numPoints);
	std::string lengthString = buffer;

	// Set up configuration
	programmingString += "DATA:WIDTH 1\n";
	// Copy the curve
	programmingString += "CURVE " + lengthString;
	programmingString.append(curveString);
	programmingString += "\n";
	// Copy the markers
	programmingString += "MARKER:DATA " + lengthString;
	programmingString.append(markerString);
	programmingString += "\n";
	// Set clock frequency
	snprintf(buffer, 128, "CLOCK:FREQUENCY %fMHz\n", _clockFrequency);
	programmingString += buffer;
	// Set the file to use
	programmingString += "CH1:WAVEFORM \"" + _waveName + "\"\n";

	return programmingString;
}

{'fraction_non_alphanumeric': 0.1295691906005222, 'fraction_numerical': 0.007180156657963447, 'mean_word_length': 5.412133891213389, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7502784', 'n_tokens_mistral': 999, 'n_tokens_neox': 922, 'n_words': 249}