forked from kruzhok-team/lapki-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Полный рефакторинг работы с данными, теперь разные сущности отвечают за работу с моделью данных и за работу с их отображением на канвасе Возможность редактирования нескольких машин состояний одновременно Количество редакторов теперь не ограничено Теперь к каждому канвасу прикрепляется CanvasController, отвечающий за данные для отрисовки Появился класс ModelController, который посредством сигналов передает события об изменениях в данных в CanvasController, который на эти данные подписаны Появился схемотехнический экран, содержащий информацию обо всех компонентах каждой МС --------- Co-authored-by: XidFanSan <fedya4444baskov.ru@gmail.com> Co-authored-by: Roundabout1 <86153878+Roundabout1@users.noreply.github.com>
- Loading branch information
Showing
125 changed files
with
8,679 additions
and
3,726 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,236 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"> | ||
|
||
<key id="gFormat" for="graphml" attr.name="format" | ||
attr.type="string"/> | ||
<key id="dName" for="node" attr.name="name" attr.type="string"/> | ||
<key id="dVertex" for="node" attr.name="vertex" attr.type="string"/> | ||
<key id="dStateMachine" for="graph" attr.name="stateMachine" attr.type="string"/> | ||
<key id="dGeometry" for="node" attr.name="geometry"/> | ||
<key id="dLabelGeometry" for="edge" attr.name="labelGeometry"/> | ||
<key id="dPivot" for="edge" attr.name="pivot" attr.type="string"/> | ||
<key id="dNote" for="node" attr.name="note" attr.type="string"/> | ||
<key id="dData" for="node" attr.name="data" attr.type="string"/> | ||
<key id="dData" for="edge" attr.name="data" attr.type="string"/> | ||
<key id="dColor" for="edge" attr.name="color" attr.type="string"/> | ||
|
||
<data key="gFormat">Cyberiada-GraphML-1.0</data> | ||
|
||
<graph id="G" edgedefault="directed"> | ||
<data key="dStateMachine"/> | ||
<node id="coreMeta"> | ||
<data key="dNote">formal</data> | ||
<data key="dName">CGML_META</data> | ||
<data key="dData">platform/ ArduinoUno | ||
|
||
standardVersion/ 1.0 | ||
|
||
name/ Arduino Blinker | ||
|
||
author/ Lapki IDE TEAM | ||
|
||
description/ Включение и выключение лампочки по таймеру | ||
|
||
</data> | ||
</node> | ||
<node id="cLED1"> | ||
<data key="dNote">formal</data> | ||
<data key="dName"> CGML_COMPONENT </data> | ||
<data key="dData">id/ LEDG1 | ||
|
||
type/ LED | ||
|
||
name/ Светодиод | ||
|
||
description/ Встроенный в плату светодиод, чтобы им мигать | ||
|
||
pin/ 12 | ||
|
||
</data> | ||
</node> | ||
|
||
<node id="ctimer1"> | ||
<data key="dNote">formal</data> | ||
<data key="dName"> CGML_COMPONENT </data> | ||
<data key="dData">id/ timerG1 | ||
|
||
type/ Timer | ||
|
||
name/ Таймер | ||
|
||
description/ Программный таймер. | ||
|
||
</data> | ||
</node> | ||
|
||
<node id="init"> | ||
<data key="dVertex">initial</data> | ||
<data key="dGeometry"> | ||
<point x="20" y="30"> </point> | ||
</data> | ||
</node> | ||
|
||
<node id="diod1"> | ||
<data key="dName">Включен</data> | ||
<data key="dData">entry/ | ||
LEDG1.on() | ||
timerG1.start(1000) | ||
|
||
</data> | ||
<data key="dGeometry"> | ||
<rect x="82" y="57" width="450.0" height="95"/> | ||
</data> | ||
</node> | ||
|
||
<node id="diod2"> | ||
<data key="dName">Выключен</data> | ||
<data key="dData">entry/ | ||
LEDG1.off() | ||
timerG1.start(1000) | ||
|
||
</data> | ||
<data key="dGeometry"> | ||
<rect x="81" y="334" width="450" height="95" /> | ||
</data> | ||
</node> | ||
|
||
<node id="commentX"> | ||
<data key="dNote"/> | ||
<data key="dData"> Включение и выключение лампочки по таймеру в МС G! </data> | ||
<data key="dGeometry"> | ||
<point x="640" y="114" /> | ||
</data> | ||
</node> | ||
<edge id="init-edge" source="init" target="diod1"/> | ||
<edge id="edge0" source="coreMeta" target="ctimer1"> | ||
<data key="dPivot"/> | ||
</edge> | ||
<edge id="edge1" source="coreMeta" target="cLED1"> | ||
<data key="dPivot"/> | ||
</edge> | ||
<edge id="edge3" source="diod1" target="diod2"> | ||
<data key="dData">timerG1.timeout/</data> | ||
<data key="dColor">#F29727</data> | ||
<data key="dLabelGeometry"> | ||
<point x="389" y="193"/> | ||
</data> | ||
</edge> | ||
<edge id="edge4" source="diod2" target="diod1"> | ||
<data key="dData">timerG1.timeout/</data> | ||
<data key="dLabelGeometry"> | ||
<point x="81.5" y="193.46"/> | ||
</data> | ||
<data key="dColor">#F24C3D</data> | ||
</edge> | ||
</graph> | ||
|
||
|
||
<graph id="A" edgedefault="directed"> | ||
<data key="dStateMachine"/> | ||
<node id="coreMeta"> | ||
<data key="dNote">formal</data> | ||
<data key="dName">CGML_META</data> | ||
<data key="dData">platform/ ArduinoUno | ||
|
||
standardVersion/ 1.0 | ||
|
||
name/ Arduino Blinker | ||
|
||
author/ Lapki IDE TEAM | ||
|
||
description/ Включение и выключение лампочки по таймеру | ||
|
||
</data> | ||
</node> | ||
<node id="cLEDA1"> | ||
<data key="dNote">formal</data> | ||
<data key="dName"> CGML_COMPONENT </data> | ||
<data key="dData">id/ LED1 | ||
|
||
type/ LED | ||
|
||
name/ Светодиод | ||
|
||
description/ Встроенный в плату светодиод, чтобы им мигать | ||
|
||
pin/ 12 | ||
|
||
</data> | ||
</node> | ||
|
||
<node id="ctimerA1"> | ||
<data key="dNote">formal</data> | ||
<data key="dName"> CGML_COMPONENT </data> | ||
<data key="dData">id/ timer1 | ||
|
||
type/ Timer | ||
|
||
name/ Таймер | ||
|
||
description/ Программный таймер. | ||
|
||
</data> | ||
</node> | ||
|
||
<node id="Ainit"> | ||
<data key="dVertex">initial</data> | ||
<data key="dGeometry"> | ||
<point x="20" y="30"> </point> | ||
</data> | ||
</node> | ||
|
||
<node id="Adiod1"> | ||
<data key="dName">Включен</data> | ||
<data key="dData">entry/ | ||
LED1.on() | ||
timer1.start(1000) | ||
|
||
</data> | ||
<data key="dGeometry"> | ||
<rect x="82" y="57" width="450.0" height="95"/> | ||
</data> | ||
</node> | ||
|
||
<node id="Adiod2"> | ||
<data key="dName">Выключен</data> | ||
<data key="dData">entry/ | ||
LED1.off() | ||
timer1.start(1000) | ||
|
||
</data> | ||
<data key="dGeometry"> | ||
<rect x="81" y="334" width="450" height="95" /> | ||
</data> | ||
</node> | ||
|
||
<node id="AcommentX"> | ||
<data key="dNote"/> | ||
<data key="dData"> Включение и выключение лампочки по таймеру в МС A! </data> | ||
<data key="dGeometry"> | ||
<point x="640" y="114" /> | ||
</data> | ||
</node> | ||
<edge id="Ainit-edge" source="Ainit" target="Adiod1"/> | ||
<edge id="Aedge0" source="coreMeta" target="ctimer1"> | ||
<data key="dPivot"/> | ||
</edge> | ||
<edge id="Aedge1" source="coreMeta" target="cLED1"> | ||
<data key="dPivot"/> | ||
</edge> | ||
<edge id="Aedge3" source="Adiod1" target="Adiod2"> | ||
<data key="dData">timer1.timeout/</data> | ||
<data key="dColor">#F29727</data> | ||
<data key="dLabelGeometry"> | ||
<point x="389" y="193"/> | ||
</data> | ||
</edge> | ||
<edge id="Aedge4" source="Adiod2" target="Adiod1"> | ||
<data key="dData">timer1.timeout/</data> | ||
<data key="dLabelGeometry"> | ||
<point x="81.5" y="193.46"/> | ||
</data> | ||
<data key="dColor">#F24C3D</data> | ||
</edge> | ||
</graph> | ||
|
||
</graphml> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
import { useRef } from 'react'; | ||
|
||
import { MainContainer } from '@renderer/components'; | ||
import { CanvasEditor } from '@renderer/lib/CanvasEditor'; | ||
|
||
import { EditorContext } from './store/EditorContext'; | ||
import { ModelController } from './lib/data/ModelController'; | ||
import { ModelContext } from './store/ModelContext'; | ||
|
||
// TODO: а если у нас будет несколько редакторов? | ||
export const App: React.FC = () => { | ||
const { current: editor } = useRef(new CanvasEditor()); | ||
|
||
const { current: modelController } = useRef(ModelController.instance ?? new ModelController()); | ||
return ( | ||
<EditorContext.Provider value={editor}> | ||
<ModelContext.Provider value={modelController}> | ||
<MainContainer /> | ||
</EditorContext.Provider> | ||
</ModelContext.Provider> | ||
); | ||
}; |
Oops, something went wrong.