diff --git a/BuildTools/CommonDistFiles/cache.sqlite b/BuildTools/CommonDistFiles/cache.sqlite index 990c24144..569ee20ff 100644 Binary files a/BuildTools/CommonDistFiles/cache.sqlite and b/BuildTools/CommonDistFiles/cache.sqlite differ diff --git a/DialogTools/AutoUpdateDlg.cpp b/DialogTools/AutoUpdateDlg.cpp index 78af7a53e..6e62f7d1b 100644 --- a/DialogTools/AutoUpdateDlg.cpp +++ b/DialogTools/AutoUpdateDlg.cpp @@ -169,6 +169,7 @@ wxString AutoUpdate::CheckUpdate() // could be a testing version if (isTestMode + && update_build >= Gda::version_build // e.g. 1.8.5 vs 1.8.4 && update_build % 2 == 1 // e.g. 1.8.5 && update_subbuild >= 0 ) { // 1.8.5.1 return version; @@ -216,7 +217,18 @@ wxString AutoUpdate::GetUpdateUrl(wxString checklist) wxString AutoUpdate::GetCheckList() { + bool isTestMode = false; + std::vector test_mode = OGRDataAdapter::GetInstance().GetHistory("test_mode"); + if (!test_mode.empty() && test_mode[0] == "yes") { + isTestMode = true; + } + wxString checklistUrl = "http://geodacenter.github.io/updates/checklist"; + + if (isTestMode) { + checklistUrl = "http://geodacenter.github.io/updates/test.checklist"; + } + // download checklist.txt if ( GeneralWxUtils::isWindows()) { if (GeneralWxUtils::isX86()) { diff --git a/Explore/LineChartStats.cpp b/Explore/LineChartStats.cpp index 574610af4..5dfa83c95 100644 --- a/Explore/LineChartStats.cpp +++ b/Explore/LineChartStats.cpp @@ -543,7 +543,7 @@ void LineChartStats::UpdateTtest() fisher_f dist(df_treat, df_res); double q = cdf(complement(dist, fabs(f_val))); - deg_free = (obs_sz_i-1); + deg_free = obs_sz_i-1; test_stat = f_val; p_val = q; diff --git a/Explore/LineChartView.cpp b/Explore/LineChartView.cpp index 697a6fb66..ffc04a9ba 100644 --- a/Explore/LineChartView.cpp +++ b/Explore/LineChartView.cpp @@ -2162,7 +2162,11 @@ void LineChartFrame::UpdateStatsWinContent(int var) s<< ""; s<< "D.F. "; stringstream _s; - _s << (int)lcs.deg_free; + if (choice_groups->GetSelection() == 0) + _s << (int)lcs.deg_free; + else + _s << (int)(lcs.deg_free * 2); + _s << std::fixed << std::setprecision(2); s<< "" << _s.str() << ""; s<< ""; @@ -2189,9 +2193,9 @@ void LineChartFrame::UpdateStatsWinContent(int var) s<< "D.F. "; stringstream _s; if (choice_group1->GetSelection() == 0) { - _s << (int)lcs.deg_free_c[1]; + _s << (int)lcs.deg_free_c[1] * 2; } else { - _s << (int)lcs.deg_free_c[4]; + _s << (int)lcs.deg_free_c[4] * 2; } _s << std::fixed << std::setprecision(2); s<< "" << _s.str() << ""; diff --git a/GeoDa.cpp b/GeoDa.cpp index 0d3070590..e1ec17628 100644 --- a/GeoDa.cpp +++ b/GeoDa.cpp @@ -5680,11 +5680,11 @@ void GdaFrame::OnCheckUpdates(wxCommandEvent& WXUNUSED(event) ) void GdaFrame::OnCheckTestMode(wxCommandEvent& event) { - wxString checked = "no"; + std::string checked = "no"; if (event.IsChecked()) { checked = "yes"; } - OGRDataAdapter::GetInstance().AddEntry("test_mode", std::string(checked.mb_str())); + OGRDataAdapter::GetInstance().AddEntry("test_mode", checked); } void GdaFrame::OnHelpAbout(wxCommandEvent& WXUNUSED(event) ) diff --git a/ShapeOperations/GalWeight.cpp b/ShapeOperations/GalWeight.cpp index 7087338af..1bdfdd2aa 100644 --- a/ShapeOperations/GalWeight.cpp +++ b/ShapeOperations/GalWeight.cpp @@ -265,7 +265,7 @@ bool GalWeight::SaveDIDWeights(Project* project, int num_obs, std::vector= 0;) { int n_id = gal[orig_id][cp]; - out << n_id + offset; + out << n_id + offset + 1; // n_id starts from 0, so add 1 if (cp > 0) out << " "; } out << endl; diff --git a/ShapeOperations/GdaCache.cpp b/ShapeOperations/GdaCache.cpp index 4bbede0d5..f8954f307 100644 --- a/ShapeOperations/GdaCache.cpp +++ b/ShapeOperations/GdaCache.cpp @@ -64,6 +64,8 @@ GdaCache::GdaCache() GdaCache::~GdaCache() { + history_table->Save(); + delete history_table; history_table = NULL; delete cach_ds_proxy; @@ -115,7 +117,9 @@ void GdaCache::AddEntry(std::string param_key, std::string param_val) history_vals.push_back( param_val ); // add to spatialite table std::string sql = "INSERT INTO history VALUES('" + param_key +"','"+param_val + "')"; - cach_ds_proxy->ExecuteSQL(sql); + //cach_ds_proxy->ExecuteSQL(sql); + OGRLayer* tmp_layer = cach_ds_proxy->ds->ExecuteSQL(sql.c_str(), 0, "SQLITE"); + cach_ds_proxy->ds->ReleaseResultSet(tmp_layer); } void GdaCache::CleanHistory() diff --git a/ShapeOperations/GwtWeight.cpp b/ShapeOperations/GwtWeight.cpp index 2fbed392b..6e54594eb 100644 --- a/ShapeOperations/GwtWeight.cpp +++ b/ShapeOperations/GwtWeight.cpp @@ -112,7 +112,7 @@ bool GwtWeight::SaveDIDWeights(Project* project, int num_obs, std::vectorGetDriverName()); - if (!ds || (drv_name == "OpenFileGDB")) { + + if (ds==0) { + //wxString drv_name(ds->GetDriverName()); + //if (drv_name == "OpenFileGDB") { // raise open fialed // we don't use OpenFileGDB since it has some bugs string error_detail = CPLGetLastErrorMsg(); ostringstream msg; - if ( error_detail.length() == 0 || error_detail == "Unknown") { - msg << "Failed to open data source. Please check the data and check if the data type/format is supported by GeoDa.\n\nTip: you can set up the necessary GeoDa driver by following the instructions at:\n http://geodacenter.github.io/formats.html"; - } else { - msg << error_detail; - } + msg << "Failed to open data source. Please check the data/datasource and check if the data type/format is supported by GeoDa.\n\nTip: you can set up the necessary GeoDa driver by following the instructions at:\n http://geodacenter.github.io/formats.html"; + //if ( error_detail.length() == 0 || error_detail == "Unknown") { + //} else { + // msg << error_detail; + //} throw GdaException(msg.str().c_str()); + //} } is_writable = false; } @@ -216,7 +219,9 @@ vector OGRDatasourceProxy::GetLayerNames() OGRLayerProxy* OGRDatasourceProxy::ExecuteSQL(string sql) { - ds->ExecuteSQL(sql.c_str(), 0, 0); + OGRLayer* tmp_layer = ds->ExecuteSQL(sql.c_str(), 0, 0); + //tmp_layer->SyncToDisk(); + ds->ReleaseResultSet(tmp_layer); return NULL; } diff --git a/ShapeOperations/WeightUtils.cpp b/ShapeOperations/WeightUtils.cpp index 37d6035ef..6dd8ff212 100644 --- a/ShapeOperations/WeightUtils.cpp +++ b/ShapeOperations/WeightUtils.cpp @@ -260,7 +260,7 @@ GalElement* WeightUtils::ReadGal(const wxString& fname, msg << "range of 1 through " << num_obs << "."; } else { msg << " encountered which does not exist in field \""; - msg << key_field << " of the Table."; + msg << key_field << "\" of the Table."; } LOG_MSG(msg); wxMessageDialog dlg(NULL, msg, "Error", wxOK | wxICON_ERROR); @@ -288,7 +288,7 @@ GalElement* WeightUtils::ReadGal(const wxString& fname, if (it == id_map.end()) { wxString msg = "On line "; msg << line_cnt << " of weights file, observation id "; - msg << obs; + msg << neigh; if (use_rec_order) { msg << " encountered which is out of allowed "; msg << "observation "; @@ -296,7 +296,7 @@ GalElement* WeightUtils::ReadGal(const wxString& fname, } else { msg << " encountered which does not exist "; msg << "in field \"" << key_field; - msg << " of the Table."; + msg << "\" of the Table."; } LOG_MSG(msg); wxMessageDialog dlg(NULL, msg, "Error", @@ -521,7 +521,7 @@ GalElement* WeightUtils::ReadGwtAsGal(const wxString& fname, msg << "range of 1 through " << num_obs << "."; } else { msg << " encountered which does not exist in field \""; - msg << key_field << " of the Table."; + msg << key_field << "\" of the Table."; } LOG_MSG(msg); wxMessageDialog dlg(NULL, msg, "Error", wxOK | wxICON_ERROR); @@ -728,7 +728,7 @@ GwtElement* WeightUtils::ReadGwt(const wxString& fname, msg << "range of 1 through " << num_obs << "."; } else { msg << " encountered which does not exist in field \""; - msg << key_field << " of the Table."; + msg << key_field << "\" of the Table."; } LOG_MSG(msg); wxMessageDialog dlg(NULL, msg, "Error", wxOK | wxICON_ERROR); diff --git a/version.h b/version.h index 895fa8bee..ffa30775c 100644 --- a/version.h +++ b/version.h @@ -5,7 +5,7 @@ namespace Gda { const int version_subbuild = 0; const int version_year = 2016; const int version_month = 5; - const int version_day = 5; + const int version_day = 6; const int version_night = 0; const int version_type = 1; // 0: alpha, 1: beta, 2: release }