aboutsummaryrefslogtreecommitdiffstats
path: root/config/lcdproc-dev/lcdproc_client.php
diff options
context:
space:
mode:
authorMichele Di Maria <michele@nt2.it>2011-12-16 21:25:07 +0100
committerMichele Di Maria <michele@nt2.it>2011-12-16 21:25:07 +0100
commitc0057e64c6416a45fad9afa5e32697327ab40404 (patch)
treee45a3b1b05f37c50aab2abd4581b96a53e232911 /config/lcdproc-dev/lcdproc_client.php
parenta384a219085afdae14b50a5b5bd922ad7db88088 (diff)
downloadpfsense-packages-c0057e64c6416a45fad9afa5e32697327ab40404.tar.gz
pfsense-packages-c0057e64c6416a45fad9afa5e32697327ab40404.tar.bz2
pfsense-packages-c0057e64c6416a45fad9afa5e32697327ab40404.zip
Many improvements
1) Added the Package Info page (points to the forum page) 2) Added "(x86 only)" for the description of the nexcom driver (the only one outside the build platform) 3) Solved a problem that in certain condition caused a high CPU usage 4) Added as optional the "welcome screen+version"
Diffstat (limited to 'config/lcdproc-dev/lcdproc_client.php')
-rw-r--r--config/lcdproc-dev/lcdproc_client.php40
1 files changed, 26 insertions, 14 deletions
diff --git a/config/lcdproc-dev/lcdproc_client.php b/config/lcdproc-dev/lcdproc_client.php
index 526aee00..5c0edb77 100644
--- a/config/lcdproc-dev/lcdproc_client.php
+++ b/config/lcdproc-dev/lcdproc_client.php
@@ -138,6 +138,13 @@
return($status);
}
+ function get_version() {
+ global $g;
+ $version = @file_get_contents("/etc/version");
+ $version = trim($version);
+ return("{$g['product_name']} {$version}");
+ }
+
function get_cpufrequency(){
$cpufreqs = "";
exec("/sbin/sysctl -n dev.cpu.0.freq_levels", $cpufreqs);
@@ -473,19 +480,20 @@
$lcd_cmds = array();
$lcd_cmds[] = "hello";
$lcd_cmds[] = "client_set name pfSense";
- $lcd_cmds[] = "screen_add welcome_scr";
- $lcd_cmds[] = "screen_set welcome_scr heartbeat off";
- $lcd_cmds[] = "screen_set welcome_scr name welcome";
- $lcd_cmds[] = "screen_set welcome_scr duration $refresh_frequency";
- $lcd_cmds[] = "widget_add welcome_scr title_wdgt title";
- $lcd_cmds[] = "widget_add welcome_scr text_wdgt scroller";
- add_summary_declaration($lcd_cmds, "welcome_scr");
-
+
/* process screens to display */
if(is_array($lcdproc_screens_config)) {
foreach($lcdproc_screens_config as $name => $screen) {
if($screen == "on") {
switch($name) {
+ case "scr_version":
+ $lcd_cmds[] = "screen_add $name";
+ $lcd_cmds[] = "screen_set $name heartbeat off";
+ $lcd_cmds[] = "screen_set $name name $name";
+ $lcd_cmds[] = "screen_set $name duration $refresh_frequency";
+ $lcd_cmds[] = "widget_add $name title_wdgt string";
+ $lcd_cmds[] = "widget_add $name text_wdgt scroller";
+ break;
case "scr_time":
$lcd_cmds[] = "screen_add $name";
$lcd_cmds[] = "screen_set $name heartbeat off";
@@ -607,8 +615,6 @@
if(empty($g['product_name'])) {
$g['product_name'] = "pfSense";
}
- $version = @file_get_contents("/etc/version");
- $version = trim($version);
$refresh_frequency = get_lcdpanel_refresh_frequency();
/* keep a counter to see how many times we can loop */
$i = 1;
@@ -622,9 +628,9 @@
$lcd_summary_data = "";}
$lcd_cmds = array();
- $lcd_cmds[] = "widget_set welcome_scr title_wdgt \"Welcome to\"";
- $lcd_cmds[] = "widget_set welcome_scr text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$g['product_name']} {$version}\"";
- add_summary_values($lcd_cmds, "welcome_scr", $lcd_summary_data, $lcdpanel_width);
+
+ /* initializes the widget counter */
+ $widget_counter = 0;
/* process screens to display */
foreach((array) $lcdproc_screens_config as $name => $screen) {
@@ -632,6 +638,11 @@
continue;
}
switch($name) {
+ case "scr_version":
+ $version = get_version();
+ $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"Welcome to\"";
+ $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$version}\"";
+ break;
case "scr_time":
$time = date("n/j/Y H:i");
$lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ System Time\"";
@@ -701,9 +712,10 @@
break;
}
add_summary_values($lcd_cmds, $name, $lcd_summary_data, $lcdpanel_width);
+ $widget_counter++;
}
send_lcd_commands($lcd, $lcd_cmds);
- sleep($refresh_frequency);
+ sleep($refresh_frequency * $widget_counter);
$i++;
}
}