Ignore:
Timestamp:
May 13, 2010, 10:21:05 PM (14 years ago)
Author:
grum
Message:

Improve algorythm for colors analysis + use GPCRequestBuilder interface instead of a local interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/ColorStat/cstat_aip.class.inc.php

    r6107 r6176  
    221221                dirname($this->getFileLocation()).'/admin/cstat_stat.tpl');
    222222
    223     $colorTable=$this->getColorTableWithStat();
     223    $colorTable=CStat_functions::getColorTableWithStat();
    224224
    225225
    226226    $datas=Array(
    227227      //'themeconf' => Array('name' => $template->get_themeconf('name')),
    228       'colorTable' => $this->htmlColorTable(
     228      'colorTable' => CStat_functions::htmlColorTable(
    229229                        $colorTable,
    230230                        ($this->config['analyze_colorTable']=='small')?19:10,
    231231                        "",
    232                         "color0px"
     232                        "color0px",
     233                        "<br>"
    233234                      ),
    234235      'urlRequest' => $this->getAdminLink(),
     
    250251                dirname($this->getFileLocation()).'/admin/cstat_search.tpl');
    251252
    252     $datas=Array(
    253       'dialogBox' => $this->dialogBoxColor(),
    254       'themeName' => $template->get_themeconf('name'),
    255     );
    256 
    257     $template->assign('datas', $datas);
     253    $template->assign('cstat_search_page', GPCRequestBuilder::displaySearchPage());
    258254
    259255    $template->assign_var_from_handle('CSTAT_BODY_PAGE', 'body_page');
     
    297293  {
    298294    global $template, $lang;
     295
     296    $configTabs=new GPCTabSheet('configTabsheet', $this->tabsheet->get_titlename(), 'tabsheet2 gcBorder', 'itab2');
     297    $configTabs->add('database',
     298                      l10n('cstat_database'),
     299                      '', true, "displayConfig('database');");
     300    $configTabs->add('statsearch',
     301                      l10n('cstat_stat_and_search'),
     302                      '', false, "displayConfig('statsearch');");
     303    $configTabs->add('display',
     304                      l10n('cstat_gallery_integration'),
     305                      '', false, "displayConfig('display');");
     306    $configTabs->assign();
    299307
    300308    $template->set_filename('body_page',
     
    390398
    391399
    392   protected function getGeneralStats()
    393   {
    394     $returned=Array(
    395       'nbImages' => 0,
    396       'totalTime' => 0,
    397       'pixelsAnalyzedMax' => 0,
    398       'pixelsAnalyzedMin' => 0,
    399       'pixelsAnalyzedAvg' => 0,
    400       'pixelsAnalyzedSum' => 0,
    401       'totalPixels' => 0,
    402       'ppsMax' => 0,
    403       'ppsMin' => 0,
    404       'ppsAvg' => 0,
    405       'qualityMax' => 0,
    406       'qualityMin' => 0,
    407       'qualityAvg' => 0,
    408     );
    409     $sql="SELECT COUNT(image_id) AS nbImages,
    410                  SUM(time) AS totalTime,
    411                  MAX(analyzed_pixels) AS pixelsAnalyzedMax,
    412                  MIN(analyzed_pixels) AS pixelsAnalyzedMin,
    413                  AVG(analyzed_pixels) AS pixelsAnalyzedAvg,
    414                  SUM(analyzed_pixels) AS pixelsAnalyzedSum,
    415                  SUM(num_pixels) AS totalPixels,
    416                  MAX(pps) AS ppsMax,
    417                  MIN(pps) AS ppsMin,
    418                  AVG(pps) AS ppsAvg,
    419                  MAX(quality) AS qualityMax,
    420                  MIN(quality) AS qualityMin,
    421                  AVG(quality) AS qualityAvg
    422           FROM ".$this->tables['images']."
    423           WHERE analyzed='y';";
    424     $result=pwg_query($sql);
    425     if($result)
    426     {
    427       while($row=pwg_db_fetch_assoc($result))
    428       {
    429         $returned=$row;
    430       }
    431     }
    432     return($returned);
    433   }
    434 
    435 
    436400  /**
    437401   * make consolidation for the color_table :
     
    626590      {
    627591        $colorTable=ColorStat::getColorTable(
    628           $this->colorTableSize[$this->config['analyze_colorTable']][0],
    629           $this->colorTableSize[$this->config['analyze_colorTable']][1]
     592          CStat_root::$colorTableSize[$this->config['analyze_colorTable']][0],
     593          CStat_root::$colorTableSize[$this->config['analyze_colorTable']][1]
    630594        );
    631595
     
    688652                  dirname($this->getFileLocation()).'/admin/cstat_stat_show_iListColors.tpl');
    689653
    690     $generalStats=$this->getGeneralStats();
     654    $generalStats=CStat_functions::getGeneralStats();
    691655
    692656    $sql="SELECT color_id, num_images, num_pixels
Note: See TracChangeset for help on using the changeset viewer.