a 10 years journey of medical device development other ... · pdf filea 10 years journey of...

25
Other Cool Stuff A 10 years journey of Medical Device Development together with Eclipse and Modelling Carsten Gosvig SW Tools Architect 20 March 2017

Upload: dinhkhue

Post on 09-Mar-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Other Cool Stuff

A 10 years journey ofMedical Device Development

together with Eclipse and Modelling

Carsten Gosvig

SW Tools Architect

20 March 2017

Page 2: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Why do we use modelling?

Domain Access

Fitting SW C#/.NET

Service C#/.NET

Production Labview

Product Matlab

Audiology Matlab

DSP Algorithm Matlab

eSW Matlab

FW Java

HW Java

2Requirements

Audiology

Research Digital HW

FW

Analog HW

Platform

Avenue

Product

Embedded SW

DSP Algorithm

Application

Street

Completion

Alley

Production___

Fitting SW

Service

Development Highway

Page 3: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

2 parameters

Type = LP

f3dB

= 1.5 kHz

Parameter Abstraction Levels

3Requirements

D

D

+

a1+

a2

+

+

s0 b0

b1

b2

Input

ctl[2]

MUX

ctl[1]

SHIFTctl[5:3]

+/-

REG REG

MU

X

REG

REG

REG

REG

MU

XM

UX

Register file

ctl[6]

ctl[9]

ctl[10] ctl[11]ctl[7]

ctl[0]

A B

data_in

REGctl[12]

input_sel

sh_res

add_res

res1

w1

w2

q0_w1

q0_w2 q1_w2

q1_w1

ctl[8]

acc_sel

data_out

f3dB

LP

6 coefficients

a1

= 0.125 a2

= 0.375

b0

= 1.0 b1

= 0.5 b1

= 1.0

s0

= 0.75

f3dB

LP2

f3dB

LP1

1 parameter

Filter = LP2f3dB

LP3

HW

eSW

DSP Algorithm

Audiology

32 instructionsSEL(Q0), SEL(W2), SHR(2), ADD(0), UPD(A);

SEL(Q0), SEL(W2), SHR(4), ADD(A), UPD(A); -- (1)

SEL(Q0), SEL(W2), SHL(1), ADD(0), UPD(B);

SEL(Q0), SEL(W2), SHR(2), ADD(B), UPD(B); -- (2)

SEL(Q0), SEL(W1), SHR(2), ADD(B), UPD(B); -- (3)

...

Tra

nsfo

rma

tion

s: M

atla

b, C

#, D

SL

PC

on

lyP

C a

nd

De

vic

e

Page 4: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Automation and Customization

4Requirements

Start

set: HW.bias = 42

run: FW.startTest3(4, 10)

get: stat = FW.isRunning

stat == 0

get: result = FW.level

Stop

start

HW.bias FW.level

snoop

Production FW

Page 5: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

The Journey

2007-2010

• HW, FW and eSWdevelopment

• XML, C, RT model, CLI tools, Java API, Device debug GUI

• Eclipse Ganymede, RCP, EMF, CDT

2011-2013

• DSP Algorithm and Device production

• Cached RT model, IDE, HTTP API, Settings diff GUI

• Eclipse Juno, Jetty, CNF, EMFCompare

2014-2016

• Audiology development and Fitting SW driver

• Custom debug GUI M2T, Textual DSL

• Eclipse Mars, Xtend, Xtext

2017…

• Performance and Modelling usability

• Incremental M2M, Graphical editors, new Eclipse+Java

• Eclipse Neon, Graphiti, e4 XWT

The Solution 6

Page 6: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Modelling like source code

6The Solution

2007-2010

• HW, FW and eSW

development

• XML, C, RT model,

CLI tools, Java API,

Device debug GUI

• Eclipse Ganymede,

RCP, EMF, CDT

X

Y

Z • N

• M

• A

• B

• C

X

• A

• B

• D

Y

• N

• M

Z

• N

• M

.c

CDT

• A

• B

• D

Patched

RT model

XML

Page 7: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Performance with models in 2010

Year 2010

Types 90

Files 170

Elements 14K

Instances 220K

Memory 540 MB

Load XML 1 sec

Transform 11 sec

