asyncronise executor (#115)
* Intital async of executor The execture now sends websocket message instead of calling functions directly from the engine, When it does so it holds onto the id. The engine is still returning geo/polys directly but I'm working make it so that the UI doesn't need to know about that, so that we can switch over the streaming ui. Things left to do: - it is still making both direct function calls and websockets, and the former should be removed. - It does highlighting of segments and sourceRanges not through websockets and that needs to be fixed. - Tests have not been adjusted for these changes. - Selecting the head of a segment is not working correctly again yet. * Rough engine prep changes (#135) * rough changes for engine prep * mouse movements working again * connect to engine for startsketch, line, close and extrude
This commit is contained in:
14
src/lib/testHelpers.ts
Normal file
14
src/lib/testHelpers.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { Program } from '../lang/abstractSyntaxTree'
|
||||
import { ProgramMemory, _executor } from '../lang/executor'
|
||||
import { EngineCommandManager } from '../lang/std/engineConnection'
|
||||
|
||||
export async function executor(
|
||||
ast: Program,
|
||||
pm: ProgramMemory = { root: {}, pendingMemory: {} }
|
||||
): Promise<ProgramMemory> {
|
||||
const engineCommandManager = new EngineCommandManager(() => {})
|
||||
engineCommandManager.startNewSession()
|
||||
const programMemory = await _executor(ast, pm, engineCommandManager)
|
||||
await engineCommandManager.waitForAllCommands()
|
||||
return programMemory
|
||||
}
|
Reference in New Issue
Block a user