mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Take care of mintime (removed maxtime)
This commit is contained in:
@@ -259,12 +259,13 @@ class Satellite extends CI_Controller {
|
||||
$yourgrid = $this->security->xss_clean($this->input->post('yourgrid'));
|
||||
$altitude = $this->security->xss_clean($this->input->post('altitude'));
|
||||
$date = $this->security->xss_clean($this->input->post('date'));
|
||||
$mintime = $this->security->xss_clean($this->input->post('mintime'));
|
||||
$minelevation = $this->security->xss_clean($this->input->post('minelevation'));
|
||||
$timezone = $this->security->xss_clean($this->input->post('timezone'));
|
||||
if (($this->security->xss_clean($this->input->post('sat')) ?? '') != '') { // specific SAT
|
||||
$data = $this->calcPass($tles[0], $yourgrid, $altitude, $date, $minelevation, $timezone);
|
||||
$data = $this->calcPass($tles[0], $yourgrid, $altitude, $date, $mintime, $minelevation, $timezone);
|
||||
} else { // All SATs
|
||||
$data = $this->calcPasses($tles, $yourgrid, $altitude, $date, $minelevation, $timezone);
|
||||
$data = $this->calcPasses($tles, $yourgrid, $altitude, $date, $mintime,$minelevation, $timezone);
|
||||
}
|
||||
$this->load->view('satellite/passtable', $data);
|
||||
}
|
||||
@@ -304,7 +305,7 @@ class Satellite extends CI_Controller {
|
||||
return $tles;
|
||||
}
|
||||
|
||||
function calcPasses($sat_tles, $yourgrid, $altitude, $date, $minelevation, $timezone) {
|
||||
function calcPasses($sat_tles, $yourgrid, $altitude, $date, $mintime, $minelevation, $timezone) {
|
||||
if(!$this->user_model->authorize(3)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
require_once "./src/predict/Predict.php";
|
||||
@@ -347,7 +348,7 @@ class Satellite extends CI_Controller {
|
||||
$tle = new Predict_TLE($sat_tle->satellite, $temp[0], $temp[1]); // Instantiate it
|
||||
$sat = new Predict_Sat($tle); // Load up the satellite data
|
||||
|
||||
$now = $this->get_daynum_from_date($date); // get the current time as Julian Date (daynum)
|
||||
$now = $this->get_daynum_from_date($date)+($mintime/24); // get the current time as Julian Date (daynum)
|
||||
|
||||
// You can modify some preferences in Predict(), the defaults are below
|
||||
//
|
||||
@@ -384,7 +385,7 @@ class Satellite extends CI_Controller {
|
||||
|
||||
}
|
||||
|
||||
function calcPass($sat_tle, $yourgrid, $altitude, $date, $minelevation, $timezone) {
|
||||
function calcPass($sat_tle, $yourgrid, $altitude, $date, $mintime, $minelevation, $timezone) {
|
||||
if(!$this->user_model->authorize(3)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
require_once "./src/predict/Predict.php";
|
||||
@@ -424,7 +425,7 @@ function calcPass($sat_tle, $yourgrid, $altitude, $date, $minelevation, $timezon
|
||||
$tle = new Predict_TLE($sat_tle->satellite, $temp[0], $temp[1]); // Instantiate it
|
||||
$sat = new Predict_Sat($tle); // Load up the satellite data
|
||||
|
||||
$now = $this->get_daynum_from_date($date); // get the current time as Julian Date (daynum)
|
||||
$now = $this->get_daynum_from_date($date)+($mintime/24); // get the current time as Julian Date (daynum)
|
||||
|
||||
// You can modify some preferences in Predict(), the defaults are below
|
||||
//
|
||||
|
||||
@@ -480,18 +480,10 @@
|
||||
<label class="my-1 me-sm-2 w-auto" for="mintime"><?= __("Min. time"); ?></label>
|
||||
<select class="my-1 me-sm-2 w-auto form-select form-select-sm" id="mintime" name="mintime">
|
||||
<?php for ($i = 0; $i <= 24; $i += 1): ?>
|
||||
<option value="<?= $i ?>" <?= $i === 00 ? 'selected' : '' ?>><?= $i ?>:00</option>
|
||||
<option value="<?= $i ?>" <?= ($i == gmdate("H")) ? 'selected' : '' ?>><?= $i ?>:00</option>
|
||||
<?php endfor; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3 w-auto">
|
||||
<label class="my-1 me-sm-2 w-auto" for="maxtime"><?= __("Max. time"); ?></label>
|
||||
<select class="my-1 me-sm-2 w-auto form-select form-select-sm" id="maxtime" name="maxtime">
|
||||
<?php for ($i = 0; $i <= 24; $i += 1): ?>
|
||||
<option value="<?= $i ?>" <?= $i === 24 ? 'selected' : '' ?>><?= $i ?>:00</option>
|
||||
<?php endfor; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3 w-auto">
|
||||
<label class="my-1 me-sm-2 w-auto" id="satslabel" for="satlist"><?= __("Satellite"); ?></label>
|
||||
<select class="my-1 me-sm-2 w-auto form-select form-select-sm" id="satlist">
|
||||
|
||||
Reference in New Issue
Block a user