datareq

InfoInfo
Search:    

#!/usr/bin/perl
# modified to fix directories with new rsi application
# NJP 11-12-04
#!C:/perl/bin/perl

# could possibly be loosened
require 5.004;
# these are a good idea
use strict;
use English;
use CGI qw( :standard );
# CGI::Pretty is the same as CGI.pm but makes html human-readable
# 2000-11-20 CGI::Pretty is now broken (tables are missing parameters)
#use CGI::Pretty qw( :standard );

# our entry point
&::main;

sub main
{

}

sub Initialize
{

# $CGI::Pretty::INDENT = " ";

# $::idlExecutable = 'C:\\RSI\\idl50sv\\idlde.exe';
# $::cgiTmpDir = 'C:\\WWW\\cgi-bin\\maccs\\tmp\\';
# $::cgiTmpURL = '/cgi-bin/maccs/tmp/';
# $::htmlTmpDir = 'C:\\WWW\\htdocs\\maccs\\tmp\\';
# $::htmlTmpURL = '/htdocs/tmp/';
# $::htmlDataDir = 'C:\\WWW\\htdocs\\space\\webdata\\';
# $::htmlDataURL = '/space/webdata/';

# $::binParam = 'bin';
# $::iagaParam = 'iaga';
# $::pngParam = 'png';
# $::psParam = 'ps';

# @::yearNames = qw( 1992 1993 1994 1995 1996 1997 1998 Other );

# @::monthNames = qw( January February March April May June July August
# September October November December );

# @::dayNames = qw( 1 2 3 4 5 6 7
# 8 9 10 11 12 13 14
# 15 16 17 18 19 20 21
# 22 23 24 25 26 27 28
# 29 30 31);

END

}

sub PrintForm
{

<center>

</center>

<table bgcolor="#ffffff" border="0" align="center" cellpadding="10" width="768" height="73">

href="[WWW]http://space.augsburg.edu/space/read_data.html"> Read Me Page</a>.</font>

</table>
END

# TODO - figure out how to get hashes working in checkbox_group

# .&scrolling_list({-name=>$::stationParam,
# -values =>\@::stationNames,
# -size=>$scrollLines}); # single selection
# -size=>$scrollLines,
# -multiple=>'true'}); # multiple selection

# my $outputTypeCell = &h4('Output Type')
# .&font({-color=>'#ff0000', -size=>'-1'}, 'PNG and PostScript <br> are under construction.')
# .&radio_group({-name=>$::outputTypeParam,

# print
# &table({-bgcolor=>'#ffffff', -border=>'1', -width=>600, -align=>'center', -cellpadding=>10},
# &TR({-align=>'left', -valign=>'top'},
# [&th({-align=>'left', -valign=>'top'}, [$stationCell, $beginEndCell, $outputTypeCell])]) );

# '&nbsp;&nbsp;&nbsp;&nbsp;',
# &button({-name=>'jsbutton',
# -value=>'JavaScript Button',
# -onClick=>"showAlert()"}),

<ul>

</ul>

END

}

sub ProcessForm
{

# &::PrintDiagnosticMessage("hasBeginTime: $hasBeginTime");

# ($beginYear, $beginMonth, $beginDay, $beginHour, $beginMinute, $beginSecond)
# = ($beginTime =~ /(\d+)\D+(\d+)\D+(\d+)\D+(\d+)\D+(\d+)\D+(\d+)/);
# ($endYear, $endMonth, $endDay, $endHour, $endMinute, $endSecond)
# = ($endTime =~ /(\d+)\D+(\d+)\D+(\d+)\D+(\d+)\D+(\d+)\D+(\d+)/);

# my $isValidBeginTime = &::IsValidDateTime($beginSecond, $beginMinute, $beginHour,
# $beginDay, $beginMonth, $beginYear);
# my $isValidEndTime = &::IsValidDateTime($endSecond, $endMinute, $endHour,
# $endDay, $endMonth, $endYear);

# &::PrintDiagnosticMessage("Begin YMDH: $beginYear, $beginMonth, $beginDay, $beginHour, "
# ."End YMDH: $endYear, $endMonth, $endDay, $endHour");

# my $timestamp = sprintf("%02d%02d%02d%02d", $mday, $hour, $min, $sec);

# my $timestamp = sprintf("%02d%02d", $hour, $min);

# my $count = 0;

# $version = sprintf("%02d", $count);

# system("whoami");

# &::PrintErrorMessage("Unable to create IDL batch file.");

# my @beginDateTime = ($beginYear, $beginMonth, $beginDay,
# $beginHour, $beginMinute, $beginSecond);

# my @endDateTime = ($endYear, $endMonth, $endDay,
# $endHour, $endMinute, $endSecond);

# IDL student version under Windows doesn't allow creation of .sav files
# Our workaround is to just compile datareq.pro every time—which is actually
# convenient for testing. This might impact performance, but it might not.
# print IDLBATCHFILE "restore, 'datareq.sav'\n";

# system("$::idlExecutable $batchFile > $outFile 2>&1");

# system("$::idlExecutable $batchFile > /dev/null 2>&1");

# my $process = "$::idlExecutable";
# my $command = " "."\@"."$batchFile";
# my $pid = 0;
# &Win32::Spawn($process, $command, $pid);

# keep size of temporary file directories at the specified size in megs:
&PruneDirectory("$::htmlTmpDir", 200);
&PruneDirectory("$::cgiTmpDir", 10);

}

# returns false if any of the values in the specified date is not in the allowed
# range; parameter order follows that of localtime(), timelocal(), etc.
sub IsValidDateTime
{
# my $second = $_[0];
# my $minute = $_[1];
# my $hour = $_[2];
# my $day = $_[3];
# my $month = $_[4];
# my $year = $_[5];

# if ($second < 0 || $second > 59) {
# return 0;
# }
# if ($minute < 0 || $minute > 59) {
# return 0;
# }

}

sub PrintDiagnosticMessage
{

# prevent the CGI.pm functions called herein from losing their minds; they seem
# to rely on the @_ array ($_[0], $_[1], etc.; maybe there's a better way to do
# this?

# print '<HTML>';
# print '<HEAD>';
# print ' <TITLE>Test</TITLE>';
# print '</HEAD>';
# print '<BODY bgcolor=white link="#000080">';
# print '</BODY>';
# print '</HTML>';

}

sub PrintErrorMessage
{

# prevent the CGI.pm functions called herein from losing their minds; they seem
# to rely on the @_ array ($_[0], $_[1], etc.; maybe there's a better way to do
# this?

# print '<HTML>';
# print '<HEAD>';
# print ' <TITLE>Test</TITLE>';
# print '</HEAD>';
# print '<BODY bgcolor=white link="#000080">';
# print '</BODY>';
# print '</HTML>';

}

# removes files from the specified directory making the total size of the
# directory equal to or less than the specified size in megabytes
sub PruneDirectory
{

# my $theLocalTime = localtime($oldestTime);
# print "OLDEST FILE: $theLocalTime | TOTAL BYTES: $totalBytes bytes\n";

# my $theAccessTime = localtime($accessTime);
# print " DELETING '$filePath'\n $theAccessTime\n";

# ++$oldestTime;

}

This is a Wiki Spot wiki. Wiki Spot is a non-profit organization that helps communities collaborate via wikis.