npm package: @matthiaswillem/7-segment_display
Description: A TypeScript library that can display temperature data in the console in LCD style
Author: Matthias Willem
Latest version: 0.3.0

# 7-segment display

![npm badge](https://img.shields.io/npm/v/@matthiaswillem/7-segment_display)
![ESLint](../../workflows/ESLint/badge.svg?branch=master)
![Markdown Linter](../../workflows/Markdown%20Linter/badge.svg?branch=master)
![License](https://img.shields.io/npm/l/@matthiaswillem/7-segment_display)

> Exam assignment 2020 - Software Engineering
> Matthias Willem

A TypeScript library that can display temperature data in the console in LCD style according to following format:

```text
 ______________________
|   _    _        _  _ |
| | _|   _||_|   |_||  |
| ||_  / _|  |      |_ |
|______________________|

```

## Installation

### Installing the package

This package [package](http://github.com) is available on [npmjs.com](npmjs.com). Check it out!

Just run this command:

```node
npm i @matthiaswillem/7-segment_display
```

### Building a package

If you want to create a package yourself

#### Programs

Node.js

[Visit website](https://nodejs.org)

Visual Studio Code ( Not really necessary but it is useful )

[Visit website](https://code.visualstudio.com)

#### Command line

Install npm

```sh
npm install npm@latest -g
```

Install typescript

```sh
npm install -g typescript
```

Install ts-node

```sh
npm install -g ts-node
```

## Documentation

The documentation of the package can you find at the [GitHub Pages](https://vives-software-engineering-2020.github.io/examenopdracht-MatthiasWillem/.)

## Examples

Here I will give you some examples for using this package.
The main method is:

```ts
 display(temperature: number, frame: boolean)
 ```

In the first parameter *temperature*, you can give a number what the temperature should be.
In the second parameter *frame*, you can the method you want a frame (`true`) or not (`false`).

### With border

An example command

```ts
display(12.34291, true)
```

The output

```text
 ________________________
|     _    _        _  _ |
|  |  _|   _||_|   |_||  |
|  | |_  / _|  |      |_ |
|________________________|

```

### Without border

An example Command

```ts
display(6, false)
```

The output

```text
  _     _  _     _  _
 |_    | || |   |_||  
 |_| / |_||_|      |_

```

## Versions

All NPM versions are the same of the github versions tags.

### 0.0.0

Project Setup

Added some files:

- README file
- LICENCE file
- Markdown Linter by commit
- ES Linter Checker by commit
- NPM Package
- Jest test file
- .gitIgnore file

Edited some files:

- README
  - Added
    - Badges
      - NPM Version
      - License
      - ESLint Check
      - Markdown Check
    - Discription
    - Installation
    - Versions
    - License
    - Author information
- display.ts
  - Added
    - Example
- display.test.ts
  - Added
    - Example

### 0.1.0

Project Start - Read the temperature

Edited some files:

- README
  - Added
    - New version (0.1.0)
- display.ts
  - Removed
    - Example
  - Added
    - setTemp()
    - getTemp()
    - getRoundedTemp()
- display.test.ts
  - Removed
    - Example
  - Added
    - Some tests for testing all new methods

### 0.1.1

Put temperature chars into array + read

Edited some files:

- README
  - Added
    - New version (0.1.1)
- display.ts
  - Added
    - getTempNumbArray()
    - getTempArrayValue(index: number)
    - tempToArray()
- display.test.ts
  - Added
    - Some tests for testing all new methods

### 0.1.2

Doesn't exist anymore. I removed it for a small bugfix and didn't noticed you can't ever publish the same version again after you removed one.

You can find more info [here](https://docs.npmjs.com/cli/unpublish#synopsis) about it.

### 0.1.3

Array of the whole temperature

Edited some files:

- README
  - Added
    - Version problem 0.1.2
    - New version (0.1.3)
- display.ts
  - Added
    - getTempArray()
    - buildTempArray()
- display.test.ts
  - Added
    - Some tests for testing all new methods

### 0.1.4

Printing temperature array in one string

Edited some files:

- README
  - Added
    - New version (0.1.4)
- display.ts
  - Added
    - printDisplay()
- display.test.ts
  - Added
    - Some tests for testing all new methods

### 0.1.5

Reworked printDisplay method
Cleaner, DRY code. Removed spaces between numbers

Edited some files:

- README
  - Added
    - New version (0.1.5)
- display.ts
  - Modified
    - printDisplay()

### 0.1.6

Added everywhere default the °C symbol.

Edited some files:

- README
  - Added
    - new version (0.1.6)
- display.ts
  - Modified
    - buildTempArray()
    - setTemp(value: number)
- display.test.ts
  - Modified
    - All tests added the °C symbol

### 0.2.0

The basics work (No Frame, no 2x Font)

Fully rebuild project:

- Separated much methods in some other methods for the Single Responsibility Principle (SRP)
- Changed much names of methods
- Had to change the tests too (And remove some)
- Added documentation

Edited some files:

- README
  - Added
    - Documentation (GitHub Pages)
    - New minor version (0.2.0)
- docs
  - Added docs directory for github pages
- display.ts
  - Added
    - setTempNumb(temperature: number)
    - getTempNumb()
    - tempNumbRound()
    - temperatureAddCelcius()
    - setTemperature(temperature: number)
    - getTemperature()
    - temperatureToArray()
    - getTemperatureArray()µ
    - checkAndBuildChar(tempArrChar: number, tempChar: number)
    - buildDisplayArray()
    - getDisplayArray()
    - resetOutput()
    - resetIndentation()
    - printFirstRow()
    - printSecondAndThirdRow()
    - changeIndentation(row: number)
    - printDisplay()
  - Removed
    - setTemp(value: number)
    - getTemp()
    - getRoundedTemp()
    - getTempNumbArray()
    - getTempArrayValue(index: number)
    - tempToArray()
    - getTempArray()
    - printDisplay()
    - buildTempArray()
- display.test.ts
  - Modified
    - All tests are modified with the correct names

### 0.3.0

Added the frame to the project

Edited some files:

- README
  - Added
    - New minor version (0.3.0)
    - Examples
- docs
  - Added
    - The new methods
- display.ts
  - Added
    - checkBorder(border: boolean)
    - createHorBorderTop(border: boolean)
    - createHorBorderBottom(border: boolean)
    - display(temperature: number, frame: boolean)
  - modified
    - printDisplay(frame: boolean)
    - changeIndentation(row: number)
    - printFirstRow()
    - resetOutput()
    - one[] (for better layout)
- display.test.ts
  - Added
    - 2 new tests for printDisplay(true)
    - 2 new tests for display(temperature: number, frame: boolean)

## Licence

This project is licensed under the MIT License - see the [LICENSE](./LICENCE) file for details

## Author information

Matthias Willem

Student Electronics-ICT VIVES Bruges