From f79b726f8716233c8c5f53eae649913c78ace0ad Mon Sep 17 00:00:00 2001 From: darzu Date: Wed, 31 Aug 2016 14:48:44 -0700 Subject: [PATCH] tiny progress on generic part support --- sim/definitions.ts | 6 ++++++ sim/visuals/boardhost.ts | 2 ++ 2 files changed, 8 insertions(+) diff --git a/sim/definitions.ts b/sim/definitions.ts index 3521bf2c..ca29a2b9 100644 --- a/sim/definitions.ts +++ b/sim/definitions.ts @@ -41,6 +41,12 @@ namespace pxsim { gpioPinsNeeded: number | number[], } export interface PartVisualDefinition { + image: string, + width: number, + height: number, + left: number, + top: number, + pinDist: number, } export interface PartDefinition { visual: string | PartVisualDefinition, diff --git a/sim/visuals/boardhost.ts b/sim/visuals/boardhost.ts index 90cff24a..9a44d849 100644 --- a/sim/visuals/boardhost.ts +++ b/sim/visuals/boardhost.ts @@ -159,6 +159,8 @@ namespace pxsim.visuals { cmp.updateTheme(); cmp.updateState(); } else { + let vis = cmpDesc.visual as PartVisualDefinition; + console.log("TODO PART: " + vis.image); //TODO: support generic parts } return cmp;