Skip to content

Commit

Permalink
update code
Browse files Browse the repository at this point in the history
  • Loading branch information
ybbond2019 committed Feb 5, 2020
1 parent 466bf1e commit 438b43e
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 39 deletions.
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"@types/jest": "^24.9.1",
"@types/lodash": "^4.14.149",
"@types/node": "^12.12.26",
"@types/react": "^16.9.19",
"@types/react-dom": "^16.9.5",
"lodash": "^4.17.15",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-scripts": "3.3.1",
Expand Down
38 changes: 2 additions & 36 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,4 @@
.App {
text-align: center;
}

.App-logo {
height: 40vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
width: 800px;
margin: 0 auto;
}
11 changes: 8 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ import React from 'react';
import logo from './logo.svg';
import 'semantic-ui-css/semantic.min.css'
import Logs from './Component/Logs'
import { } from 'lodash'
import './App.css';

const App = () => {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
{/* <img src={logo} className="App-logo" alt="logo" /> */}
{/* <p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
</p> */}
<a
className="App-link"
href="https://reactjs.org"
Expand All @@ -20,6 +21,10 @@ const App = () => {
>
Learn React
</a>
<br />
<br />
<br />
<br />
<Logs />
</header>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/Component/Logs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import * as React from 'react';
import ButtonExampleButton from '../../universal/ButtonExampleButton'
import { Button, Icon } from 'semantic-ui-react'
import LogsTable from '../../universal/LogsTable';

export interface ILogsProps {
}

export default function Logs(props: ILogsProps) {
return (
<div>
<LogsTable />

<ButtonExampleButton />

<Button animated>
Expand Down
24 changes: 24 additions & 0 deletions src/scenario.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

export interface ITest {
simulationRuns: ISimulationRuns[]
scenarios: IScenarios[]
}

export interface IScenarios {
scenarioId: string;
maxnumberOfStops: number;
maxRunningTime: number
}

export interface ISimulationRuns {
startTime: number;
endTime: number;
scenarioId: string,
carBuild: string,
result: IResult
}

export interface IResult {
numberOfStops: number
hasCollision: boolean
}
68 changes: 68 additions & 0 deletions src/universal/LogsTable.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import React from 'react'
import { Icon, Label, Menu, Table } from 'semantic-ui-react'

const LogsTable = () => (
<Table celled>
<Table.Header>
<Table.Row>
<Table.HeaderCell>scenarioId </Table.HeaderCell>
<Table.HeaderCell>carBuild </Table.HeaderCell>
<Table.HeaderCell>startTime </Table.HeaderCell>
<Table.HeaderCell>runningTime / maxRunningTime </Table.HeaderCell>
<Table.HeaderCell>numberOfStops / maxNumberOfStops </Table.HeaderCell>
<Table.HeaderCell>hasCollision </Table.HeaderCell>
<Table.HeaderCell>doesScenarioPass </Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
</Table.Row>
</Table.Body>

<Table.Footer>
<Table.Row>
<Table.HeaderCell colSpan='7'>
<Menu floated='right' pagination>
<Menu.Item as='a' icon>
<Icon name='chevron left' />
</Menu.Item>
<Menu.Item as='a'>1</Menu.Item>
<Menu.Item as='a'>2</Menu.Item>
<Menu.Item as='a'>3</Menu.Item>
<Menu.Item as='a'>4</Menu.Item>
<Menu.Item as='a' icon>
<Icon name='chevron right' />
</Menu.Item>
</Menu>
</Table.HeaderCell>
</Table.Row>
</Table.Footer>
</Table>
)

export default LogsTable

0 comments on commit 438b43e

Please sign in to comment.