Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Alejandro Martínez Muñoz
/
ProyectoRobotAmbientales
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4b786a5e
authored
Apr 23, 2024
by
Alex
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
test
parent
735a070f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
7 deletions
src/app/app.component.spec.ts
src/app/crear-pedido-dialog/crear-pedido-dialog.component.ts
src/app/mapa.service.ts
src/app/app.component.spec.ts
View file @
4b786a5e
...
...
@@ -19,13 +19,13 @@ describe('AppComponent', () => {
const
app
=
fixture
.
componentInstance
;
expect
(
app
).
toBeTruthy
();
});
/*
it(`should have as title 'ProyectoRobotAmbientales'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('ProyectoRobotAmbientales');
});
*/
it
(
'should render title'
,
()
=>
{
const
fixture
=
TestBed
.
createComponent
(
AppComponent
);
fixture
.
detectChanges
();
...
...
src/app/crear-pedido-dialog/crear-pedido-dialog.component.ts
View file @
4b786a5e
...
...
@@ -29,7 +29,7 @@ constructor(private pedidoService: ServicioPedidoService) {}
*
* @param event Objeto que contiene el ID del bloque y sus coordenadas de fila y columna.
*/
enCeldaSeleccionada
(
event
:
{
id
:
string
,
row
:
number
,
col
:
number
}):
void
{
enCeldaSeleccionada
(
event
:
{
id
:
string
,
row
:
number
,
col
:
number
}):
void
{
if
(
!
this
.
puntoDeRecogida
)
{
this
.
puntoDeRecogida
=
event
;
// Actualiza los estilos de resaltado aquí si es necesario
...
...
@@ -68,15 +68,13 @@ enCeldaSeleccionada(event: {id: string, row: number, col: number}): void {
confirmarSeleccion
():
void
{
if
(
this
.
puntoDeRecogida
&&
this
.
puntoDeEntrega
)
{
// Genera un ID único para el pedido, por ejemplo usando la fecha y hora actual.
// Esto es solo un ejemplo y puede que necesites una mejor generación de IDs según tu caso de uso.
const
uniqueId
=
Date
.
now
().
toString
();
const
nuevoPedido
:
Pedido
=
{
id
:
uniqueId
,
puntoDeRecogida
:
this
.
puntoDeRecogida
,
puntoDeEntrega
:
this
.
puntoDeEntrega
// ... otras propiedades necesarias del pedido ...
};
};
this
.
pedidoService
.
agregarPedido
(
nuevoPedido
);
this
.
resetearSeleccion
();
// Resetear selección tras confirmar el pedido
}
...
...
src/app/mapa.service.ts
View file @
4b786a5e
...
...
@@ -38,7 +38,7 @@ export class MapaService {
}
/**
* @brief Obtiene la ruta de imagen asociada con un ID de
bloque específico
.
* @brief Obtiene la ruta de imagen asociada con un ID de
la casilla específica
.
*
* Este método público accede al mapa de ID de bloque a ruta de imagen y
* devuelve la ruta de la imagen correspondiente.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment