var internStuff = {
    attic: true,
    atticHeating: true,
    basement: true,
    basementHeating: true,
    buildingType: "EFH", // other options: "RH", "MFH", "GFH", "HH"
    flatRoof: true,
    id: 'DENW22AL80000AQv', // equal with glmid    DEBW522AA000039fd
    latitude:	50.774414,
    longitude: 6.086995, // an example of a building in Essen
    refurbishment: "statuQuo", // other options: "medium", "advanced"
    simulationName: "MonthlyEnergyBalance", // just use this value for Heat/Cooling Demand
    storeyCount: 3,
    timestep: 1, // dummy integer, not yet integrated but mandatory
    usageProfile: "Single Family House", // // other options: "Multi Family House"
    yearOfConstruction: 1946
  }
  
  // var SimSInput = {
  //   gmlid: 'DENW22AL700004Lv', // an example of a building in Essen DENW22AL700004Lv
  //   cityID: 3, //, Essen 3 // Stockach 1
  //   // ui: internStuff
   
  // };
  
  var SimSOutput = ""
  
  //Test SimStadt API //DEBW522AA0001585e 
  var callSimS = function(){
    var layerIndexStockach
  var layernameStockach = ["Stöckach"]
  var framework = vcs.vcm.Framework.getInstance();
  var layers = framework.getLayers();
  for (var i = 0; i< layers.length; i++) {
    var layersto = layers[i];
    if(layernameStockach.indexOf(layersto.getName()) >= 0) {
    layerIndexStockach = i
  }}
    var layerStock = layers[layerIndexStockach];
    layerStock.highlight({"DEBW522AA0001585e":Cesium.Color.fromCssColorString("#BB8FCE")})
  
    try {
  
        $.ajax({
            async: false,
            type: "POST",
            url: '/getSimS',
            data: internStuff
        }).done(function (SimSMid) {
            convertdata(SimSMid);
        });
  
        function convertdata(SimSMids) {
            SimSOutput = SimSMids;
        }
  
        // console.log(currentwind);
        return SimSOutput;
    }
    catch (err) {
        console.log('->  function callSimS() failed!\n' + err);
    }
  }
  
  
  function fixJson(JsonString) {
  
  var objOne = JsonString
    JsonString = "{" + JsonString + "}"
    JsonString = JsonString.replace(/DEN/g, ',"DEN')
    JsonString = JsonString.replace(/ing/g, 'ing"')
    JsonString = JsonString.replace("ly", 'ly"')
    // JsonString = JsonString.replace(/]/g, '],')
    JsonString = JsonString.replace(/=/g, ':')
    JsonString = JsonString.replace(',"DEN', '"DEN')
  
    // JsonString = JsonString.replace("=", '":')
    console.log(JsonString)
    return(JsonString)
  }