Skip to content

Repository for the assignments of the course TDT4250 at NTNU

Notifications You must be signed in to change notification settings

kegesch/tdt4250-2019

Folders and files

NameName
Last commit message
Last commit date

Latest commit

57564b7 · Oct 18, 2019

History

33 Commits
Sep 17, 2019
Oct 14, 2019
Sep 27, 2019
Sep 29, 2019
Sep 29, 2019
Sep 29, 2019
Sep 29, 2019
Sep 27, 2019
Oct 16, 2019
Oct 16, 2019
Oct 16, 2019
Oct 18, 2019
Oct 18, 2019
Sep 17, 2019
Sep 19, 2019
Sep 17, 2019
Oct 18, 2019
Sep 17, 2019
Sep 17, 2019
Sep 17, 2019
Sep 17, 2019
Oct 18, 2019
Sep 6, 2019
Sep 17, 2019

Repository files navigation

tdt4250-2019

Repository for the assignments of the course TDT4250 at NTNU

Assignment 1

Structure

no.tdt4250.model

contains the source code and the model

  • src contains the generated source code
  • model contains the ECore model, the generator model and a dynamic instance

no.tdt4250.model.tests

contains the generated and the custom tests for the source code

Model

Model

Assignment 2

Get started

  • Install BndTools
  • Import all projects starting with no.tdt4250.conversion into the eclipse workspace

Structure

  • no.tdt4250.conversion.api: defines the API for all other components / projects
  • no.tdt4250.conversion.converter: contains the used converter for converting the values (TransientConverter, which can convert value transiently)
  • no.tdt4250.conversion.gogo: the service for commands for gogo console
  • no.tdt4250.conversion.servlet: the service to start a servlet for humand readble output of the conversion
  • no.tdt4250.conversion.temperature: contains basic temperature conversions
  • no.tdt4250.conversion.rest: the rest service for converting values

API

Start project no.tdt.4250.conversion.rest Make an http GET-request to localhost:8080 with parameters:

  • value (Double): the value that should be converted
  • from (String): the unit of value
  • to (String): the unit of the target converted value

For example: localhost:8080/convert?from=Fahrenheit&to=Kelvin&value=20 returns following:

{
    "success": true,
    "value": 20,
    "converted": 266.4833333333333,
    "unitFrom": {
        "name": "Fahrenheit",
        "symbol": "°F"
    },
    "unitTo": {
        "name": "Kelvin",
        "symbol": "K"
    }
}

Gogo Console

Commands:

  • list: lists all available direct conversions
  • add: add a new conversion e.g.: add "Centimeter(cm) = Inch(in) * 0.393 + 0"

Assignment 3

Model

I simplified the model to the relevant data for Assignment 3 Model

Transformation

The model is transformated to .html wih Acceleo M2T. The package no.tdt4250.model.html.main contains the transformation. The output for the instance no.tdt4250.model/model/programmes.xmi is here It was generated by the Acceleo Java Standalone.

Running the transformation

  • Install the Eclipse Acceleo Plugin
  • Run the generateHTML.mtl file as Acceleo Programm in no.tdt4250.model.html.main.
    • specify the the instance with no.tdt4250.model/model/programmes.xmi and your desired target directory

About

Repository for the assignments of the course TDT4250 at NTNU

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published