<commit_before>﻿using System;
using vJoyInterfaceWrap;

namespace AndruleServer
{
    public class VJoyFeeder
    {
        private readonly vJoy _joystick;
        private vJoy.JoystickState _joystickState;

        private int _axisX;
        private int _axisY;
        private int _axisZ;

        private readonly uint _id;

        public VJoyFeeder()
        {
            _joystick = new vJoy();
            _joystickState = new vJoy.JoystickState();
            _id = 1;
            _joystick.ResetVJD(_id);

            if (!_joystick.vJoyEnabled())
            {
                Console.WriteLine("vJoy driver not enabled: Failed Getting vJoy attributes.\n");
                return;
            }
            Console.WriteLine("Vendor: {0}\nProduct :{1}\nVersion Number:{2}\n", _joystick.GetvJoyManufacturerString(), _joystick.GetvJoyProductString(), _joystick.GetvJoySerialNumberString());

        }

        public void Feed(PhoneData data)
        {
            // Get the number of buttons and POV Hat switchessupported by this vJoy device
            int nButtons = _joystick.GetVJDButtonNumber(_id);<commit_msg>Added more diagnostics output to feeder<commit_after>﻿using System;
using vJoyInterfaceWrap;

namespace AndruleServer
{
    public class VJoyFeeder
    {
        private readonly vJoy _joystick;
        private vJoy.JoystickState _joystickState;

        private int _axisX;
        private int _axisY;
        private int _axisZ;

        private readonly uint _id;

        public VJoyFeeder()
        {
            _joystick = new vJoy();
            _joystickState = new vJoy.JoystickState();
            _id = 1;
            _joystick.ResetVJD(_id);

            if (!_joystick.vJoyEnabled())
            {
                Console.WriteLine("vJoy driver not enabled: Failed Getting vJoy attributes.\n");
                return;
            }
            Console.WriteLine("Vendor: {0}\nProduct :{1}\nVersion Number:{2}\n", _joystick.GetvJoyManufacturerString(), _joystick.GetvJoyProductString(), _joystick.GetvJoySerialNumberString());

            // Get the state of the requested device
            VjdStat status = _joystick.GetVJDStatus(_id);
            switch (status)
            {
                case VjdStat.VJD_STAT_OWN:
                    Console.WriteLine("vJoy Device {0} is already owned by this feeder\n", _id);
                    break;
                case VjdStat.VJD_STAT_FREE:
                    Console.WriteLine("vJoy Device {0} is free\n", _id);
                    break;
                case VjdStat.VJD_STAT_BUSY:
                    Console.WriteLine("vJoy Device {0} is already owned by another feeder\nCannot continue\n", _id);
                    return;
                case VjdStat.VJD_STAT_MISS:
                    Console.WriteLine("vJoy Device {0} is not installed or disabled\nCannot continue\n", _id);
                    return;
                default:
                    Console.WriteLine("vJoy Device {0} general error\nCannot continue\n", _id);
                    return;
            };

        }

        public void Feed(PhoneData data)
        {
            // Get the number of buttons and POV Hat switchessupported by this vJoy device
            int nButtons = _joystick.GetVJDButtonNumber(_id);
{'fraction_non_alphanumeric': 0.0800121691512017, 'fraction_numerical': 0.003954974140553696, 'mean_word_length': 1.827171109200344, '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': '2136595', 'n_tokens_mistral': 975, 'n_tokens_neox': 863, 'n_words': 230}