1
function EXPORT_CONFIG() {
8
function EXPORT(format_sel_id, resample_sel_id, mask_sel_id, window_sel_id) {
9
this.cfg = new EXPORT_CONFIG();
11
this.formatsel = new SELECT(format_sel_id, exportUpdateFormat, this);
12
this.samplesel = new SELECT(resample_sel_id, exportUpdateSampling, this);
13
this.masksel = new SELECT(mask_sel_id, exportUpdateMask, this);
14
this.winsel = new SELECT(window_sel_id, exportUpdateWindow, this);
19
EXPORT.prototype.AttachConfig = function(config) {
21
config.Register(this);
24
EXPORT.prototype.Init = function(opts) {
25
if (typeof opts == "undefined") opts = new Object;
33
EXPORT.prototype.Export = function(embedded_mode, window_type) {
35
var opts = "format=" + this.cfg.format + "&resample=" + this.cfg.resample + "&mask_mode=" + this.cfg.mask;
36
if (typeof window_type != "undefined") {
37
opts += "&" + this.config.GetProps(window_type);
38
} else if (embedded_mode) {
39
opts += "&" + this.config.GetProps(-1);
41
opts += "&" + this.config.GetProps(this.cfg.window);
44
document.location = adei.GetServiceURL("getdata", opts);
47
EXPORT.prototype.SetFormat = function(val) {
48
this.Update(new Object({ 'format': val, 'apply': true}));
51
EXPORT.prototype.SetSampling = function(val) {
52
this.Update(new Object({ 'export_sampling': val, 'apply': true}));
55
EXPORT.prototype.SetMask = function(val) {
56
this.Update(new Object({ 'export_mask': val, 'apply': true}));
59
EXPORT.prototype.ReadConfig = function(opts) {
61
var opts = new Object({'apply': true});
62
if (this.config.cfg_extra.format)
63
opts.format = this.config.cfg_extra.format;
65
if (this.config.cfg_extra.resample)
66
opts.export_sampling = this.config.cfg_extra.resample;
68
if (this.config.cfg_extra.mask_mode)
69
opts.export_mask = this.config.cfg_extra.mask_mode;
76
EXPORT.prototype.Update = function(opts) {
79
this.formatsel.Update(adei.GetService("format"), opts, opts?opts.format:null);
80
this.samplesel.Update(adei.GetService("export_sampling"), opts, opts?opts.export_sampling:null);
81
this.masksel.Update(adei.GetService("export_mask"), opts, opts?opts.export_mask:null);
82
this.winsel.Update(adei.GetService("export_window"), opts, opts?opts.export_window:null);
85
this.UpdateFormat(opts.format, opts);
86
if (this.formatsel.GetValue() != opts.format)
87
this.formatsel.SetValue(opts.format);
89
if (opts.export_sampling) {
90
this.UpdateSampling(opts.export_sampling, opts);
91
if (this.samplesel.GetValue() != opts.export_sampling)
92
this.samplesel.SetValue(opts.export_sampling);
94
if (opts.export_mask) {
95
this.UpdateMask(opts.export_mask, opts);
96
if (this.masksel.GetValue() != opts.export_mask)
97
this.masksel.SetValue(opts.export_mask);
99
if (opts.export_window) {
100
this.UpdateWindow(opts.export_window, opts);
101
if (this.winsel.GetValue() != opts.export_window)
102
this.winsel.SetValue(opts.export_window);
108
EXPORT.prototype.UpdateFormat = function(val, opts) {
109
this.cfg.format = val;
111
if ((typeof opts == "undefined")||(opts.apply))
112
this.Apply(val, null, null);
115
EXPORT.prototype.UpdateSampling = function(val, opts) {
116
this.cfg.resample = val;
118
if ((typeof opts == "undefined")||(opts.apply))
119
this.Apply(null, val, null);
122
EXPORT.prototype.UpdateMask = function(val, opts) {
125
if ((typeof opts == "undefined")||(opts.apply))
126
this.Apply(null, null, val);
129
EXPORT.prototype.UpdateWindow = function(val, opts) {
130
this.cfg.window = val;
133
EXPORT.prototype.Apply = function(format, sampling, mask) {
134
if ((format)||(sampling)||(mask))
135
this.config.SetExportSettings(format, sampling, mask);
137
this.config.SetExportSettings(this.cfg.format, this.cfg.resample, this.cfg.mask);
139
this.config.ReplaceURL();
143
EXPORT.prototype.GetTooltip = function() {
144
var res = this.formatsel.GetTitle();
146
if ((this.cfg.resample)&&(this.cfg.resample != "0")) {
147
res += ", " + translate("Resampling %s", this.samplesel.GetTitle());
149
if ((this.cfg.mask)&&(this.cfg.mask != "0")) {
150
res += ", " + translate("MultiMask");
156
function exportUpdateFormat(self, val, opts) {
157
return self.UpdateFormat(val, opts);
160
function exportUpdateSampling(self, val, opts) {
161
return self.UpdateSampling(val, opts);
164
function exportUpdateMask(self, val, opts) {
165
return self.UpdateMask(val, opts);
168
function exportUpdateWindow(self, val, opts) {
169
return self.UpdateWindow(val, opts);