Skip to content

Commit

Permalink
Update readme, wiki and fix code request test
Browse files Browse the repository at this point in the history
  • Loading branch information
nonodev96 committed Jul 2, 2022
1 parent 7f6699f commit 5dd294a
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 165 deletions.
105 changes: 47 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,81 +21,72 @@ THUMDER
</center>

<center>
<a href="https://thumder.netlify.com">THUMDER page</a>
Página del proyecto en producción <a href="https://thumder.netlify.com">THUMDER</a><br>
</center>

## Installation
<center>
Repositorio del servidor del proyecto <a href="https://github.com/nonodev96/THUMDER-server">THUMDER server</a>
</center>

## Instalación de las dependencias

```bash
sudo npm install -g @angular/cli@12.2.10
npm install
# npm install --only=prod
sudo npm install -g @angular/cli@12.5.0 # Instala la herramienta de desarrollo
npm install # Instala las dependencias
```

## Included Commands
Tu necesitas aumenta la memoria de node, para ello se debe modificar la variable de entorno de node (`NODE_OPTIONS`),
para ello debemos asignar al menos 4Gb de memoria `--max_old_space_size=<size>`.

### Develop
## Desarrollo

| Command | Description |
|:-------------------------------|:-------------------------------|
| `npm run ng:serve-angular:dev` | Develop the app in the browser |

### Deploy
| **Commandos** | **Descripción** |
|:-------------------------------|:--------------------------------------------------------|
| `npm run ng:serve-angular:dev` | Enciende el servidor de angular en modo de desarrollo |
| `npm run ws:server` | Enciende el servidor websocket, requiere THUMDER Server |

| Command | Description |
|:--------------------------------------|:-------------------------------------------------------------------------------------|
| `npm run ng:build-angular:production` | Deploy Angular app for browser version |
| `npm run electron:build` | Builds your application and creates an app consumable based on your operating system |
## Despliegue

### Others command

| Command | Description |
|:----------------------------------------|:--------------|
| `npm run ng:build:dev` | |
| `npm run ng:build:web` | |
| `npm run ng:build:production` | |
| `npm run ng:build-angular:dev` | |
| `npm run ng:build-angular:web` | |
| `npm run ng:build-angular:production` | |
| `npm run ng:serve:dev` | |
| `npm run ng:serve:web` | |
| `npm run ng:serve:production` | |
| `npm run ng:serve-angular:dev` | |
| `npm run ng:serve-angular:web` | |
| `npm run ng:serve-angular:production` | |
| **Commandos** | **Descripción** |
|:--------------------------------------|:--------------------------------------------------------------------------------------------------|
| `npm run ng:build-angular:production` | Construye la aplicación angular de navegador con las variables de producción |
| `npm run electron:build` | Construye la aplicación angular y encapsula la aplicación dentro electron generando un ejecutable |

You need to change de space of node with `NODE_OPTIONS` `--max_old_space_size=<size>`
El despliegue genera las carpetas `/dist`, `/dist-angular` y `/release`.

**Your application is optimised. Only /dist folder and node dependencies are included in the executable.**
La carpeta `/dist-angular` es la indicada para el despliegue en servidores.

## You want to use a specific lib (like rxjs) in electron main thread ?
La carpeta `/release` contiene los ficheros ejecutables con la aplicación.

YES! You can do it! Just by importing your library in npm dependencies section (not **devDependencies**)
with `npm install --save`. It will be loaded by electron during build phase and added to your final package. Then use
your library by importing it in `main.ts` file. Quite simple, isn't it ?
## Otros comandos

## Unit Tests

| Command | Description |
|:---------|:-------------------------------------------------------------|
| ng test | Run unit tests with karma, for components, views and modules |

## E2E Testing

E2E Test scripts can be found in `e2e` and `cypress` folder.
| **Commandos** | **Descripción** |
|:--------------------------------------|:----------------|
| `npm run ng:build:dev` | |
| `npm run ng:build:web` | |
| `npm run ng:build:production` | |
| `npm run ng:build-angular:dev` | |
| `npm run ng:build-angular:web` | |
| `npm run ng:build-angular:production` | |
| `npm run ng:serve:dev` | |
| `npm run ng:serve:web` | |
| `npm run ng:serve:production` | |
| `npm run ng:serve-angular:dev` | |
| `npm run ng:serve-angular:web` | |
| `npm run ng:serve-angular:production` | |

## Server e2e

| Command | Description |
|:------------------------|:--------------------------------------------|
| `npm run ng:server` | Start the server |
| `npm run cypress:open` | Open cypress app and configure the commands |
| `npm run cypress:run` | Run tests of cypress (BUG) |

Note: To make it work behind a proxy, you can add this proxy exception in your terminal
`export {no_proxy,NO_PROXY}="127.0.0.1,localhost"`
| **Commandos** | **Descripción** |
|:-----------------------|:--------------------------------------------------------------------------------|
| `npm run cypress:open` | Abre la aplicación con cypress app y configura los comandos y pruebas |
| `npm run cypress:run` | Ejecuta las pruebas sobre el servidor (solo son visibles por linea de comandos) |

### Coverage
### Cobertura de navegadores

```bash
npx browserslist
Expand All @@ -104,10 +95,8 @@ npx browserslist --coverage

These browsers account for 86.79% of all users globally

## Currently, runs with:

- Angular v12.2.10
- Electron v12.2.2
- Electron Builder v22.10.5
## Versión actual de las dependencias

[//]: #
- Angular v12.5.0
- Electron v16.2.6
- Electron Builder v23.0.3
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "thumder",
"version": "1.6.2",
"version": "1.6.3",
"private": true,
"description": "TFG - THUMDER (THe UltiMate Dlx EmulatoR): emulador multiplataforma DLX con fines didácticos",
"keywords": [
Expand Down
15 changes: 10 additions & 5 deletions src/app/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,17 +551,22 @@ export type TypeStage =
| "faddEX_7" | "fmultEX_7" | "fdivEX_7";

export type TypeDirectiveData = {
address: TypeAddress; // 0x00000000
directive: TypeDirective;
address: TypeAddress; // 0x00000000
hexValue: string; // 0x00000000
text: string;
hexValue: string; // 0x00000000
directive: TypeDirective;
};

export type TypeInstructionsData = {
address: TypeAddress; // 0x00000000
address: TypeAddress; // 0x00000000
code: string; // 0x00000000
text: string;
instruction: string;
code: string; // 0x00000000
};

export type TypeCodeResponse = {
machineDirectives: TypeDirectiveData[],
machineInstructions: TypeInstructionsData[],
};

export type TypeInstructionsData_Table = TypeInstructionsData & {
Expand Down
2 changes: 1 addition & 1 deletion src/app/__core/machine/machine.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export class MachineService {
}
};
this.socketProviderConnect.emitMessage("UpdateConfigurationMachineRequest", JSON.stringify(payload), (response) => {
console.log(response);
// console.log(response);
this.writeToLog(JSON.stringify(response))
});

Expand Down
6 changes: 4 additions & 2 deletions src/app/components/pixi-pipeline/pixi-pipeline.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { PixiTHUMDER_Pipeline } from "../../__core/machine/PixiTHUMDER_Pipeline"
@Component({
selector: "THUMDER-pixi-pipeline",
templateUrl: "./pixi-pipeline.component.html",
styleUrls: ["./pixi-pipeline.component.scss"]
styleUrls: [ "./pixi-pipeline.component.scss" ]
})
export class PixiPipelineComponent implements OnInit, AfterViewInit, OnDestroy {

Expand Down Expand Up @@ -72,7 +72,7 @@ export class PixiPipelineComponent implements OnInit, AfterViewInit, OnDestroy {
this.stepSimulationSubscription.unsubscribe();
}

@HostListener("window:resize", ["$event"])
@HostListener("window:resize", [ "$event" ])
public onResize(event): void {
event.preventDefault();
event.stopPropagation();
Expand All @@ -87,6 +87,7 @@ export class PixiPipelineComponent implements OnInit, AfterViewInit, OnDestroy {
}

private getInstructionDataPipelineItem(item: TypeCycleCell): TypeInstructionPipelineRepresentation {
if (item.address === undefined || item.address === "") return { text: "", draw: item.draw };
const machineInstruction = this.machine.getCode(item.address);
return {
text: machineInstruction.instruction,
Expand All @@ -96,6 +97,7 @@ export class PixiPipelineComponent implements OnInit, AfterViewInit, OnDestroy {

private getInstructionDataPipeline(items: TypeCycleCellUnit[]): TypeInstructionPipelineFloatingRepresentation[] {
return items.map((item) => {
if (item.address === undefined || item.address === "") return { unit: item.unit, text: "", draw: item.draw };
const machineInstruction = this.machine.getCode(item.address);
return {
unit: item.unit,
Expand Down
132 changes: 48 additions & 84 deletions src/app/views/_index/index.view.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
<!--
<ng-container [ngTemplateOutlet]="recursiveMenu" [ngTemplateOutletContext]="{ $implicit: [PRIVATE_ROUTES] }">
</ng-container>
<ng-template #recursiveMenu let-menus>
<ul *ngIf="menus.length>0">
<li *ngFor="let menu of menus;">
<a (click)="onItemSelected($event, menu)">
{{menu.displayName}} </a>
<ng-template [ngIf]="menu.children">
<ng-container [ngTemplateOutlet]="recursiveMenu"
[ngTemplateOutletContext]="{ $implicit: menu.children }"></ng-container>
</ng-template>
</li>
</ul>
</ng-template>
-->
<ng-template #card let-item='item'>
<div class="col-lg-3 col-6">
<div class="small-box bg-blue">
Expand All @@ -31,83 +15,63 @@ <h4>{{ ("NAVIGATION." + item.lang) | translate }}</h4>
</div>
</ng-template>

<!--<div class="card">-->
<!-- <div class="card-body">-->
<h4 class="mb-2 mt-4">{{ 'PAGES.INDEX.MACHINE' | translate }}</h4>
<div class="row">
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.PIPELINE}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.CYCLE_CLOCK_DIAGRAM}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.REGISTERS}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.MEMORY}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.CODE}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.STATISTICS}"></ng-container>
</div>
<hr>

<h4 class="mb-2 mt-4">{{ 'PAGES.INDEX.IDE' | translate }}</h4>
<div class="row">
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.FILE_MANAGER}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.EDITOR}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.MULTIVIEW}"></ng-container>
</div>
<hr>

<h4 class="mb-2 mt-4">{{ 'PAGES.INDEX.UTILS' | translate }}</h4>
<div class="row">
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.CALCULATOR}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.DOCUMENTATION}"></ng-container>
</div>
<div class="container-fluid">

<h4 class="mb-2 mt-4">{{ 'PAGES.INDEX.MACHINE' | translate }}</h4>
<div class="row">
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.PIPELINE}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.CYCLE_CLOCK_DIAGRAM}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.REGISTERS}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.MEMORY}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.CODE}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.STATISTICS}"></ng-container>
</div>
<hr>

<h4 class="mb-2 mt-4">{{ 'PAGES.INDEX.CONFIG' | translate }}</h4>
<div class="row">
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.CONFIG}"></ng-container>
</div>
<h4 class="mb-2 mt-4">{{ 'PAGES.INDEX.IDE' | translate }}</h4>
<div class="row">
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.FILE_MANAGER}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.EDITOR}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.MULTIVIEW}"></ng-container>
</div>
<hr>

<ng-container *ngIf="AppConfig.environment === 'DEV'">
<h4 class="mb-2 mt-4">{{ 'PAGES.INDEX.DEBUG' | translate }}</h4>
<h4 class="mb-2 mt-4">{{ 'PAGES.INDEX.UTILS' | translate }}</h4>
<div class="row">
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.DEBUG}"></ng-container>
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.CALCULATOR}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.LOGGER}"></ng-container>
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.DOCUMENTATION}"></ng-container>
</div>
<hr>


<h4 class="mb-2 mt-4">{{ 'PAGES.INDEX.CONFIG' | translate }}</h4>
<div class="row">
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.PROFILE}"></ng-container>
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.CONFIG}"></ng-container>
</div>
</ng-container>
<hr>

<!--
<h4 class="mb-2 mt-4">{{ 'PAGES.INDEX.PAGES' | translate }}</h4>
<div class="row">
<ng-container *ngFor="let item of PRIVATE_AUTH_ROUTES">
<div class="col-lg-3 col-6">
<div class="small-box bg-success">
<div class="inner">
<h4>{{ ("NAVIGATION." + item.lang) | translate }}</h4>
<p>{{ item.displayName }}</p>
</div>
<div class="icon">
<i class="{{item.icon}}"></i>
</div>
<a class="small-box-footer" [routerLink]="item.routerLink">
{{ 'PAGES.INDEX.MORE_INFO' | translate }} <i class="fas fa-arrow-circle-right"></i>
</a>
</div>
<ng-container *ngIf="AppConfig.environment === 'DEV'">
<h4 class="mb-2 mt-4">{{ 'PAGES.INDEX.DEBUG' | translate }}</h4>
<div class="row">
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.DEBUG}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.LOGGER}"></ng-container>
<ng-container [ngTemplateOutlet]="card"
[ngTemplateOutletContext]="{item:PRIVATE_AUTH_ROUTES.PROFILE}"></ng-container>
</div>
</ng-container>

</div>
-->
<!-- </div>-->
<!--</div>-->
Loading

0 comments on commit 5dd294a

Please sign in to comment.