move some files around to confuse everyone
|
|
@ -2,13 +2,13 @@ import { ReactElement, useCallback, useEffect, useMemo, useRef, useState } from
|
|||
|
||||
import { handleInputEvent, initialize, RuntimeError } from "../statecharts/interpreter";
|
||||
import { BigStep, RT_Event } from "../statecharts/runtime_types";
|
||||
import { InsertMode, VisualEditor, VisualEditorState } from "../VisualEditor/VisualEditor";
|
||||
import { InsertMode, VisualEditor, VisualEditorState } from "./VisualEditor/VisualEditor";
|
||||
import { getSimTime, getWallClkDelay, TimeMode } from "../statecharts/time";
|
||||
|
||||
import "../index.css";
|
||||
import "./App.css";
|
||||
|
||||
import { TopPanel } from "./TopPanel";
|
||||
import { TopPanel } from "./TopPanel/TopPanel";
|
||||
import { ShowAST, ShowInputEvents, ShowInternalEvents, ShowOutputEvents } from "./ShowAST";
|
||||
import { parseStatechart } from "../statecharts/parser";
|
||||
import { getKeyHandler } from "./shortcut_handler";
|
||||
|
|
@ -18,7 +18,7 @@ import { PersistentDetails } from "./PersistentDetails";
|
|||
import { DigitalWatchPlant } from "@/Plant/DigitalWatch/DigitalWatch";
|
||||
import { DummyPlant } from "@/Plant/Dummy/Dummy";
|
||||
import { Plant } from "@/Plant/Plant";
|
||||
import { usePersistentState } from "@/util/persistent_state";
|
||||
import { usePersistentState } from "@/App/persistent_state";
|
||||
import { RTHistory } from "./RTHistory";
|
||||
import { detectConnections } from "@/statecharts/detect_connections";
|
||||
import { MicrowavePlant } from "@/Plant/Microwave/Microwave";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { usePersistentState } from "@/util/persistent_state"
|
||||
import { usePersistentState } from "@/App/persistent_state"
|
||||
import { DetailsHTMLAttributes, PropsWithChildren } from "react";
|
||||
|
||||
type Props = {
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
|
|
@ -1,7 +1,7 @@
|
|||
import { Dispatch, memo, Ref, SetStateAction, useCallback } from "react";
|
||||
import { Statechart, stateDescription } from "../statecharts/abstract_syntax";
|
||||
import { BigStep, Environment, Mode, RaisedEvent, RT_Event } from "../statecharts/runtime_types";
|
||||
import { formatTime } from "./util";
|
||||
import { formatTime } from "../util/util";
|
||||
import { TimeMode } from "../statecharts/time";
|
||||
import { TraceItem, TraceState } from "./App";
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ export const ShowAST = memo(function ShowASTx(props: {root: ConcreteState | Unst
|
|||
});
|
||||
|
||||
import BoltIcon from '@mui/icons-material/Bolt';
|
||||
import { KeyInfoHidden, KeyInfoVisible } from "./KeyInfo";
|
||||
import { KeyInfoHidden, KeyInfoVisible } from "./TopPanel/KeyInfo";
|
||||
import { memo, useEffect } from "react";
|
||||
|
||||
export function ShowInputEvents({inputEvents, onRaise, disabled, showKeys}: {inputEvents: EventTrigger[], onRaise: (e: string, p: any) => void, disabled: boolean, showKeys: boolean}) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Dispatch, memo, ReactElement, SetStateAction } from "react";
|
||||
import { KeyInfoHidden, KeyInfoVisible } from "../KeyInfo";
|
||||
import { InsertMode } from "@/VisualEditor/VisualEditor";
|
||||
import { HistoryIcon, PseudoStateIcon, RountangleIcon } from "../Icons";
|
||||
import { KeyInfoHidden, KeyInfoVisible } from "./KeyInfo";
|
||||
import { InsertMode } from "@/App/VisualEditor/VisualEditor";
|
||||
import { HistoryIcon, PseudoStateIcon, RountangleIcon } from "./Icons";
|
||||
|
||||
import TrendingFlatIcon from '@mui/icons-material/TrendingFlat';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { Dispatch, memo, ReactElement, SetStateAction, useCallback, useEffect, useState } from "react";
|
||||
import { TimerElapseEvent, Timers } from "../statecharts/runtime_types";
|
||||
import { getSimTime, setPaused, setRealtime, TimeMode } from "../statecharts/time";
|
||||
import { TimerElapseEvent, Timers } from "../../statecharts/runtime_types";
|
||||
import { getSimTime, setPaused, setRealtime, TimeMode } from "../../statecharts/time";
|
||||
import { InsertMode } from "../VisualEditor/VisualEditor";
|
||||
import { About } from "./About";
|
||||
import { EditHistory, TraceState } from "./App";
|
||||
import { About } from "../Modals/About";
|
||||
import { EditHistory, TraceState } from "../App";
|
||||
import { KeyInfoHidden, KeyInfoVisible } from "./KeyInfo";
|
||||
import { UndoRedoButtons } from "./TopPanel/UndoRedoButtons";
|
||||
import { ZoomButtons } from "./TopPanel/ZoomButtons";
|
||||
import { formatTime } from "./util";
|
||||
import { UndoRedoButtons } from "./UndoRedoButtons";
|
||||
import { ZoomButtons } from "./ZoomButtons";
|
||||
import { formatTime } from "../../util/util";
|
||||
|
||||
import AccessAlarmIcon from '@mui/icons-material/AccessAlarm';
|
||||
import CachedIcon from '@mui/icons-material/Cached';
|
||||
|
|
@ -17,8 +17,8 @@ import PauseIcon from '@mui/icons-material/Pause';
|
|||
import PlayArrowIcon from '@mui/icons-material/PlayArrow';
|
||||
import SkipNextIcon from '@mui/icons-material/SkipNext';
|
||||
import StopIcon from '@mui/icons-material/Stop';
|
||||
import { InsertModes } from "./TopPanel/InsertModes";
|
||||
import { usePersistentState } from "@/util/persistent_state";
|
||||
import { InsertModes } from "./InsertModes";
|
||||
import { usePersistentState } from "@/App/persistent_state";
|
||||
|
||||
export type TopPanelProps = {
|
||||
trace: TraceState | null,
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { memo } from "react";
|
||||
import { KeyInfoHidden, KeyInfoVisible } from "../KeyInfo";
|
||||
import { KeyInfoHidden, KeyInfoVisible } from "./KeyInfo";
|
||||
|
||||
import UndoIcon from '@mui/icons-material/Undo';
|
||||
import RedoIcon from '@mui/icons-material/Redo';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { ZOOM_MAX, ZOOM_MIN, ZOOM_STEP } from "@/VisualEditor/parameters";
|
||||
import { ZOOM_MAX, ZOOM_MIN, ZOOM_STEP } from "@/App/VisualEditor/parameters";
|
||||
import { Dispatch, memo, SetStateAction, useEffect } from "react";
|
||||
import { KeyInfoHidden, KeyInfoVisible } from "../KeyInfo";
|
||||
import { KeyInfoHidden, KeyInfoVisible } from "./KeyInfo";
|
||||
|
||||
import ZoomInIcon from '@mui/icons-material/ZoomIn';
|
||||
import ZoomOutIcon from '@mui/icons-material/ZoomOut';
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { memo } from "react";
|
||||
import { Arrow, ArrowPart } from "../statecharts/concrete_syntax";
|
||||
import { Arrow, ArrowPart } from "../../statecharts/concrete_syntax";
|
||||
import { ArcDirection, euclideanDistance } from "./geometry";
|
||||
import { CORNER_HELPER_RADIUS } from "./parameters";
|
||||
import { arraysEqual } from "@/App/util";
|
||||
import { arraysEqual } from "@/util/util";
|
||||
|
||||
|
||||
export const ArrowSVG = memo(function(props: { arrow: Arrow; selected: ArrowPart[]; error: string; highlight: boolean; fired: boolean; arc: ArcDirection; initialMarker: boolean }) {
|
||||
|
|
@ -3,7 +3,7 @@ import { rountangleMinSize } from "./VisualEditor";
|
|||
import { Vec2D } from "./geometry";
|
||||
import { RectHelper } from "./RectHelpers";
|
||||
import { memo } from "react";
|
||||
import { arraysEqual } from "@/App/util";
|
||||
import { arraysEqual } from "@/util/util";
|
||||
|
||||
export const DiamondShape = memo(function DiamondShape(props: {size: Vec2D, extraAttrs: object}) {
|
||||
const minSize = rountangleMinSize(props.size);
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { memo } from "react";
|
||||
import { RectSide } from "../statecharts/concrete_syntax";
|
||||
import { RectSide } from "../../statecharts/concrete_syntax";
|
||||
import { Vec2D } from "./geometry";
|
||||
import { CORNER_HELPER_OFFSET, CORNER_HELPER_RADIUS } from "./parameters";
|
||||
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import { memo } from "react";
|
||||
import { Rountangle, RectSide } from "../statecharts/concrete_syntax";
|
||||
import { Rountangle, RectSide } from "../../statecharts/concrete_syntax";
|
||||
import { ROUNTANGLE_RADIUS } from "./parameters";
|
||||
import { RectHelper } from "./RectHelpers";
|
||||
import { rountangleMinSize } from "./VisualEditor";
|
||||
import { arraysEqual } from "@/App/util";
|
||||
import { arraysEqual } from "@/util/util";
|
||||
|
||||
|
||||
export const RountangleSVG = memo(function RountangleSVG(props: {rountangle: Rountangle; selected: RectSide[]; highlight: RectSide[]; error?: string; active: boolean; }) {
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { TextDialog } from "@/App/TextDialog";
|
||||
import { TraceableError } from "..//statecharts/parser";
|
||||
import {Text} from "../statecharts/concrete_syntax";
|
||||
import { TextDialog } from "@/App/Modals/TextDialog";
|
||||
import { TraceableError } from "../../statecharts/parser";
|
||||
import {Text} from "../../statecharts/concrete_syntax";
|
||||
import { Dispatch, memo, ReactElement, SetStateAction } from "react";
|
||||
|
||||
export const TextSVG = memo(function TextSVG(props: {text: Text, error: TraceableError|undefined, selected: boolean, highlight: boolean, onEdit: (text: Text, newText: string) => void, setModal: Dispatch<SetStateAction<ReactElement|null>>}) {
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import { ClipboardEvent, Dispatch, memo, ReactElement, SetStateAction, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
|
||||
import { Statechart } from "../statecharts/abstract_syntax";
|
||||
import { Arrow, ArrowPart, Diamond, History, Rountangle, RectSide, Text } from "../statecharts/concrete_syntax";
|
||||
import { parseStatechart, TraceableError } from "../statecharts/parser";
|
||||
import { Statechart } from "../../statecharts/abstract_syntax";
|
||||
import { Arrow, ArrowPart, Diamond, History, Rountangle, RectSide, Text } from "../../statecharts/concrete_syntax";
|
||||
import { parseStatechart, TraceableError } from "../../statecharts/parser";
|
||||
import { ArcDirection, Line2D, Rect2D, Vec2D, addV2D, arcDirection, area, getBottomSide, getLeftSide, getRightSide, getTopSide, isEntirelyWithin, normalizeRect, scaleV2D, subtractV2D, transformLine, transformRect } from "./geometry";
|
||||
import { MIN_ROUNTANGLE_SIZE } from "./parameters";
|
||||
import { getBBoxInSvgCoords } from "./svg_helper";
|
||||
|
|
@ -11,12 +11,12 @@ import { RountangleSVG } from "./RountangleSVG";
|
|||
import { TextSVG } from "./TextSVG";
|
||||
import { DiamondSVG } from "./DiamondSVG";
|
||||
import { HistorySVG } from "./HistorySVG";
|
||||
import { Connections, detectConnections } from "../statecharts/detect_connections";
|
||||
import { Connections, detectConnections } from "../../statecharts/detect_connections";
|
||||
|
||||
import "./VisualEditor.css";
|
||||
import { TraceState } from "@/App/App";
|
||||
import { Mode } from "@/statecharts/runtime_types";
|
||||
import { arraysEqual, objectsEqual, setsEqual } from "@/App/util";
|
||||
import { arraysEqual, objectsEqual, setsEqual } from "@/util/util";
|
||||
|
||||
export type VisualEditorState = {
|
||||
rountangles: Rountangle[];
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { RectSide } from "../statecharts/concrete_syntax";
|
||||
import { RectSide } from "../../statecharts/concrete_syntax";
|
||||
|
||||
export type Vec2D = {
|
||||
x: number;
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Dispatch, SetStateAction } from "react";
|
||||
import { InsertMode } from "../VisualEditor/VisualEditor";
|
||||
import { InsertMode } from "./VisualEditor/VisualEditor";
|
||||
|
||||
export function getKeyHandler(setMode: Dispatch<SetStateAction<InsertMode>>) {
|
||||
return function onKeyDown(e: KeyboardEvent) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Rect2D, Vec2D, Line2D, euclideanDistance, intersectLines, isWithin, lineBBox, subtractV2D } from "../VisualEditor/geometry";
|
||||
import { ARROW_SNAP_THRESHOLD, HISTORY_RADIUS, TEXT_SNAP_THRESHOLD } from "../VisualEditor/parameters";
|
||||
import { sides, VisualEditorState } from "../VisualEditor/VisualEditor";
|
||||
import { Rect2D, Vec2D, Line2D, euclideanDistance, intersectLines, isWithin, lineBBox, subtractV2D } from "../App/VisualEditor/geometry";
|
||||
import { ARROW_SNAP_THRESHOLD, HISTORY_RADIUS, TEXT_SNAP_THRESHOLD } from "../App/VisualEditor/parameters";
|
||||
import { sides, VisualEditorState } from "../App/VisualEditor/VisualEditor";
|
||||
|
||||
export type Rountangle = {
|
||||
uid: string;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { VisualEditorState } from "@/VisualEditor/VisualEditor";
|
||||
import { VisualEditorState } from "@/App/VisualEditor/VisualEditor";
|
||||
import { findNearestArrow, findNearestHistory, findNearestSide, findRountangle, RectSide } from "./concrete_syntax";
|
||||
|
||||
export type Connections = {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { ConcreteState, HistoryState, OrState, UnstableState, Statechart, stateDescription, Transition } from "./abstract_syntax";
|
||||
import { Rountangle } from "./concrete_syntax";
|
||||
import { isEntirelyWithin, Rect2D } from "../VisualEditor/geometry";
|
||||
import { isEntirelyWithin, Rect2D } from "../App/VisualEditor/geometry";
|
||||
import { Action, EventTrigger, Expression, ParsedText } from "./label_ast";
|
||||
import { parse as parseLabel, SyntaxError } from "./label_parser";
|
||||
import { Connections } from "./detect_connections";
|
||||
import { HISTORY_RADIUS } from "../VisualEditor/parameters";
|
||||
import { VisualEditorState } from "@/VisualEditor/VisualEditor";
|
||||
import { memoize } from "@/App/util";
|
||||
import { HISTORY_RADIUS } from "../App/VisualEditor/parameters";
|
||||
import { VisualEditorState } from "@/App/VisualEditor/VisualEditor";
|
||||
import { memoize } from "@/util/util";
|
||||
|
||||
export type TraceableError = {
|
||||
shapeUid: string;
|
||||
|
|
|
|||