Commit e8714023 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

testing

parent b4bbc2eb
......@@ -8,5 +8,7 @@ declare namespace STWkit{
export var deleteParam: any;
export var getSearchUrl: any;
export var getParamValue: any;
export var LocationCard: any;
export var PeriodCard: any;
}
\ No newline at end of file
......@@ -16,7 +16,28 @@ var __extends = (this && this.__extends) || (function () {
var ITLocation = (function (_super) {
__extends(ITLocation, _super);
function ITLocation(id, parentDiv, lang, langData, map, forcing) {
return _super.call(this, id, 'Specify location', parentDiv, lang, langData, map, forcing) || this;
var _this = this;
var options = {};
var initials = 'it';
options['singlebutton'] = true;
options['multiplebutton'] = false;
options['linebutton'] = true;
options['areabutton'] = true;
options['afterDiv'] = true;
options['initials'] = initials;
_this = _super.call(this, id, 'Specify location', parentDiv, lang, langData, map, forcing, options) || this;
var fieldset = L.DomUtil.create('fieldset', 'uk-margin-top', _this.locationForm);
var depthRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset);
_super.prototype.addLabelDiv.call(_this, depthRowDiv, "Outlet at depth (m)", "See more information <a style='color:#faa732;' href='help/classic/#" + initials + "-depth' target='_blank'>here</a>");
var depthDiv = L.DomUtil.create('div', ' uk-width-1-1', depthRowDiv);
_this.depthInput = L.DomUtil.create('input', 'uk-width-1-4', depthDiv);
_this.depthInput.type = 'number';
_this.depthInput.value = '0';
_this.depthInput.min = '0';
_this.depthInput.onchange = function () {
//validate();
};
return _this;
}
ITLocation.prototype.show = function () {
_super.prototype.show.call(this);
......@@ -35,4 +56,149 @@ var ITLocation = (function (_super) {
};
return ITLocation;
}(STWkit.LocationCard));
var ITAmount = (function (_super) {
__extends(ITAmount, _super);
function ITAmount(id, title, parentDiv, lang, map) {
var _this = this;
var amountDiv = L.DomUtil.create('div', 'uk-width-1-1 uk-margin-top', parentDiv);
_this = _super.call(this, id, title, parentDiv, amountDiv) || this;
var self = _this;
var form = L.DomUtil.create('form', 'uk-form uk-form-stacked', amountDiv);
form.onsubmit = function (e) {
e.preventDefault();
e.stopPropagation();
return false;
};
function addOption(parent, value, txt) {
var option = L.DomUtil.create('option', '', parent);
option.value = value;
option.textContent = txt;
}
var fieldset = L.DomUtil.create('fieldset', '', form);
var amountRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset);
amountRowDiv.id = 'guideos8';
amountRowDiv.guideFn = function () {
self.amountInput.value = '100';
};
_super.prototype.addLabelDiv.call(_this, amountRowDiv, "Total amount/rate", "See more information <a style='color:#faa732;' href='help/classic/#oil-os-totalamount' target='_blank'>here</a>");
var amountValueDiv = L.DomUtil.create('div', 'uk-width-1-1', amountRowDiv);
self.amountInput = L.DomUtil.create('input', 'uk-width-1-4', amountValueDiv);
self.amountInput.type = 'number';
self.amountInput.step = '100';
self.amountInput.min = '0';
var amountUnitDiv = L.DomUtil.create('div', 'uk-width-1-2 uk-form-select select', amountValueDiv);
amountUnitDiv.setAttribute('data-uk-form-select', '');
var selectedAmountUnit = L.DomUtil.create('span', '', amountUnitDiv);
self.amountSelect = L.DomUtil.create('select', '', amountUnitDiv);
addOption(self.amountSelect, 'm3', '');
addOption(self.amountSelect, 'tonnes', 'tonnes');
addOption(self.amountSelect, 'm3/hour', 'm³ / hour');
addOption(self.amountSelect, 'tonnes/hour', 'tonnes / hour');
addOption(self.amountSelect, 'm3/day', 'm³ / day');
addOption(self.amountSelect, 'tonnes/day', 'tonnes / day');
var durationRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset);
durationRowDiv.id = 'guideos9';
durationRowDiv.guideFn = function () {
self.durationInput.value = '6';
validate();
};
_super.prototype.addLabelDiv.call(_this, durationRowDiv, "Duration", "See more information <a style='color:#faa732;' href='help/classic/#oil-os-amount-duration' target='_blank'>here</a>");
var durationDiv = L.DomUtil.create('div', '', durationRowDiv);
durationDiv.id = 'guideos7';
self.durationInput = L.DomUtil.create('input', 'uk-width-1-4', durationDiv);
self.durationInput.type = 'number';
self.durationInput.step = '1';
self.durationInput.min = '0';
var durationUnitDiv = L.DomUtil.create('div', 'uk-width-1-2 uk-form-select select', durationDiv);
durationUnitDiv.setAttribute('data-uk-form-select', '');
var selectedDurationUnit = L.DomUtil.create('span', '', durationUnitDiv);
self.durationSelect = L.DomUtil.create('select', '', durationUnitDiv);
addOption(self.durationSelect, 'hours', 'hours');
addOption(self.durationSelect, 'days', 'days');
self.amountInput.onchange = function () {
validate();
};
self.durationInput.onchange = function () {
validate();
};
function validate() {
var amountValue = parseInt(self.amountInput.value);
var amountOk = false;
if (amountValue < 0)
self.amountInput.value = "0";
if (amountValue > 0)
amountOk = true;
var durationValue = parseInt(self.durationInput.value);
var durationOk = false;
if (durationValue < 0)
self.durationInput.value = "0";
if (durationValue > 0)
durationOk = true;
if (amountOk && durationOk) {
self.status = true;
STWkit.AccordionCard.enableNext(self.nextButton, true);
(self.oncallback && self.oncallback());
}
}
;
var clearDiv = L.DomUtil.create('div', 'uk-clearfix', amountDiv);
var clearButton = L.DomUtil.create('button', 'uk-button uk-margin-top uk-align-left', clearDiv);
clearButton.textContent = 'Clear';
clearButton.onclick = function () {
self.clear();
};
self.nextButton = L.DomUtil.create('button', 'uk-button uk-margin-top uk-align-right', clearDiv);
self.nextButton.id = 'guideos10';
self.nextButton.textContent = 'Next';
self.nextButton.guideFn = function () {
self.nextButton.click();
};
STWkit.AccordionCard.enableNext(self.nextButton, false);
self.nextButton.onclick = function () {
if (!STWkit.AccordionCard.isEnabled(self.nextButton)) {
STWkit.AccordionCard.warningMsg('Mandatory fields missing', 'Specify a valid <b>amount</b> and <b>duration</b>.');
return;
}
(self.oncallback && self.oncallback(true));
};
UIkit.ready(function () {
self.defaults();
});
return _this;
}
ITAmount.prototype.defaults = function () {
var self = this;
};
ITAmount.prototype.populateCard = function (geojson) {
var self = this;
var simulation = geojson.features[0].properties.simulation;
self.amountInput.value = simulation.amount;
var amountevt = document.createEvent('Event');
amountevt.initEvent("change", true, true);
self.amountInput.dispatchEvent(amountevt);
self.amountSelect.value = simulation.amountUnit;
self.durationInput.value = simulation.duration;
var durationevt = document.createEvent('Event');
durationevt.initEvent("change", true, true);
self.durationInput.dispatchEvent(durationevt);
self.durationSelect.value = simulation.durationUnit;
};
ITAmount.prototype.populateData = function (geojson) {
var self = this;
geojson.features[0].properties["simulation"]["amount"] = self.amountInput.value;
geojson.features[0].properties["simulation"]["amountUnit"] = self.amountSelect.options[self.amountSelect.selectedIndex].value;
geojson.features[0].properties["simulation"]["duration"] = self.durationInput.value;
geojson.features[0].properties["simulation"]["durationUnit"] = self.durationSelect.options[self.durationSelect.selectedIndex].value;
};
ITAmount.prototype.clear = function () {
var self = this;
_super.prototype.clear.call(this);
self.amountInput.value = '';
self.durationInput.value = '';
STWkit.AccordionCard.enableNext(self.nextButton, false);
self.status = false;
(self.oncallback && self.oncallback());
};
return ITAmount;
}(STWkit.AccordionCard));
//# sourceMappingURL=leaflet-itracer-cards.js.map
\ No newline at end of file
{"version":3,"file":"leaflet-itracer-cards.js","sourceRoot":"","sources":["leaflet-itracer-cards.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,yCAAyC;AACzC,wCAAwC;AACxC,0DAA0D;AAC1D,yCAAyC;;;;;;;;;;;AAGzC;IAAyB,8BAAmB;IAExC,oBAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO;eACnD,kBAAM,EAAE,EAAE,kBAAkB,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC;IAC1E,CAAC;IAEM,yBAAI,GAAX;QACI,iBAAM,IAAI,WAAE,CAAC;IACjB,CAAC;IAEM,yBAAI,GAAX;QACI,iBAAM,IAAI,WAAE,CAAC;IACjB,CAAC;IAEM,iCAAY,GAAnB,UAAoB,OAAO;QACvB,iBAAM,YAAY,YAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAGM,iCAAY,GAAnB,UAAoB,OAAO;QACvB,iBAAM,YAAY,YAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAEM,0BAAK,GAAZ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;QACI,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,iBAAM,KAAK,WAAE,CAAC;QACd,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,aAAa,CAAC,KAAK,GAAG,EAAE,CAAC;QAC9B,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QACxD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IAC3C,CAAC;IACL,eAAC;AAAD,CAAC,AAlKD,CAAuB,MAAM,CAAC,aAAa,GAkK1C"}
\ No newline at end of file
......@@ -7,8 +7,35 @@
class ITLocation extends STWkit.LocationCard {
private locationDiv: HTMLDivElement;
private locationForm: HTMLFormElement;
public depthInput: HTMLInputElement;
constructor(id, parentDiv, lang, langData, map, forcing) {
super(id, 'Specify location', parentDiv, lang, langData, map, forcing);
var options:any = {};
var initials = 'it';
options['singlebutton'] = true;
options['multiplebutton'] = false;
options['linebutton'] = true;
options['areabutton'] = true;
options['afterDiv'] = true;
options['initials'] = initials;
super(id, 'Specify location', parentDiv, lang, langData, map, forcing, options);
var fieldset = <HTMLFieldSetElement>L.DomUtil.create('fieldset', 'uk-margin-top', this.locationForm);
var depthRowDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset);
super.addLabelDiv(depthRowDiv, "Outlet at depth (m)", "See more information <a style='color:#faa732;' href='help/classic/#"+initials+"-depth' target='_blank'>here</a>");
var depthDiv = <HTMLDivElement>L.DomUtil.create('div', ' uk-width-1-1', depthRowDiv);
this.depthInput = <HTMLInputElement>L.DomUtil.create('input', 'uk-width-1-4', depthDiv);
this.depthInput.type = 'number';
this.depthInput.value = '0';
this.depthInput.min = '0';
this.depthInput.onchange = function () {
//validate();
};
}
public show() {
......@@ -35,3 +62,166 @@ class ITLocation extends STWkit.LocationCard {
}
class ITAmount extends STWkit.AccordionCard {
public oncallback: Function;
public amountInput: HTMLInputElement;
public durationInput: HTMLInputElement;
public amountSelect: HTMLSelectElement;
public durationSelect: HTMLSelectElement;
public nextButton: any;
constructor(id, title, parentDiv, lang, map) {
var amountDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-width-1-1 uk-margin-top', parentDiv);
super(id, title, parentDiv, amountDiv);
var self = this;
var form = <HTMLFormElement>L.DomUtil.create('form', 'uk-form uk-form-stacked', amountDiv);
form.onsubmit = function (e) {
e.preventDefault();
e.stopPropagation();
return false;
};
function addOption(parent, value, txt) {
var option = <HTMLOptionElement>L.DomUtil.create('option', '', parent);
option.value = value;
option.textContent = txt;
}
var fieldset = <HTMLFieldSetElement>L.DomUtil.create('fieldset', '', form);
var amountRowDiv: any = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset);
amountRowDiv.id = 'guideos8';
amountRowDiv.guideFn = function () {
self.amountInput.value = '100';
}
super.addLabelDiv(amountRowDiv, "Total amount/rate", "See more information <a style='color:#faa732;' href='help/classic/#oil-os-totalamount' target='_blank'>here</a>");
var amountValueDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-width-1-1', amountRowDiv);
self.amountInput = <HTMLInputElement>L.DomUtil.create('input', 'uk-width-1-4', amountValueDiv);
self.amountInput.type = 'number';
self.amountInput.step = '100';
self.amountInput.min = '0';
var amountUnitDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-width-1-2 uk-form-select select', amountValueDiv);
amountUnitDiv.setAttribute('data-uk-form-select', '');
var selectedAmountUnit = <HTMLSpanElement>L.DomUtil.create('span', '', amountUnitDiv);
self.amountSelect = <HTMLSelectElement>L.DomUtil.create('select', '', amountUnitDiv);
addOption(self.amountSelect, 'm3', '');
addOption(self.amountSelect, 'tonnes', 'tonnes');
addOption(self.amountSelect, 'm3/hour', 'm³ / hour');
addOption(self.amountSelect, 'tonnes/hour', 'tonnes / hour');
addOption(self.amountSelect, 'm3/day', 'm³ / day');
addOption(self.amountSelect, 'tonnes/day', 'tonnes / day');
var durationRowDiv: any = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset);
durationRowDiv.id = 'guideos9';
durationRowDiv.guideFn = function () {
self.durationInput.value = '6';
validate();
}
super.addLabelDiv(durationRowDiv, "Duration", "See more information <a style='color:#faa732;' href='help/classic/#oil-os-amount-duration' target='_blank'>here</a>");
var durationDiv = <HTMLDivElement>L.DomUtil.create('div', '', durationRowDiv);
durationDiv.id = 'guideos7';
self.durationInput = <HTMLInputElement>L.DomUtil.create('input', 'uk-width-1-4', durationDiv);
self.durationInput.type = 'number';
self.durationInput.step = '1';
self.durationInput.min = '0';
var durationUnitDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-width-1-2 uk-form-select select', durationDiv);
durationUnitDiv.setAttribute('data-uk-form-select', '');
var selectedDurationUnit = <HTMLSpanElement>L.DomUtil.create('span', '', durationUnitDiv);
self.durationSelect = <HTMLSelectElement>L.DomUtil.create('select', '', durationUnitDiv);
addOption(self.durationSelect, 'hours', 'hours');
addOption(self.durationSelect, 'days', 'days');
self.amountInput.onchange = function () {
validate();
};
self.durationInput.onchange = function () {
validate();
};
function validate() {
var amountValue = parseInt(self.amountInput.value);
var amountOk = false;
if (amountValue < 0) self.amountInput.value = "0";
if (amountValue > 0) amountOk = true;
var durationValue = parseInt(self.durationInput.value);
var durationOk = false;
if (durationValue < 0) self.durationInput.value = "0";
if (durationValue > 0) durationOk = true;
if (amountOk && durationOk) {
self.status = true;
STWkit.AccordionCard.enableNext(self.nextButton, true);
(self.oncallback && self.oncallback());
}
};
var clearDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-clearfix', amountDiv);
var clearButton = <HTMLButtonElement>L.DomUtil.create('button', 'uk-button uk-margin-top uk-align-left', clearDiv);
clearButton.textContent = 'Clear';
clearButton.onclick = function () {
self.clear();
};
self.nextButton = <HTMLButtonElement>L.DomUtil.create('button', 'uk-button uk-margin-top uk-align-right', clearDiv);
self.nextButton.id = 'guideos10';
self.nextButton.textContent = 'Next';
self.nextButton.guideFn = function () {
self.nextButton.click();
}
STWkit.AccordionCard.enableNext(self.nextButton, false);
self.nextButton.onclick = function () {
if (!STWkit.AccordionCard.isEnabled(self.nextButton)) {
STWkit.AccordionCard.warningMsg('Mandatory fields missing',
'Specify a valid <b>amount</b> and <b>duration</b>.');
return;
}
(self.oncallback && self.oncallback(true));
};
UIkit.ready(function () {
self.defaults();
});
}
public defaults() {
var self = this;
}
public populateCard(geojson) {
var self = this;
var simulation = geojson.features[0].properties.simulation;
self.amountInput.value = simulation.amount;
var amountevt = document.createEvent('Event');
amountevt.initEvent("change", true, true);
self.amountInput.dispatchEvent(amountevt);
self.amountSelect.value = simulation.amountUnit;
self.durationInput.value = simulation.duration;
var durationevt = document.createEvent('Event');
durationevt.initEvent("change", true, true);
self.durationInput.dispatchEvent(durationevt);
self.durationSelect.value = simulation.durationUnit;
}
public populateData(geojson) {
var self = this;
geojson.features[0].properties["simulation"]["amount"] = self.amountInput.value;
geojson.features[0].properties["simulation"]["amountUnit"] = self.amountSelect.options[self.amountSelect.selectedIndex].value;
geojson.features[0].properties["simulation"]["duration"] = self.durationInput.value;
geojson.features[0].properties["simulation"]["durationUnit"] = self.durationSelect.options[self.durationSelect.selectedIndex].value;
}
public clear() {
var self = this;
super.clear();
self.amountInput.value = '';
self.durationInput.value = '';
STWkit.AccordionCard.enableNext(self.nextButton, false);
self.status = false;
(self.oncallback && self.oncallback());
}
}
......@@ -23,7 +23,7 @@ var L;
__extends(InstantTracer, _super);
function InstantTracer(options) {
var _this = _super.call(this, options) || this;
_this.type = 'object';
_this.type = 'point';
_this.subtype = 'instant';
_this.name = 'itracer';
_this.initials = 'it';
......@@ -32,37 +32,29 @@ var L;
InstantTracer.prototype.setup = function (map) {
var _this = this;
var self = this;
this.container = L.DomUtil.create('div', +self.name + '-control');
this.container = L.DomUtil.create('div', self.name + '-control');
this.accordionDiv = L.DomUtil.create('div', 'uk-accordion', this.container);
var locationid = self.initials + 'locationCard';
self.cardMap[locationid] = new ITLocation(locationid, this.accordionDiv, self.lang, self.langData, map, self.forcing);
self.cardMap[locationid].show();
var periodid = self.initials + 'periodCard';
self.cardMap[periodid] = new STWkit.PeriodCard(periodid, 'Simulation period', this.accordionDiv, self.lang, map, self.domain, self.forcingmodel);
var amountid = self.initials + 'amountCard';
self.cardMap[amountid] = new ITAmount(amountid, 'Amount', this.accordionDiv, self.lang, map);
_super.prototype.setup.call(this, map);
// var periodid = 'itperiodCard';
// super.cardMap[periodid] = new OOPeriod(periodid, accordionDiv, super.lang, self.map, super.domain, self.forcingmodel);
// var oiltypeid = 'itoiltypeCard';
// super.cardMap[oiltypeid] = new OOType(oiltypeid, accordionDiv, super.lang, self.map);
// var amountid = 'itamountCard';
// super.cardMap[amountid] = new OOAmount(amountid, accordionDiv, super.lang, self.map);
// super.cardMap[periodid].addChangeFnListener(super.cardMap[oiltypeid]);
// super.cardMap[locationid].addChangeFnListener(super.cardMap[amountid]);
var chain = [];
// chain[locationid] = periodid;
// chain[periodid] = oiltypeid;
// chain[oiltypeid] = amountid;
// chain[amountid] = '';
chain[locationid] = periodid;
chain[periodid] = amountid;
chain[amountid] = '';
self.cardMap[locationid].oncallback = function (gonext) {
_super.prototype.callback.call(_this, chain, locationid, gonext);
};
// super.cardMap[periodid].oncallback = function (gonext) {
// callback(periodid, gonext);
// };
// super.cardMap[oiltypeid].oncallback = function (gonext) {
// callback(oiltypeid, gonext);
// };
// super.cardMap[amountid].oncallback = function (gonext) {
// callback(amountid, gonext);
// };
self.cardMap[periodid].oncallback = function (gonext) {
_super.prototype.callback.call(_this, chain, periodid, gonext);
};
self.cardMap[amountid].oncallback = function (gonext) {
_super.prototype.callback.call(_this, chain, amountid, gonext);
};
};
InstantTracer.prototype.ready = function (name) {
_super.prototype.ready.call(this, name);
......
{"version":3,"file":"leaflet-itracer-control.js","sourceRoot":"","sources":["leaflet-itracer-control.ts"],"names":[],"mappings":"AAAA,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,wFAAwF;gBACxF,iCAAiC;gBACjC,wFAAwF;gBACxF,yEAAyE;gBACzE,0EAA0E;gBAC1E,IAAI,KAAK,GAAG,EAAE,CAAC;gBACf,gCAAgC;gBAChC,+BAA+B;gBAC/B,+BAA+B;gBAC/B,wBAAwB;gBACxB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,UAAU,GAAG,UAAC,MAAM;oBACzC,iBAAM,QAAQ,aAAC,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;gBAC9C,CAAC,CAAC;gBACF,2DAA2D;gBAC3D,kCAAkC;gBAClC,KAAK;gBACL,4DAA4D;gBAC5D,mCAAmC;gBACnC,KAAK;gBACL,2DAA2D;gBAC3D,kCAAkC;gBAClC,KAAK;YAET,CAAC;YAEM,6BAAK,GAAZ,UAAa,IAAI;gBACb,iBAAM,KAAK,YAAC,IAAI,CAAC,CAAC;YACtB,CAAC;YAEO,6BAAK,GAAb;gBACI,iBAAM,KAAK,WAAE,CAAC;YAClB,CAAC;YACO,4BAAI,GAAZ;YACA,CAAC;YACO,4BAAI,GAAZ;gBACI,IAAI,CAAC,KAAK,EAAE,CAAC;YACjB,CAAC;YAEL,oBAAC;QAAD,CAAC,AAxED,CAAmC,MAAM,CAAC,WAAW,GAwEpD;QAxEY,qBAAa,gBAwEzB,CAAA;IACL,CAAC,EA1EQ,OAAO,GAAP,SAAO,KAAP,SAAO,QA0Ef;AAAD,CAAC,EA1EM,CAAC,KAAD,CAAC,QA0EP"}
\ No newline at end of file
{"version":3,"file":"leaflet-itracer-control.js","sourceRoot":"","sources":["leaflet-itracer-control.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,yCAAyC;AACzC,yCAAyC;AACzC,wCAAwC;AACxC,wCAAwC;AACxC,yCAAyC;AACzC,iDAAiD;;;;;;;;;;;AAIjD,IAAO,CAAC,CAmEP;AAnED,WAAO,CAAC;IAAC,IAAA,OAAO,CAmEf;IAnEQ,WAAA,OAAO;QACZ;YAAmC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M,CAAC,WAAW,GAiEpD;QAjEY,qBAAa,gBAiEzB,CAAA;IACL,CAAC,EAnEQ,OAAO,GAAP,SAAO,KAAP,SAAO,QAmEf;AAAD,CAAC,EAnEM,CAAC,KAAD,CAAC,QAmEP"}
\ No newline at end of file
......@@ -18,6 +18,7 @@ module L.Control {
private lang: string;
private langData: any;
private cardMap: any;
private domain: string;
private type: string;
private subtype: string;
private name: string;
......@@ -25,46 +26,38 @@ module L.Control {
constructor(options) {
super(options);
this.type = 'object';
this.type = 'point';
this.subtype = 'instant';
this.name = 'itracer';
this.initials = 'it';
}
private setup(map) {
var self = this;
this.container = L.DomUtil.create('div', +self.name+'-control');
this.container = L.DomUtil.create('div', self.name+'-control');
this.accordionDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-accordion', this.container);
var locationid = self.initials+'locationCard';
self.cardMap[locationid] = new ITLocation(locationid, this.accordionDiv, self.lang, self.langData, map, self.forcing);
self.cardMap[locationid].show();
var periodid = self.initials+'periodCard';
self.cardMap[periodid] = new STWkit.PeriodCard(periodid, 'Simulation period', this.accordionDiv, self.lang, map, self.domain, self.forcingmodel);
var amountid = self.initials+'amountCard';
self.cardMap[amountid] = new ITAmount(amountid, 'Amount', this.accordionDiv, self.lang, map);
super.setup(map);
// var periodid = 'itperiodCard';
// super.cardMap[periodid] = new OOPeriod(periodid, accordionDiv, super.lang, self.map, super.domain, self.forcingmodel);
// var oiltypeid = 'itoiltypeCard';
// super.cardMap[oiltypeid] = new OOType(oiltypeid, accordionDiv, super.lang, self.map);
// var amountid = 'itamountCard';
// super.cardMap[amountid] = new OOAmount(amountid, accordionDiv, super.lang, self.map);
// super.cardMap[periodid].addChangeFnListener(super.cardMap[oiltypeid]);
// super.cardMap[locationid].addChangeFnListener(super.cardMap[amountid]);
var chain = [];
// chain[locationid] = periodid;
// chain[periodid] = oiltypeid;
// chain[oiltypeid] = amountid;
// chain[amountid] = '';
chain[locationid] = periodid;
chain[periodid] = amountid;
chain[amountid] = '';
self.cardMap[locationid].oncallback = (gonext) => {
super.callback(chain, locationid, gonext);
};
// super.cardMap[periodid].oncallback = function (gonext) {
// callback(periodid, gonext);
// };
// super.cardMap[oiltypeid].oncallback = function (gonext) {
// callback(oiltypeid, gonext);
// };
// super.cardMap[amountid].oncallback = function (gonext) {
// callback(amountid, gonext);
// };
self.cardMap[periodid].oncallback = (gonext) => {
super.callback(chain, periodid, gonext);
};
self.cardMap[amountid].oncallback = (gonext) => {
super.callback(chain, amountid, gonext);
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment