~hokiegeek/biologist-web

ref: 6f953efc1284177078b3366fd8ee300fb26775af biologist-web/src/app/petridish/petridish.component.html -rw-r--r-- 4.3 KiB
6f953efcHokieGeek Fixed casting error 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<div class="m-2 d-flex flex-row">
    <!-- TODO: Add delete button -->
    <div class="d-flex flex-column">
        <span *ngIf="creating">
            <div class="d-flex flex-row mb-1">
                <div class="input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text">Rows</span>
                    </div>
                    <input type="text" class="form-control" size="3" placeholder="rows" [(ngModel)]="experiment.rows" (change)="createSeed()" aria-describedby="basic-addon1">
                </div>
                <div class="input-group ml-1">
                    <div class="input-group-prepend">
                        <span class="input-group-text">Cols</span>
                    </div>
                    <input type="text" class="form-control" size="3" placeholder="columns" [(ngModel)]="experiment.columns" (change)="createSeed()" aria-describedby="basic-addon1">
                </div>
            </div>
            <div class="d-flex flex-row mb-1 align-self-stretch">
                <div class="input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text">Cells</span>
                    </div>
                    <span class="range rounded-right">
                        <input type="range" min="2" max="6" [(ngModel)]="cellSize" [title]="cellSize" />
                    </span>
                </div>
                <div class="input-group ml-1">
                    <div class="input-group-prepend">
                        <span class="input-group-text">Density</span>
                    </div>
                    <span class="range rounded-right">
                        <input type="range" min="10" max="90" [(ngModel)]="experiment.initialDensity" (change)="createSeed()" [title]="experiment.initialDensity" />
                    </span>
                </div>
            </div>
            <!--button type="button"
                    class="btn btn-secondary align-self-stretch"
                    title="Regenerate seed"
                    (click)="createSeed()">&#x21BA;</button-->
            <button type="button" class="btn btn-outline-info w-100" (click)="analyze()">Analyze</button>
        </span>
        <div class="d-flex flex-row mt-1">
            <app-board [cols]="experiment.columns" [rows]="experiment.rows"
                   [cellSize]="cellSize" [cellSpacing]="cellSpacing"
                   [cells]="getCurrentGeneration().living">
            </app-board>
            <div class="d-flex align-items-start flex-column pb-2 ml-1">
                <div class="h-100 mb-auto">
                    <app-culture-info [generation]="getCurrentGeneration()"
                                  [boardWidth]="experiment.columns"
                                  [boardHeight]="experiment.rows"
                                  (close)="destroy()">
                    </app-culture-info>
                </div>
                <div *ngIf="!creating" class="mt-1 playback-controls align-items-end w-100">
                    <div>
                        <span *ngIf="!playing">
                            <span (click)="nav('-', 20)" title="Move backwards 20 generations">&#x25c5;</span>
                            <span (click)="nav('-', 1)" title="Move backwards 1 generation">&#x25c2;</span>
                        </span>
                        <span (click)="togglePlaying()">
                            <span *ngIf="!playing" title="Play">&#x25ba;</span>
                            <span *ngIf="playing" title="Pause">▮▮</span>
                        </span>
                        <span *ngIf="!playing">
                            <span (click)="nav('+', 1)" title="Move forward 1 generation">&#x25b8;</span>
                            <span (click)="nav('+', 20)" title="Move forward 20 generations">&#x25bb;</span>
                        </span>
                    </div>
                    <div class="speed">
                        <span (click)="speed('-', 10)" title="decrease rate">-</span>
                        <span>{{playRateMs}}ms</span>
                        <span (click)="speed('+', 10)" title="increase rate">+</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>