<commit_before>#include "ofxDmx.h"
#include "ofMain.h"

#define DMX_PRO_HEADER_SIZE 4
#define DMX_PRO_START_MSG 0x7E
#define DMX_START_CODE 0
#define DMX_START_CODE_SIZE 1
#define DMX_PRO_SEND_PACKET 6 // "periodically send a DMX packet" mode
#define DMX_PRO_END_SIZE 1
#define DMX_PRO_END_MSG 0xE7

ofxDmx::ofxDmx()
:connected(false)
,needsUpdate(false) {
}

ofxDmx::~ofxDmx() {
	serial.close();
	connected = false;
}

bool ofxDmx::connect(int device, unsigned int channels) {
	serial.enumerateDevices();
	serial.setVerbose(false);
	connected = serial.setup(device, 57600); 
	setChannels(channels);
	return connected;
}

bool ofxDmx::connect(string device, unsigned int channels) {
	serial.enumerateDevices();
	serial.setVerbose(false);
	connected = serial.setup(device.c_str(), 57600);
	setChannels(channels);
	return connected;
}

bool ofxDmx::isConnected() {
	return connected;
}

void ofxDmx::disconnect() {
	serial.close();
}

void ofxDmx::setChannels(unsigned int channels) {
	levels.resize(ofClamp(channels, 24, 512));
}

void ofxDmx::update(bool force) {<commit_msg>remove setVerbose, closes #1<commit_after>#include "ofxDmx.h"
#include "ofMain.h"

#define DMX_PRO_HEADER_SIZE 4
#define DMX_PRO_START_MSG 0x7E
#define DMX_START_CODE 0
#define DMX_START_CODE_SIZE 1
#define DMX_PRO_SEND_PACKET 6 // "periodically send a DMX packet" mode
#define DMX_PRO_END_SIZE 1
#define DMX_PRO_END_MSG 0xE7

ofxDmx::ofxDmx()
:connected(false)
,needsUpdate(false) {
}

ofxDmx::~ofxDmx() {
	serial.close();
	connected = false;
}

bool ofxDmx::connect(int device, unsigned int channels) {
	serial.enumerateDevices();
	connected = serial.setup(device, 57600); 
	setChannels(channels);
	return connected;
}

bool ofxDmx::connect(string device, unsigned int channels) {
	serial.enumerateDevices();
	connected = serial.setup(device.c_str(), 57600);
	setChannels(channels);
	return connected;
}

bool ofxDmx::isConnected() {
	return connected;
}

void ofxDmx::disconnect() {
	serial.close();
}

void ofxDmx::setChannels(unsigned int channels) {
	levels.resize(ofClamp(channels, 24, 512));
}

void ofxDmx::update(bool force) {
{'fraction_non_alphanumeric': 0.12600663192799622, 'fraction_numerical': 0.023211747986736146, 'mean_word_length': 6.597122302158273, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4461742', 'n_tokens_mistral': 824, 'n_tokens_neox': 782, 'n_words': 167}