Numbers are for the parameter DSL

Types: Element types in DSL

Files: Source model files

Elements: Source model elements

Instances: RT model elements

Load XML: Load source model

Transform: Source model to RT model

7The Solution

2007-2010

• HW, FW and eSW

development

• XML, C, RT model,

CLI tools, Java API,

Device debug GUI

• Eclipse Ganymede,

RCP, EMF, CDT

eSWFWHW

Page 8: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Source model tooling

Controlling XML syntax for href attributes

…xmi.impl.XMLResourceImpl.getEObjectByID(String)

…xmi.impl.XMLResourceImpl.getURIFragment(EObject)

From EMF library example: <author>#//@writers.0</author>

Source model example: link="#idsp_unit.gp_core.top_param"

Generating source model files from c code with annotated elements

Using Eclipse CDT Managed Builder to drive the source file iteration

Each IASTTranslationUnit calls special ASTVisitor for annotated elements

8The Solution

2007-2010

• HW, FW and eSW

development

• XML, C, RT model,

CLI tools, Java API,

Device debug GUI

• Eclipse Ganymede,

RCP, EMF, CDT

Page 9: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

RT model tooling

9The Solution

2007-2010

• HW, FW and eSW

development

• XML, C, RT model,

CLI tools, Java API,

Device debug GUI

• Eclipse Ganymede,

RCP, EMF, CDT

X

• A

• B

• D

Y

• N

• M

Z

• N

• M

.image

X.A = 100

Y.N = 10

Z.N = 20

Z.M = 70

Matlab Tests

Java API

Device debug GUI

CLI

Java TestsRCP

Page 10: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

More model tooling

10The Solution

2011-2013

• DSP Algorithm and

Device production

• Cached RT model,

IDE, HTTP API,

Settings diff GUI

• Eclipse Juno, Jetty,

CNF, EMFCompare

X

• A

• B

• D

Y

• N

• M

Z

• N

• M

.binary.xml

EMF Binary

Resource

Impl

EMF CompareProduction

CNF

Jetty

HTTP

Server

Page 11: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Supporting non Java runtime

Uses org.eclipse.jetty.server.Handler.handle(String,

Request, HttpServletRequest, HttpServletResponse)

11The Solution

2011-2013

• DSP Algorithm and

Device production

• Cached RT model,

IDE, HTTP API,

Settings diff GUI

• Eclipse Juno, Jetty,

CNF, EMFCompare

Request:

http://localhost:2950/plain/manager/sessions/foo/connections/bar/automation.flowchart

Response:

x=100

y=3000

Page 12: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Caching RT model

Year 2010

Types 90

Files 170

Elements 14K

Instances 220K

Memory 540 MB

Load XML 1 sec

Transform 11 sec

Load Bin 2 sec

Numbers are for the parameter DSL

Types: Element types in DSL

Files: Source model files

Elements: Source model elements

Instances: RT model elements

Load XML: Load source model

Transform: Source model to RT model

Load Bin: Load cached RT model

12The Solution

2011-2013

• DSP Algorithm and

Device production

• Cached RT model,

IDE, HTTP API,

Settings diff GUI

• Eclipse Juno, Jetty,

CNF, EMFCompare

org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl

Binary format is tightly coupled to classifier and feature ID’s

Page 13: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Even more model tooling

13The Solution

2014-2016

• Audiology

development and

Fitting SW driver

• Custom debug GUI

M2T, Textual DSL

• Eclipse Mars,

Xtend, Xtext

X

• A

• B

• D

Y

• N

• M

Z

• N

• M

Fitting

Software

.driver

workflow readLevel {

output a

a = FW.level

}

XML

C#

Xtend

Generator

Custom debug GUI

Page 14: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

From XML to Xtext DSL approach

14The Solution

2014-2016

• Audiology

development and

Fitting SW driver

• Custom debug GUI

M2T, Textual DSL

• Eclipse Mars,

Xtend, Xtext

Page 15: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Customizable debugging GUI

15The Solution

2014-2016

• Audiology

development and

Fitting SW driver

• Custom debug GUI

M2T, Textual DSL

• Eclipse Mars,

Xtend, Xtext

EM

F.E

dit

Page 16: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Performance with ever growing models

