Skip to content
Permalink
Browse files

Updated evaluation module to most recent version.

  • Loading branch information...
ppanopticon committed Apr 11, 2017
1 parent 6145152 commit 276e3b76e569a0661e35b416b4e88693a18d9389
@@ -7,7 +7,9 @@
"_name" : "3D model / Airplanes",
"_description" : "Look for 3D models of airplanes.",
"_k" : 15,
"_material" : []
"_material" : [
{"_name" : "Test", "_url" : "http://www.test.ch", "_description" : "This is a description."}
]
},
{
"_id" : 2,
@@ -35,6 +35,7 @@
"three-obj-loader": "^1.0.2",
"three-stl-loader": "^1.0.4",
"three-trackballcontrols": "^0.0.5",
"ts-md5": "^1.2.0",
"typescript": "^2.2.2",
"zone.js": "^0.8.4"
},
@@ -1,8 +1,9 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import {ObjectdetailsComponent} from "./objectdetails/objectdetails.component";
import {GalleryComponent} from "./gallery/gallery.component";
import {EvaluationComponent} from "./evaluation/evaluation.component";
import { ObjectdetailsComponent } from "./objectdetails/objectdetails.component";
import { GalleryComponent } from "./gallery/gallery.component";
import { EvaluationSelectionComponent } from "./evaluation/evaluation-selection.component";
import { EvaluationComponent } from "./evaluation/evaluation.component";

/**
* Defines the application's routes.
@@ -12,7 +13,8 @@ const appRoutes: Routes = [
path: 'mediaobject/:objectId',
component: ObjectdetailsComponent
},
{ path: 'evaluation', component: EvaluationComponent },
{ path: 'evaluation', component: EvaluationSelectionComponent },
{ path: 'evaluation/:template/:participant', component: EvaluationComponent },
{ path: 'gallery', component: GalleryComponent },
{ path: '', redirectTo: '/gallery', pathMatch: 'full' }
];
@@ -0,0 +1,64 @@
import {Component} from "@angular/core";
import {Router} from "@angular/router";
import {Md5} from 'ts-md5/dist/md5'
import {MdSnackBar} from "@angular/material";

@Component({
moduleId: module.id,
selector: 'evaluation-selection',
template: `
<md-card class="evaluation-card">
<md-card-header>
<md-card-title>Vitrivr NG: Evaluation</md-card-title>
<md-card-subtitle>Please specify an evaluation template...</md-card-subtitle>
</md-card-header>
<md-card-content>
<md-input-container style="width:100%;">
<input mdInput placeholder="http://www.example.com/evaluation.json" [(ngModel)]="urlFieldValue"/>
</md-input-container>
<md-input-container style="width:100%;">
<input mdInput placeholder="Max Muster" [(ngModel)]="nameFieldValue"/>
</md-input-container>
</md-card-content>
<md-card-actions>
<button md-button (click)="onSelectClick()">SELECT</button>
<button md-button (click)="onAbortClick()">ABORT</button>
</md-card-actions>
</md-card>
<div>
</div>
`
})
export class EvaluationSelectionComponent {
/** Model for the URL field. Contains the URL to the evaluation template. */
public urlFieldValue : string;

/** Model for the name field. Contains the name of the participant. */
public nameFieldValue : string;

/**
* Default constructor; Injects Router.
* @param _router
*/
constructor(private _router: Router, private snackBar: MdSnackBar) {}

/**
* Invoked whenever the 'Select' button is clicked.
*/
public onSelectClick() {
if (this.urlFieldValue && this.nameFieldValue && this.urlFieldValue.length > 0 && this.nameFieldValue.length > 0) {
this._router.navigate(['/evaluation/' + btoa(this.urlFieldValue) + '/' + Md5.hashStr(this.nameFieldValue)]);
} else {
this.snackBar.open('Please specify a valid URL and your name.', null, {duration: 2000});
}
}

/**
* Invoked whenever the 'Abort' button is clicked.
*/
public onAbortClick() {
this._router.navigate(['/gallery']);
}
}
@@ -1,28 +1,27 @@
<div style="padding:10px;">

<div style="display:flex;">
<div>
<md-input-container>
<label> </label><input mdInput placeholder="Name" [(ngModel)]="nameFieldValue">
</md-input-container>
<button md-button (click)="onEvaluationStartButtonClick()" [disabled]="!canBeStarted()">Start evaluation</button>
<button md-button (click)="onResultsAcceptButtonClick()" [disabled]="!canBeAccepted()">Accept resultset</button>
<button md-button (click)="onEvaluationStopButtonClick()" [disabled]="!canBeStopped()">Finish evaluation</button>

<md-chip-list>
<md-chip (click)="onScenarioClick()"><strong>Scenario:</strong> {{scenarioDescriptor()}}</md-chip>
<md-chip><strong>Status:</strong> {{stateDescriptor()}}</md-chip>
<md-chip><strong>Results:</strong> {{numberOfResults()}}</md-chip>
</md-chip-list>
</div>

<div class="spacer-flex"></div>

<div>
<button md-icon-button (click)="onDownloadButtonClick()" mdTooltip="Download all results."><md-icon>cloud_download</md-icon></button>
<button md-icon-button (click)="onEvaluationStartButtonClick()" [disabled]="!canBeStarted()" mdTooltip="Start scenario"><md-icon>flag</md-icon></button>
<button md-icon-button (click)="onResultsAcceptButtonClick()" [disabled]="!canBeAccepted()" mdTooltip="Accept resultset"><md-icon>thumb_up</md-icon></button>
<button md-icon-button (click)="onEvaluationStopButtonClick()" [disabled]="!canBeStopped()" mdTooltip="Complete scenario"><md-icon>done</md-icon></button>
</div>

<div class="spacer-tiny"></div>
<div class="spacer-small"></div>


<md-chip-list>
<md-chip><strong>Status:</strong> {{stateDescriptor()}}</md-chip>
<md-chip><strong>Results:</strong> {{numberOfResults()}}</md-chip>
</md-chip-list>
<div>
<button md-icon-button (click)="onDownloadButtonClick()" mdTooltip="Download all results"><md-icon>cloud_download</md-icon></button>
</div>
</div>

<hr/>
Oops, something went wrong.

0 comments on commit 276e3b7

Please sign in to comment.
You can’t perform that action at this time.