-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo_of_usage.php
More file actions
38 lines (29 loc) · 1.4 KB
/
demo_of_usage.php
File metadata and controls
38 lines (29 loc) · 1.4 KB
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
32
33
34
35
36
37
38
<!--
A large portion of this file was deleted.
I left what I thought might help illustrate the functioning of the PHP classes modeling the gnuplot functionality
which reside in gnuplot_interface.php
-->
<?php
// include the classes for the gnuplot functionality
include("gnuplot_interface.php");
// these names are used in gnuplot_3d_parameters
$xDimensionName = "Column 1";
$yDimensionName = "Column 2";
$zDimensionName = "Column 3";
include("./gnuplot_parameters/gnuplot_shared_parameters.php");
include("./gnuplot_parameters/gnuplot_3d_parameters.php");
// set desired title for the image
$gnuplot_object->set_title("Center of Mass");
$gnuplot_object->set_key_name("Frame #");
while ($currentFrame <= $lastFrame) {
// create an SQL query
$queryRun = " SELECT $query_id" . "('" . $tableName . "' , $f," . ($currentFrame - 1) . ",$frameSkip,$molIndexmin,$molIndexmax,$atomIndexmin,$atomIndexmax,$minX,$minY,$minZ,$maxX,$maxY,$maxZ, '" . implode("_", $molName) . "',$whole,$whole_pcb, '{";
// execute the SQL query and store the results in a variable
$result = pg_query($queryRun);
while ($row = pg_fetch_row($result)) {
// iterate through the query results and add data points to the gnuplot data file
$gnuplot_object->record_data($matches[0][1], $matches[0][2], $matches[0][3]);
}
// call gnuplot and save the visualization file to disk
$output_file_location = $gnuplot_object->export();
?>