Simulation wire
This commit is contained in:
parent
ef938ab84a
commit
fb55999d47
@ -61,6 +61,11 @@ const InitPlayer: React.FC<Player> = ({ Click, TimeStep, TimeEnd, onTimeUpdate }
|
||||
return (
|
||||
<div className="bg-slate-600 p-4 rounded-md w-full max-w-md mx-auto">
|
||||
<div className="flex items-center space-x-4">
|
||||
<a href='/pages/simulations'
|
||||
className={`text-white p-2 rounded-md bg-green-600`}
|
||||
>
|
||||
{"Назад"}
|
||||
</a>
|
||||
{/* Кнопка старт/стоп симуляции */}
|
||||
<button
|
||||
onClick={handlePlayPause}
|
||||
|
@ -8,38 +8,37 @@ const Simulations: React.FC = () => {
|
||||
const [activeSimulationWindow, setActiveSimulationWindow] = useState(false);
|
||||
const [mathServer, setMathServer] = useState("");
|
||||
const [simulationDto, setSimulationDto] = useState({});
|
||||
const ActiveSimulation = (value: boolean) => setActiveSimulationWindow(value);
|
||||
|
||||
const ActiveSimulation = (value: boolean) => {
|
||||
// Используя mathServer - отправляем массив данных
|
||||
|
||||
|
||||
// Устанавливает окно симуляции
|
||||
setActiveSimulationWindow(value);
|
||||
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
// let value = SendRequestGetLink()
|
||||
// value.then(e => {
|
||||
// if (e.status == 1002){
|
||||
// e.json().then( res =>{
|
||||
// if (res.link) {
|
||||
// setMathServer(res.link)
|
||||
// }})}
|
||||
// })
|
||||
setMathServer("localhost:10000/run/sumulation")
|
||||
|
||||
}, [])
|
||||
|
||||
// => localhost:10000/run/sumulation
|
||||
|
||||
return (
|
||||
<div className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]">
|
||||
{/* TEST : MATH SERVER ENDPOINT */}
|
||||
{/* <p>{mathServer}</p> */}
|
||||
<main id="modal-root">
|
||||
{activeSimulationWindow ?
|
||||
{
|
||||
activeSimulationWindow ?
|
||||
<div>
|
||||
<InitPlayer
|
||||
Click={() => {}}
|
||||
TimeEnd={100}
|
||||
TimeStep={1}
|
||||
></InitPlayer>
|
||||
</div> : <ThreeJsInstance Click={ActiveSimulation}/>}
|
||||
/>
|
||||
</div> : <ThreeJsInstance
|
||||
Click={ActiveSimulation}
|
||||
/>
|
||||
}
|
||||
</main>
|
||||
|
||||
<footer className="row-start-3 flex gap-6 flex-wrap items-center justify-center">
|
||||
</footer>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user