Year 2010 2017

Types 90 260

Files 170 3300

Elements 14K 190K

Instances 220K 3100K

Memory 540 MB 2800 MB

Load XML 1 sec 3 sec

Transform 11 sec 103 sec

Load Bin 2 sec 23 sec

Numbers are for the parameter DSL

Types: Element types in DSL

Files: Source model files

Elements: Source model elements

Instances: RT model elements

Load XML: Load source model

Transform: Source model to RT model

Load Bin: Load cached RT model

16The Solution

2017…

• Performance and

Modelling usability

• Incremental M2M,

Graphical editors,

new Eclipse+Java

• Eclipse Neon,

Graphiti, e4 XWT

ProductAudiology

DSP AlgorithmeSWFWHW

eSWFWHW

Page 17: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Improved tooling

Our own BinaryResourceImpl

Handling classifier and feature ID’s

17The Solution

2017…

• Performance and

Modelling usability

• Incremental M2M,

Graphical editors,

new Eclipse+Java

• Eclipse Neon,

Graphiti, e4 XWT

X

Y

Z • N

• M

• A

• B

• D

Q

P

P

• S

Q

• S

X

Y

Z

Y

• N

• M

X

• A

• B

• D

Z

• N

• M

Q

P

P

• S

Q

• SRT model

Accessor

• Z

• N

• M

Page 18: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

RT model memory consumption

Requirement

Production test systems have limited memory

Solution

Use Boolean flags field instead of individual Boolean fields

Our own base class that extends org.eclipse.emf.ecore.impl.EObjectImpl

Find elements in model that are identical and then only keep one of them

Finding identical elements also takes time

Replace general element structures with new element type

Instead of *1000 elements per memory block we will only have one element

18The Solution

2017…

• Performance and

Modelling usability

• Incremental M2M,

Graphical editors,

new Eclipse+Java

• Eclipse Neon,

Graphiti, e4 XWT

T

• 1

• 7

U

• 1

• 7 U

TU

• 1

• 7

T

Page 19: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

New Eclipse and Java versions

Requirement

Use the latest versions – less bugs and most features

Support Eclipse Neon which requires Java 8 runtime

Support Matlab having it’s own JVM embedded, which is only at Java 7

Solution

Make the API needed in Matlab available through an HTTP interface

Ended up reusing/extending the first Jetty HTTP Server based API

Will generate a Java 7 compliant frontend for Matlab that uses HTTP

19The Solution

2017…

• Performance and

Modelling usability

• Incremental M2M,

Graphical editors,

new Eclipse+Java

• Eclipse Neon,

Graphiti, e4 XWT

Page 20: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Graphical Editors

20

2017…

• Performance and

Modelling usability

• Incremental M2M,

Graphical editors,

new Eclipse+Java

• Eclipse Neon,

Graphiti, e4 XWTGraphiti

e4 XWT

Binding Editor

Page 21: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Solution Numbers

Human Resources

20 SW developers have contributed over time

Around 60 man-years of work

More than 240 users

Artifacts

7500 files of Java source and test code

2500K lines of Java source and test code

85000 test model files

21The Solution

2007-2017

Page 22: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Did we get what we wanted?

We got to the Development Highway

One common and shared set of DSL’s for exchanging artifacts

Optimized cooperation between teams by using same DSL’s and tools

Learnings

By starting bottom-up the modelling did become quite low-level

Implementing Model Editors at a later stage has been challenging

22The Solution

2007-2017

Page 23: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Live Demo

Browse source model (Model files)

Parameter Browser (Abstraction layers)

Operation Browser (Automation workflows)

Interface Browser (Custom debug GUI)

HTTP API Server (Non Java access)

23The Solution

Page 24: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Questions?

A 10 years journey of

Medical Device Development

together with Eclipse and Modelling

Company: Oticon A/S – oticon.com

Location: Copenhagen – Denmark

Presenter: Carsten Gosvig – [email protected]

24Thank You

Page 25: A 10 years journey of Medical Device Development Other ... · PDF fileA 10 years journey of Medical Device Development together with Eclipse and Modelling ... From XML to Xtext DSL

Evaluate the SessionsSign in and vote at eclipseconverge.org

-1 0 +1