Skip to content

Commit

Permalink
add form memory
Browse files Browse the repository at this point in the history
  • Loading branch information
nonodev96 committed Oct 10, 2021
1 parent 4632881 commit e67b35f
Show file tree
Hide file tree
Showing 20 changed files with 1,166 additions and 221 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src/assets/flag-icons-master/* linguist-vendored
src/assets/styles/* linguist-vendored
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ THUMDER

# Introduction | THUMDER

[![Schematic DLX](https://raw.githubusercontent.com/nonodev96/THUMDER/dev/assets/Datapath_Schematic.svg](./assets/Datapath_Schematic.svg)
![Datapath Schematic](./assets/Datapath_Schematic.svg)

[![License](http://img.shields.io/badge/Licence-MIT-brightgreen.svg)](LICENSE.md)

Expand Down
2 changes: 2 additions & 0 deletions UML/6.5.ActivityDiagram-Simution.puml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ skinparam conditionStyle inside
mostrara una notificación cuando el servidor haya
confirmado y respondido con el código a simular.
end note
' TODO
' Mostrar error con mensaje
}


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"pixi.js-mouse": "^1.1.6",
"rxjs": "6.6.6",
"string-to-argv": "1.0.0",
"thumder-ontology": "1.0.9",
"thumder-ontology": "1.1.1",
"xterm": "4.13.0",
"xterm-addon-attach": "0.6.0",
"xterm-addon-fit": "0.5.0",
Expand Down
16 changes: 16 additions & 0 deletions src/app/Utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { MachineService } from "./__core/machine/machine.service";


export namespace Utils {

export function hexadecimalToDecimal(value): number {
return parseInt(value, 16);
}

export function orderJSONBy(array, selector, desc = false) {
return [...array].sort((a, b) => {
if (desc) {
Expand Down Expand Up @@ -93,4 +98,15 @@ export namespace Utils {
}
return true;
}

export function toBase(base, num) {
const largest_power = ~~(Math.log(num) / Math.log(base));
const result = [];
for (let pow = largest_power; pow >= 0; pow--) {
const digit = ~~(num / base ** pow);
num -= digit * base ** pow;
result.push(digit);
}
return result;
}
}
7 changes: 6 additions & 1 deletion src/app/__core/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
export class Int32 {
// Se almacena en decimal, siempre
private _value: number = 0;

get value(): number {
return this._value;
}

// set value(newValue: number) {
// if (newValue < -2147483648 || newValue > 2147483647 || Math.round(newValue) !== newValue) throw new Error("Rango no permitido");
// this._value = newValue;
// }
set value(newValue: number) {
if (newValue < -2147483648 || newValue > 2147483647 || Math.round(newValue) !== newValue) throw new Error("Rango no permitido");
if (newValue < 0 || newValue > 4294967295 || Math.round(newValue) !== newValue) throw new Error("Rango no permitido");
this._value = newValue;
}
}
Expand Down
Loading

0 comments on commit e67b35f

Please sign in to comment.