Commit 9f33f7ed authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

experiment

parent f7c5fdde
......@@ -149,7 +149,7 @@
};
if (forcing.features.length > 0) itracerproperties["forcing"] = forcing;
var itracer = new L.Control.InstantTracer(itracerproperties);
containerControl.addComponent("Instant Tracer", itracer);
containerControl.addComponent("Passive Points", itracer);
}
});
......
This diff is collapsed.
This diff is collapsed.
......@@ -9,32 +9,70 @@ class ITLocation extends STWkit.LocationCard {
private locationDiv: HTMLDivElement;
private locationForm: HTMLFormElement;
public depthInput: HTMLInputElement;
public depthMinInput: HTMLInputElement;
public depthMaxInput: HTMLInputElement;
public surfaceButton: HTMLButtonElement;
public volumeButton: HTMLButtonElement;
constructor(id, parentDiv, lang, langData, map, forcing) {
var options:any = {};
var initials = 'it';
options['singlebutton'] = true;
options['multiplebutton'] = false;
options['linebutton'] = true;
options['linebutton'] = false;
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.step = '10';
// this.depthInput.min = '0';
var fieldset = <HTMLFieldSetElement>L.DomUtil.create('fieldset', 'uk-margin-top', this.locationForm);
var surfacevolumeRowDiv: any = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset);
surfacevolumeRowDiv.id = 'guideos9';
surfacevolumeRowDiv.guideFn = function () {
validate();
}
super.addLabelDiv(surfacevolumeRowDiv, "Surface/Volume", "See more information <a style='color:#faa732;' href='help/classic/#oil-os-amount-duration' target='_blank'>here</a>");
var surfacevolumeDiv = <HTMLDivElement>L.DomUtil.create('div', '', surfacevolumeRowDiv);
surfacevolumeDiv.setAttribute('data-uk-button-radio', '');
var surfacevolumeButtonGrid = <HTMLDivElement>L.DomUtil.create('div', 'uk-grid uk-grid-small', surfacevolumeDiv);
var surfacevolumebuttonsDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-width-1-2', surfacevolumeButtonGrid);
surfacevolumeButtonGrid.id = 'guidefo5';
var surfacevolumeButtonGroup = <HTMLDivElement>L.DomUtil.create('div', 'uk-button-group', surfacevolumebuttonsDiv);
this.surfaceButton = <HTMLButtonElement>L.DomUtil.create('button', 'uk-button uk-button-small', surfacevolumeButtonGroup);
this.surfaceButton.textContent = 'Surface';
this.volumeButton = <HTMLButtonElement>L.DomUtil.create('button', 'uk-button uk-button-small', surfacevolumeButtonGroup);
this.volumeButton.textContent = 'Volume';
var depthRangeRowDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset);
super.addLabelDiv(depthRangeRowDiv, "Outlet depth range [from - to] (m)", "See more information <a style='color:#faa732;' href='help/classic/#"+initials+"-depth' target='_blank'>here</a>");
var depthRangeDiv = <HTMLDivElement>L.DomUtil.create('div', ' uk-width-1-1', depthRangeRowDiv);
this.depthMinInput = <HTMLInputElement>L.DomUtil.create('input', 'uk-width-1-4', depthRangeDiv);
this.depthMinInput.type = 'number';
this.depthMinInput.value = '0';
this.depthMinInput.step = '10';
this.depthMinInput.min = '0';
this.depthMinInput.onchange = function () {
//validate();
};
var separator = <HTMLSpanElement>L.DomUtil.create('span', '', depthRangeDiv);
separator.textContent = ' - '
this.depthMaxInput = <HTMLInputElement>L.DomUtil.create('input', 'uk-width-1-4', depthRangeDiv);
this.depthMaxInput.type = 'number';
this.depthMaxInput.value = '0';
this.depthMaxInput.step = '10';
this.depthMaxInput.min = '0';
this.depthMaxInput.onchange = function () {
//validate();
};
// this.depthInput.onchange = function () {
// //validate();
// };
}
......@@ -63,14 +101,10 @@ class ITLocation extends STWkit.LocationCard {
}
class ITDistribution extends STWkit.AccordionCard {
class ITSpreading extends STWkit.AccordionCard {
public oncallback: Function;
public amountInput: HTMLInputElement;
public amountSelect: HTMLSelectElement;
public spreading2DButton: HTMLButtonElement;
public spreading3DButton: HTMLButtonElement;
public distribution2DButton: HTMLButtonElement;
public distribution3DButton: HTMLButtonElement;
public nextButton: any;
public status: boolean;
......@@ -95,58 +129,6 @@ class ITDistribution extends STWkit.AccordionCard {
var fieldset = <HTMLFieldSetElement>L.DomUtil.create('fieldset', '', form);
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/#-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.step = '10';
this.depthInput.min = '0';
var distributionRowDiv: any = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset);
distributionRowDiv.id = 'guideos8';
distributionRowDiv.guideFn = function () {
}
super.addLabelDiv(distributionRowDiv, "Outlet distribution", "See more information <a style='color:#faa732;' href='help/classic/#oil-os-amount-duration' target='_blank'>here</a>");
var distributionDiv = <HTMLDivElement>L.DomUtil.create('div', '', distributionRowDiv);
distributionDiv.setAttribute('data-uk-button-radio', '');
var distributionButtonGrid = <HTMLDivElement>L.DomUtil.create('div', 'uk-grid uk-grid-small', distributionDiv);
var distributionbuttonsDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-width-1-2', distributionButtonGrid);
distributionButtonGrid.id = 'guidefo5';
var distributionButtonGroup = <HTMLDivElement>L.DomUtil.create('div', 'uk-button-group', distributionbuttonsDiv);
self.distribution2DButton = <HTMLButtonElement>L.DomUtil.create('button', 'uk-button uk-button-small', distributionButtonGroup);
self.distribution2DButton.textContent = 'Surface';
self.distribution3DButton = <HTMLButtonElement>L.DomUtil.create('button', 'uk-button uk-button-small', distributionButtonGroup);
self.distribution3DButton.textContent = 'Volume';
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, "Outlet amount", "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 = '10';
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');
self.amountInput.onchange = function () {
validate();
};
var spreadingRowDiv: any = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset);
spreadingRowDiv.id = 'guideos9';
spreadingRowDiv.guideFn = function () {
......@@ -161,7 +143,7 @@ class ITDistribution extends STWkit.AccordionCard {
spreadingButtonGrid.id = 'guidefo5';
var spreadingButtonGroup = <HTMLDivElement>L.DomUtil.create('div', 'uk-button-group', spreadingbuttonsDiv);
self.spreading2DButton = <HTMLButtonElement>L.DomUtil.create('button', 'uk-button uk-button-small', spreadingButtonGroup);
self.spreading2DButton.textContent = 'Horizontal';
self.spreading2DButton.textContent = 'Constant depth';
self.spreading3DButton = <HTMLButtonElement>L.DomUtil.create('button', 'uk-button uk-button-small', spreadingButtonGroup);
self.spreading3DButton.textContent = 'Three-dimensional';
......
......@@ -39,21 +39,21 @@ var L;
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 distributionid = self.initials + 'distributionCard';
self.cardMap[distributionid] = new ITDistribution(distributionid, 'Distribution and spreading', this.accordionDiv, self.lang, map);
var spreadingid = self.initials + 'distributionCard';
self.cardMap[spreadingid] = new ITSpreading(spreadingid, 'Spreading', this.accordionDiv, self.lang, map);
_super.prototype.setup.call(this, map);
var chain = [];
chain[locationid] = periodid;
chain[periodid] = distributionid;
chain[distributionid] = '';
chain[periodid] = spreadingid;
chain[spreadingid] = '';
self.cardMap[locationid].oncallback = function (gonext) {
_super.prototype.callback.call(_this, chain, locationid, gonext);
};
self.cardMap[periodid].oncallback = function (gonext) {
_super.prototype.callback.call(_this, chain, periodid, gonext);
};
self.cardMap[distributionid].oncallback = function (gonext) {
_super.prototype.callback.call(_this, chain, distributionid, gonext);
self.cardMap[spreadingid].oncallback = function (gonext) {
_super.prototype.callback.call(_this, chain, spreadingid, gonext);
};
};
InstantTracer.prototype.ready = function (name) {
......
{"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,iCAAkB;YAejD,uBAAY,OAAO;gBAAnB,YACI,kBAAM,OAAO,CAAC,SAMjB;gBALG,KAAI,CAAC,IAAI,GAAG,OAAO,CAAC;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,CAAC;gBAC/C,CAAC,CAAC;YAEN,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,AAjED,CAAmC,MAAM,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
......@@ -42,21 +42,21 @@ module L.Control {
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 distributionid = self.initials+'distributionCard';
self.cardMap[distributionid] = new ITDistribution(distributionid, 'Distribution and spreading', this.accordionDiv, self.lang, map);
var spreadingid = self.initials+'distributionCard';
self.cardMap[spreadingid] = new ITSpreading(spreadingid, 'Spreading', this.accordionDiv, self.lang, map);
super.setup(map);
var chain = [];
chain[locationid] = periodid;
chain[periodid] = distributionid;
chain[distributionid] = '';
chain[periodid] = spreadingid;
chain[spreadingid] = '';
self.cardMap[locationid].oncallback = (gonext) => {
super.callback(chain, locationid, gonext);
};
self.cardMap[periodid].oncallback = (gonext) => {
super.callback(chain, periodid, gonext);
};
self.cardMap[distributionid].oncallback = (gonext) => {
super.callback(chain, distributionid, gonext);
self.cardMap[spreadingid].oncallback = (gonext) => {
super.callback(chain, spreadingid, 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