\Anemometer

class Anemometer

This is the controller class for the Box Anemometer web application.

It is designed to closely resemble Codeigniter, so it can be easily added to a CI installation (untested.)

Public method represent controller actions, callable through the index.php

Summary

Methods
Properties
Constants
__construct()
api()
graph_search()
index()
noconfig()
quicksearch()
report()
samples()
show_query()
upd_query()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
setup_data_for_graph_search()
translate_checksum()
alert()
display_report_form()
footer()
get_auth_user()
header()
init_report()
set_search_defaults()
clear_all_time_values()
get_time_field_from_report_defaults()
bchexdec()
$conf
$data_model
$report_obj
$header_printed
$exception_select_fields
$timezone_offset
N/A

Properties

$conf

$conf : 

Type

$data_model

$data_model : 

Type

$report_obj

$report_obj : 

Type

$header_printed

$header_printed : 

Type

$exception_select_fields

$exception_select_fields : 

Type

$timezone_offset

$timezone_offset : 

Type

Methods

__construct()

__construct(\type  $conf) 

Constructor. Pass in the global configuration object

Parameters

\type $conf

api()

api() 

main method for getting report results. This method can be called as an ajax callback and return the raw data in json format, or it can display a table or graph directly. All other methods that get report results use this either directly or as an ajax call.

graph_search()

graph_search() 

Search by using a graph. A brief search form is shown to allow a graph to be built. Html table results that correspond to the time range of the graph is displayed below. Regions can be selected in the graph directly which will update the table results with the new time range.

index()

index() 

show the index page where users can select the datasource. If there's only one, just redirect to the default report

noconfig()

noconfig() 

quicksearch()

quicksearch() 

Search for a checksum value. Redirect to show_query if it's found or display an error message

report()

report() 

Display the search form, and the report results (by default as a html table)

samples()

samples() 

Show query samples for a specific checksum

show_query()

show_query() 

Display a specific query from its checksum value

upd_query()

upd_query() 

Update the review and comments for a query by its checksum

setup_data_for_graph_search()

setup_data_for_graph_search(  $data = null) 

Parameters

$data

translate_checksum()

translate_checksum(  $checksum) 

Parameters

$checksum

alert()

alert(string  $string, string  $level = 'alert-warning') 

display a message in a formatted div element

Parameters

string $string

The message to display

string $level

The div class to use (default alert-warning)

display_report_form()

display_report_form(  $data) 

Parameters

$data

footer()

footer() 

display the global web application footer

get_auth_user()

get_auth_user() 

return the current username. First from any .htaccess login if set, or from the session if possible.

header()

header() : boolean

display the web application header

Returns

boolean —

return true if the header was actually printed

init_report()

init_report() 

sets up or resets the report object

set_search_defaults()

set_search_defaults(\type  $type = 'report_defaults', \type  $override = null) 

set default values for the search form

Parameters

\type $type
\type $override

clear_all_time_values()

clear_all_time_values() 

get_time_field_from_report_defaults()

get_time_field_from_report_defaults(  $type) 

Parameters

$type

bchexdec()

bchexdec(  $hex) 

Parameters

$hex