Thermometer Demo
X

Menu
90
32
Celsius
Fahrenheit
0 ............. 50 ........ 100
help
Reset
cachedTextString =
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Enter search term:
Next
regexp
Prev
Occur

X
dds
Button

this Button1

attributeConnections [...]

0 AttributeConnection

inherited from Array.prototype

cachedBounds Rectangle

derivationIds [...]

distanceToDragEvent Point

doAction doAction

doNotCopyProperties [...]

doNotSerialize [...]

droppingEnabled false

eventHandler EventHandler

get fire Function

grabbingEnabled false

halos []

halosEnabled true

id E69995AF-52E0-4B75-94CC-74E3AE7F...

isActive true

isPressed false

label Text

name Button1

owner World

partsBinMetaInfo PartsBinMetaInfo

pinSpecs [...]

scripts []

set fire Function

shape Rectangle

showsHalos false

submorphs [...]

toggle false

value false

inherited from lively.morphic.Button.prototype
Filter:
this.textString
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Bind 'this' to selection
Inspector on: lively.morphic.Button
X

Menu
signal
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Enter search term:
Next
regexp
Prev
Occur

X

this material
Filter:
this.fakeSelection
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Bind 'this' to selection
Inspector on: lively.morphic.List
X

Menu
depth: 1
reset
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
show vars
JavaScript Workspace
X

Menu
// changed at Mon Nov 30 2015 10:39:17 GMT+0100 (Central Europe Standard Time) by timfelgentreff
this.addScript(function addConstraints() {
    var F = this.get("F"),
        C = this.get("C"),
        L0 = this.get("L0"),
        cm = this.get("cm"),
        inch = this.get("in"),
        material = this.get("material"),
        structures = this.get("structures");
    material.coefficients = {
        Aluminium: 23.1 / 1000000,
        Copper: 16.5 / 1000000,
        Iron: 11.8 / 1000000
    }
    material.coefficient = 1 / 1000000;
    
    bbb.defaultSolvers = [new Relax()];
    [F,C,L0,cm,inch,material,structures].each(function(ea){disconnectAll(ea); bbb.unconstrainAll(ea)});
    
    // setup type conversions
    [F,C,L0,cm,inch].each(function(ea) {
        ea.beInputLine()
        connect(ea, "savedTextString", ea, "value", function(v) { return Math.round(parseFloat(v) * 100) / 100 });
        connect(ea, "value", ea, "textString", function(v) { return v + "" });
    });
    connect(material, "selection", material, "coefficient", function(v) { return this.sourceObj.coefficients[v] });
    connect(structures, "selection", L0, "savedTextString", function(v) { return String(parseFloat(v)) * 1000 });
    always: {
        F.value - 32 == 1.8 * C.value
    }
    always: {
        inch.value * 2.54 == cm.value
    }
    always: {
        cm.value == ro(L0.value) * ro(material.coefficient) * C.value + ro(L0.value)
    }
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
<lively.morphic.Box#7D1E5... - Rectangle>
Tag:
run
save
Tests

-- ALL --
addConstraints
Scripts
-
+
-
Connections
+
-- ALL --
all
ObjectEditor -- Rectangle>>addConstraints
X

Menu
Fahrenheit
580359.0803268623
322403.9335149235
Celcius
Centimer
Inches
Material
Aluminium
Copper
Iron
Länge bei 0 Grad Celsius in cm
2737000
324001
168684.59624363083
2737m Golden Gate Bridge
7180m Bay Bridge
324m Eiffel Tower
656.5m Freemont Bridge