diff --git a/templates/webpanel/Config.php b/templates/webpanel/Config.php deleted file mode 100644 index 2279883..0000000 --- a/templates/webpanel/Config.php +++ /dev/null @@ -1,7 +0,0 @@ - '/images/', - 'img_per_page' => 12, - 'lang' => 'es' -); -?> diff --git a/templates/webpanel/Controller/C_predict.php b/templates/webpanel/Controller/C_predict.php deleted file mode 100644 index f5b519e..0000000 --- a/templates/webpanel/Controller/C_predict.php +++ /dev/null @@ -1,6 +0,0 @@ -getPasses(); - require('Views/V_viewPasses.php'); -?> diff --git a/templates/webpanel/Controller/C_showDetail.php b/templates/webpanel/Controller/C_showDetail.php deleted file mode 100644 index 13b378c..0000000 --- a/templates/webpanel/Controller/C_showDetail.php +++ /dev/null @@ -1,8 +0,0 @@ -getEnhacements($pass_id); - $path = $con->getPath($pass_id); - require('Views/V_viewDetail.php'); -?> diff --git a/templates/webpanel/Controller/C_showLastImage.php b/templates/webpanel/Controller/C_showLastImage.php deleted file mode 100644 index 83e6bd6..0000000 --- a/templates/webpanel/Controller/C_showLastImage.php +++ /dev/null @@ -1,6 +0,0 @@ -getLastImage(); - require('Views/V_viewLastImage.php'); -?> diff --git a/templates/webpanel/Controller/C_showLastImages.php b/templates/webpanel/Controller/C_showLastImages.php deleted file mode 100644 index 80084ce..0000000 --- a/templates/webpanel/Controller/C_showLastImages.php +++ /dev/null @@ -1,11 +0,0 @@ -img_per_page; - $page_count = $con->totalPages($img_per_page); - if ($page < 1) $page = 1; - if ($page > $page_count) $page = $page_count; - $images = $con->getImages($page, $img_per_page); - require('Views/V_viewLastImages.php'); -?> diff --git a/templates/webpanel/Model/Conn.php b/templates/webpanel/Model/Conn.php deleted file mode 100644 index 80af475..0000000 --- a/templates/webpanel/Model/Conn.php +++ /dev/null @@ -1,82 +0,0 @@ -con = new SQLite3("/home/pi/raspberry-noaa/panel.db"); - } - - public function getPasses() { - $today = strtotime(date('Y-m-d', time())); - $query = $this->con->query("SELECT sat_name, is_active, - pass_start, pass_end, - max_elev FROM predict_passes - WHERE (pass_start > $today) ORDER BY - pass_start ASC;"); - $passes = []; - $i = 0; - while($row = $query->fetchArray()){ - $passes[$i] = $row; - $i++; - } - return $passes; - } - - public function totalPages($img_per_page) { - $total_pages = $this->con->querySingle("SELECT count() from decoded_passes;"); - return ceil($total_pages/$img_per_page); - } - - public function getImages($page, $img_per_page) { - $query = $this->con->prepare("SELECT decoded_passes.id, predict_passes.pass_start, - file_path, sat_type, predict_passes.sat_name, predict_passes.max_elev - FROM decoded_passes INNER JOIN predict_passes - ON predict_passes.pass_start = decoded_passes.pass_start - ORDER BY decoded_passes.pass_start DESC LIMIT ? OFFSET ?;"); - $query->bindValue(1, $img_per_page); - $query->bindValue(2, $img_per_page * ($page-1)); - $result = $query->execute(); - $images = []; - $i = 0; - while($row = $result->fetchArray()){ - $images[$i] = $row; - $i++; - } - return $images; - } - - public function getEnhacements($id) { - $query = $this->con->prepare('SELECT daylight_pass, sat_type, img_count - FROM decoded_passes WHERE id = ?;'); - $query->bindValue(1, $id); - $result = $query->execute(); - $pass = $result->fetchArray(); - switch($pass['sat_type']) { - case 0: // Meteor-M2 - $enhacements = ['-122-rectified.jpg']; - break; - case 1: // NOAA - if ($pass['daylight_pass'] == 1) { - $enhacements = ['-ZA.jpg','-MCIR.jpg','-MCIR-precip.jpg','-MSA.jpg','-MSA-precip.jpg','-HVC.jpg','-HVC-precip.jpg','-HVCT.jpg','-HVCT-precip.jpg']; - } else { - $enhacements = ['-ZA.jpg','-MCIR.jpg','-MCIR-precip.jpg']; - } - break; - case 2: // ISS - for ($x = 0; $x <= $pass['img_count']-1; $x++) { - $enhacements[] = "-$x.png"; - } - break; - } - return $enhacements; - } - - public function getPath($id) { - $query = $this->con->prepare('SELECT file_path FROM decoded_passes - WHERE id = ?;'); - $query->bindValue(1, $id); - $result = $query->execute(); - $image = $result->fetchArray(); - return $image['file_path']; - } - } -?> diff --git a/templates/webpanel/Model/index.html b/templates/webpanel/Model/index.html deleted file mode 100644 index e69de29..0000000 diff --git a/templates/webpanel/TODO b/templates/webpanel/TODO new file mode 100644 index 0000000..98e0780 --- /dev/null +++ b/templates/webpanel/TODO @@ -0,0 +1,4 @@ +* Change location of database file (sub-directory and ignore in git) +** Update config.php +* Include more details in pass table like "was captured" or not + diff --git a/templates/webpanel/Views/V_viewDetail.php b/templates/webpanel/Views/V_viewDetail.php deleted file mode 100644 index 15172e8..0000000 --- a/templates/webpanel/Views/V_viewDetail.php +++ /dev/null @@ -1,23 +0,0 @@ -
-