-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.elm
51 lines (41 loc) · 1006 Bytes
/
test.elm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import Html exposing (..)
import Html.Events exposing (onClick)
import Html.Attributes exposing (..)
import Math exposing(..)
import Data exposing(..)
type alias Model =
{
crossSection : Int,
metal : MetalType,
length : Int,
ampers : Int,
power : Int
}
model : Model
model =
Model 0 Cu 0 0 0
init : ( Model, Cmd Msg )
init =
( model, Cmd.none )
main : Program Never Model Msg
main =
Html.program { init = init, view = view, update = update, subscriptions = subscriptions }
type Msg = Increment | Decrement
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
( model, Cmd.none )
view : Model -> Html Msg
view model =
Html.form []
[
label []
[ select [] [ option [] [ text "Алюминий"], option [] [ text "Медь"] ]
, text "Тип кабеля"
]
, label []
[ input [ type_ "number"] []
, text "Длина кабеля, м" ]
]
subscriptions : Model -> Sub Msg
subscriptions model =
Sub.none