aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/smtk2ssrf.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/smtk2ssrf.pl')
-rwxr-xr-xscripts/smtk2ssrf.pl11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/smtk2ssrf.pl b/scripts/smtk2ssrf.pl
index ae10b6ee0..8b1fbceaa 100755
--- a/scripts/smtk2ssrf.pl
+++ b/scripts/smtk2ssrf.pl
@@ -6,6 +6,7 @@ $CGI::POST_MAX = 1024 * 1024 * 10;
# Change this to the correct path to binary.
my $smtk2ssrf = "../build/smtk2ssrf";
+my $diviac = "../scripts/diviac.pl";
my $logfile = '/tmp/smtk2ssrf.log';
my $q = CGI->new;
@@ -17,6 +18,12 @@ if ($q->upload("uploaded_file")) {
my $new_filename = $original_filename;
$new_filename =~ s/.*[\/\\]//;
$new_filename =~ s/\..*$/.ssrf/;
+ my $converted;
+ if ($q->param('filetype') eq "Diviac") {
+ $converted = `$diviac $tmp_filename`;
+ } else {
+ $converted = `$smtk2ssrf $tmp_filename -`;
+ }
if (length($converted) > 5) {
@@ -40,11 +47,11 @@ if ($q->upload("uploaded_file")) {
print $q->start_multipart_form();
- print $q->h1("Convert Smartrack files to Subsurface");
-
+ print $q->h1("Convert Smartrack and Diviac files to Subsurface");
print $q->filefield( -name => "uploaded_file",
-size => 50,
-maxlength => 200);
+ print $q->popup_menu(-name => "filetype", -values => ["Smartrack", "Diviac"]);
print $q->submit();
print $q->end_form();