<commit_before>﻿using System;
using System.Collections.Specialized;
using System.Threading.Tasks;
using BrailleIO.Interface;
using System.Collections.Generic;
using BrailleIO.Structs;

namespace BrailleIO
{
    /// <summary>
    /// Abstract implementation for basic functions a real Hardware modeling device Adapter has to implement
    /// </summary>
    public abstract class AbstractBrailleIOAdapterBase : IBrailleIOAdapter
    {
        // display options

        /// <summary>
        /// Gets or sets a value indicating whether this <see cref="AbstractBrailleIOAdapterBase"/> is synchronize.
        /// </summary>
        /// <value><c>true</c> if synchronize; otherwise, <c>false</c>.</value>
        public bool Synch
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets a flag indicating whether the pins should bee locked.
        /// This means no more synchronization should be possible. 
        /// The last pin state stays as set until the lock is released and Synchronize(bool[,] matrix) is called.
        /// </summary>
        /// <value><c>true</c> if [lock pins]; otherwise, <c>false</c>.</value>
        public bool LockPins
        {
            get;
            set;
        }

        BrailleIODevice _device;
        /// <summary>
        /// Gets or sets the device.
        /// The device gives access to specific properties of the modeled hardware device.
        /// </summary>
        /// <value>The device.</value>
        public BrailleIODevice Device
        {
            get { if (_device == null) _device = createDevice(); return _device; }
            protected set { _device = value; }
        }

        /// <summary>
        /// Creates an dummy device width dimensions of a Metec BrailleDis device.
        /// </summary>
        /// <returns></returns>
        protected virtual BrailleIODevice createDevice()
        {
            return new BrailleIODevice(120, 60, "UNKNOWN", true, true, 10, this.GetType().ToString());
        }

        private float _dpiX = 10;
        /// <summary>
        /// Gets or sets the horizontal resolution of the pin matrix for this device.
        /// </summary>
        /// <value>The horizontal device resolution in dpi.</value>
        public virtual float DpiX
        {
            get { return _dpiX; }
        }

        private float _dpiY = 10;
        /// <summary>
        /// Gets or sets the vertical resolution of the pin matrix for this device.
        /// </summary>
        /// <value>The vertical device resolution in dpi.</value>
        public virtual float DpiY
        {
            get { return _dpiY; }
        }

        private bool _connected = false;
        /// <summary>
        /// Gets a value indicating whether this <see cref="AbstractBrailleIOAdapterBase"/> is connected or not.
        /// </summary>
        /// <value><c>true</c> if connected; otherwise, <c>false</c>.</value>
        public bool Connected
        {
            get
            {
                if (!_connected) _connected = this.Connect();
                return _connected;
            }
            protected set { _connected = value; }
        }

        protected IBrailleIOAdapterManager manager = null;
        /// <summary>
        /// The adapter manager this adapter is registered in.
        /// </summary>
        protected IBrailleIOAdapterManager manager = null;
        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractBrailleIOAdapterBase"/> class.
        /// </summary>
        /// <param name="manager">The manager.</param>
        public AbstractBrailleIOAdapterBase(IBrailleIOAdapterManager manager)
        {
            this.manager = manager;<commit_msg>remove wrong merge for double manger<commit_after>﻿using System;
using System.Collections.Specialized;
using System.Threading.Tasks;
using BrailleIO.Interface;
using System.Collections.Generic;
using BrailleIO.Structs;

namespace BrailleIO
{
    /// <summary>
    /// Abstract implementation for basic functions a real Hardware modeling device Adapter has to implement
    /// </summary>
    public abstract class AbstractBrailleIOAdapterBase : IBrailleIOAdapter
    {
        // display options

        /// <summary>
        /// Gets or sets a value indicating whether this <see cref="AbstractBrailleIOAdapterBase"/> is synchronize.
        /// </summary>
        /// <value><c>true</c> if synchronize; otherwise, <c>false</c>.</value>
        public bool Synch
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets a flag indicating whether the pins should bee locked.
        /// This means no more synchronization should be possible. 
        /// The last pin state stays as set until the lock is released and Synchronize(bool[,] matrix) is called.
        /// </summary>
        /// <value><c>true</c> if [lock pins]; otherwise, <c>false</c>.</value>
        public bool LockPins
        {
            get;
            set;
        }

        BrailleIODevice _device;
        /// <summary>
        /// Gets or sets the device.
        /// The device gives access to specific properties of the modeled hardware device.
        /// </summary>
        /// <value>The device.</value>
        public BrailleIODevice Device
        {
            get { if (_device == null) _device = createDevice(); return _device; }
            protected set { _device = value; }
        }

        /// <summary>
        /// Creates an dummy device width dimensions of a Metec BrailleDis device.
        /// </summary>
        /// <returns></returns>
        protected virtual BrailleIODevice createDevice()
        {
            return new BrailleIODevice(120, 60, "UNKNOWN", true, true, 10, this.GetType().ToString());
        }

        private float _dpiX = 10;
        /// <summary>
        /// Gets or sets the horizontal resolution of the pin matrix for this device.
        /// </summary>
        /// <value>The horizontal device resolution in dpi.</value>
        public virtual float DpiX
        {
            get { return _dpiX; }
        }

        private float _dpiY = 10;
        /// <summary>
        /// Gets or sets the vertical resolution of the pin matrix for this device.
        /// </summary>
        /// <value>The vertical device resolution in dpi.</value>
        public virtual float DpiY
        {
            get { return _dpiY; }
        }

        private bool _connected = false;
        /// <summary>
        /// Gets a value indicating whether this <see cref="AbstractBrailleIOAdapterBase"/> is connected or not.
        /// </summary>
        /// <value><c>true</c> if connected; otherwise, <c>false</c>.</value>
        public bool Connected
        {
            get
            {
                if (!_connected) _connected = this.Connect();
                return _connected;
            }
            protected set { _connected = value; }
        }

        /// <summary>
        /// The adapter manager this adapter is registered in.
        /// </summary>
        protected IBrailleIOAdapterManager manager = null;
        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractBrailleIOAdapterBase"/> class.
        /// </summary>
        /// <param name="manager">The manager.</param>
        public AbstractBrailleIOAdapterBase(IBrailleIOAdapterManager manager)
        {
            this.manager = manager;
{'fraction_non_alphanumeric': 0.1094714247383955, 'fraction_numerical': 0.0029514354708881137, 'mean_word_length': 1.762134123749537, 'pattern_counts': {'":': 0, '<': 105, '<?xml version=': 0, '>': 105, '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': '4931996', 'n_tokens_mistral': 1927, 'n_tokens_neox': 1860, 'n_words': 628}