<commit_before>// main functions
var helper = require('../lib/shared');

module.exports = function Ola(type, width, where, loop) {
    var _this = this;
    _this.TIMERS = [];
    _this.name = 'OlaAnimation';
    _this.type = type;
    _this.width = parseInt(width);
    _this.currentCol = _this.width + 6;
    _this.currentColErase = _this.width + 6;
    _this.where = where;
    _this.running = false;
    _this.loop = loop;
    _this.timer = 5 * _this.where[0].motors[0].getFPS();
    _this.eraseWave = () => {
        if (_this.type == 'little') {
            if (_this.currentColErase > -30) {
                _this.where[0].motors.forEach((motor) => {
                    var x = _this.currentColErase + _this.where[0].offset;
                    if (motor.x == (x - motor.y)) {
                        motor.sendCommand(0x14);
                    }
                });
                if (_this.currentColErase < 5) {
                    _this.where[1].motors.forEach((motor) => {
                        var x = _this.currentColErase + _this.where[1].width + _this.where[1].offset;
                        if (motor.x == (x - motor.y)) {
                            motor.sendCommand(0x14);
                        }
                    });
                }
                if (_this.currentColErase < -6) {
                    _this.where[2].motors.forEach((motor) => {
                        var x = _this.currentColErase + _this.where[2].width + _this.where[2].offset - 10;
                        if (motor.x == (x - motor.y)) {
                            motor.sendCommand(0x14);
                        }
                    });
                    _this.where[3].motors.forEach((motor) => {
                        var y = 28 - (_this.currentColErase * -1);
                        if (motor.y == y) {
                            motor.sendCommand(0x14);
                        }
                    });
                }
                _this.currentColErase--;
                var TMP_TIMER = setTimeout(_this.eraseWave, _this.timer);
                _this.TIMERS.push(TMP_TIMER);
            } else {
                if (_this.loop) {
                    _this.currentCol = _this.width + 3;
                    _this.currentColErase = _this.width + 3;
                    var steps = 50;
                    var TMP_TIMER = setTimeout(_this.wave, _this.where[0].motors[0].getFPS() * steps);
                    _this.TIMERS.push(TMP_TIMER);
                } else {
                    _this.running = false;
                    helper.logger.debug(`${_this.name} FINISHED (waiting last command)`);
                    _this.ended(10000);
                }
            }
        } else {
            if (_this.currentColErase > -30) {
                _this.where[0].motors.forEach((motor) => {
                    var x = _this.currentColErase + _this.where[0].offset;
                    if (motor.x == (x - motor.y)) {
                        motor.sendCommand(0x14);
                    }
                });

                _this.where[3].motors.forEach((motor) => {
                    var y = ((_this.currentColErase - 16) * -1);
                    if (motor.y == y && motor.x > 4) {
                        motor.sendCommand(0x14);
                    }
                    if (_this.currentColErase < -11) {
                        if (motor.y == 28 + _this.currentColErase && motor.x < 5) {
                            motor.sendCommand(0x14);
                        }
                    }
                });

                if (_this.currentColErase < 5) {
                    _this.where[1].motors.forEach((motor) => {
                        var x = _this.currentColErase + _this.where[1].width + _this.where[1].offset;
                        if (motor.x == (x - motor.y)) {
                            motor.sendCommand(0x14);
                        }
                    });
                }
                if (_this.currentColErase < -6) {
                    _this.where[2].motors.forEach((motor) => {
                        var x = _this.currentColErase + _this.where[2].width + _this.where[2].offset - 10;
                        if (motor.x == (x - motor.y)) {
                            motor.sendCommand(0x14);
                        }
                    });
                }
                _this.currentColErase--;
                var steps = 10; // 1 step is 9deg
                var TMP_TIMER = setTimeout(_this.eraseWave, _this.where[0].motors[0].getFPS() * steps);
                _this.TIMERS.push(TMP_TIMER);
            } else {
                if (_this.loop) {
                    _this.currentCol = _this.width + 3;
                    _this.currentColErase = _this.width + 3;
                    var steps = 900;
                    var TMP_TIMER = setTimeout(_this.wave(), _this.where[0].motors[0].getFPS() * steps);
                    _this.TIMERS.push(TMP_TIMER);
                } else {
                    _this.running = false;
                    helper.logger.debug(`${_this.name} FINISHED (waiting last command)`);
                    _this.ended(45000);
                }
            }
        }
    }
    _this.wave = () => {
        if (_this.type == 'little') {
            if (_this.currentCol > -30) {
                _this.where[0].motors.forEach((motor) => {
                    var x = _this.currentCol + _this.where[0].offset;
                    if (motor.x == (x - motor.y)) {
                        motor.sendCommand(0x3C);
                    }
                });

                _this.where[3].motors.forEach((motor) => {
                    var y = ((_this.currentCol - 16) * -1);
                    if (motor.y == y) {
                        motor.sendCommand(0x3C);
                    }
                });
<commit_msg>Update waitingTimer for Ola Full<commit_after>// main functions
var helper = require('../lib/shared');

module.exports = function Ola(type, width, where, loop) {
    var _this = this;
    _this.TIMERS = [];
    _this.name = 'OlaAnimation';
    _this.type = type;
    _this.width = parseInt(width);
    _this.currentCol = _this.width + 6;
    _this.currentColErase = _this.width + 6;
    _this.where = where;
    _this.running = false;
    _this.loop = loop;
    _this.timer = 5 * _this.where[0].motors[0].getFPS();
    _this.eraseWave = () => {
        if (_this.type == 'little') {
            if (_this.currentColErase > -30) {
                _this.where[0].motors.forEach((motor) => {
                    var x = _this.currentColErase + _this.where[0].offset;
                    if (motor.x == (x - motor.y)) {
                        motor.sendCommand(0x14);
                    }
                });
                if (_this.currentColErase < 5) {
                    _this.where[1].motors.forEach((motor) => {
                        var x = _this.currentColErase + _this.where[1].width + _this.where[1].offset;
                        if (motor.x == (x - motor.y)) {
                            motor.sendCommand(0x14);
                        }
                    });
                }
                if (_this.currentColErase < -6) {
                    _this.where[2].motors.forEach((motor) => {
                        var x = _this.currentColErase + _this.where[2].width + _this.where[2].offset - 10;
                        if (motor.x == (x - motor.y)) {
                            motor.sendCommand(0x14);
                        }
                    });
                    _this.where[3].motors.forEach((motor) => {
                        var y = 28 - (_this.currentColErase * -1);
                        if (motor.y == y) {
                            motor.sendCommand(0x14);
                        }
                    });
                }
                _this.currentColErase--;
                var TMP_TIMER = setTimeout(_this.eraseWave, _this.timer);
                _this.TIMERS.push(TMP_TIMER);
            } else {
                if (_this.loop) {
                    _this.currentCol = _this.width + 3;
                    _this.currentColErase = _this.width + 3;
                    var steps = 50;
                    var TMP_TIMER = setTimeout(_this.wave, _this.where[0].motors[0].getFPS() * steps);
                    _this.TIMERS.push(TMP_TIMER);
                } else {
                    _this.running = false;
                    helper.logger.debug(`${_this.name} FINISHED (waiting last command)`);
                    _this.ended(10000);
                }
            }
        } else {
            if (_this.currentColErase > -30) {
                _this.where[0].motors.forEach((motor) => {
                    var x = _this.currentColErase + _this.where[0].offset;
                    if (motor.x == (x - motor.y)) {
                        motor.sendCommand(0x14);
                    }
                });

                _this.where[3].motors.forEach((motor) => {
                    var y = ((_this.currentColErase - 16) * -1);
                    if (motor.y == y && motor.x > 4) {
                        motor.sendCommand(0x14);
                    }
                    if (_this.currentColErase < -11) {
                        if (motor.y == 28 + _this.currentColErase && motor.x < 5) {
                            motor.sendCommand(0x14);
                        }
                    }
                });

                if (_this.currentColErase < 5) {
                    _this.where[1].motors.forEach((motor) => {
                        var x = _this.currentColErase + _this.where[1].width + _this.where[1].offset;
                        if (motor.x == (x - motor.y)) {
                            motor.sendCommand(0x14);
                        }
                    });
                }
                if (_this.currentColErase < -6) {
                    _this.where[2].motors.forEach((motor) => {
                        var x = _this.currentColErase + _this.where[2].width + _this.where[2].offset - 10;
                        if (motor.x == (x - motor.y)) {
                            motor.sendCommand(0x14);
                        }
                    });
                }
                _this.currentColErase--;
                var steps = 10; // 1 step is 9deg
                var TMP_TIMER = setTimeout(_this.eraseWave, _this.where[0].motors[0].getFPS() * steps);
                _this.TIMERS.push(TMP_TIMER);
            } else {
                if (_this.loop) {
                    _this.currentCol = _this.width + 3;
                    _this.currentColErase = _this.width + 3;
                    var steps = 900;
                    var TMP_TIMER = setTimeout(_this.wave(), _this.where[0].motors[0].getFPS() * steps);
                    _this.TIMERS.push(TMP_TIMER);
                } else {
                    _this.running = false;
                    helper.logger.debug(`${_this.name} FINISHED (waiting last command)`);
                    _this.ended(35000);
                }
            }
        }
    }
    _this.wave = () => {
        if (_this.type == 'little') {
            if (_this.currentCol > -30) {
                _this.where[0].motors.forEach((motor) => {
                    var x = _this.currentCol + _this.where[0].offset;
                    if (motor.x == (x - motor.y)) {
                        motor.sendCommand(0x3C);
                    }
                });

                _this.where[3].motors.forEach((motor) => {
                    var y = ((_this.currentCol - 16) * -1);
                    if (motor.y == y) {
                        motor.sendCommand(0x3C);
                    }
                });

{'fraction_non_alphanumeric': 0.12648898791670238, 'fraction_numerical': 0.019710343645556603, 'mean_word_length': 1.0242844752818734, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 35, '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': '3694403', 'n_tokens_mistral': 3541, 'n_tokens_neox': 3206, 'n_words': 522}