Skip to content

Commit

Permalink
Merge pull request #430 from lixun910/master
Browse files Browse the repository at this point in the history
1.8.7.3
  • Loading branch information
lixun910 committed May 20, 2016
2 parents e379daa + ea980c0 commit d08cc94
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 18 deletions.
15 changes: 10 additions & 5 deletions DialogTools/AutoUpdateDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,16 @@ 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;
if (isTestMode) {
if (update_build > Gda::version_build) { // e.g. 1.8.5 vs 1.8.4
return version;
}
if (update_build == Gda::version_build && update_build %2 == 1) {
// e.g. 1.8.5
if ( update_subbuild > Gda::version_subbuild) {
return version;
}
}
}

return "";
Expand Down
52 changes: 50 additions & 2 deletions DialogTools/FieldNameCorrectionDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,19 @@ ScrolledWidgetsPane::ScrolledWidgetsPane(wxWindow* parent, wxWindowID id,
wxString field_name = all_fname[i];
field_names_dict[field_name] = field_name;

bool isValid = true;
if (!IsFieldNameValid(field_name) ) {
bad_fnames.insert(field_name);
isValid = false;

} else if (uniq_upper_fname.find(field_name.Upper()) !=
uniq_upper_fname.end()) {
dup_fname.insert(field_name);
isValid = false;
}
uniq_upper_fname.insert(field_name.Upper());
merged_field_names.push_back(field_name);
if (isValid)
merged_field_names.push_back(field_name);
}
if (!bad_fnames.empty() || !dup_fname.empty()) {
need_correction = true;
Expand Down Expand Up @@ -129,10 +133,53 @@ void ScrolledWidgetsPane::Init(vector<wxString>& merged_field_names,
wxStaticText* txt_orest=new wxStaticText(this, wxID_ANY, "Field restrictions:");
sizer->Add(txt_orest, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 15);

size_t ctrl_cnt = 0;

for (set<wxString>::iterator it=dup_fname.begin();
it != dup_fname.end(); ++it ) {
wxString field_name = *it;
warn_msg=DUP_WARN;

wxString id_name1, id_name2, id_name3;
id_name1 << "ID_FNAME_STAT_TXT_BASE" << ctrl_cnt;
id_name2 << "ID_INPUT_TXT_CTRL_BASE" << ctrl_cnt;
id_name3 << "ID_INFO_STAT_TXT_BASE" << ctrl_cnt;

wxString user_field_name = GetSuggestFieldName(field_name);
txt_fname.push_back(new wxStaticText(this, XRCID(id_name1), field_name));
sizer->Add(txt_fname[ctrl_cnt], 0, wxALIGN_LEFT|wxALL, 5);
txt_input.push_back(new wxTextCtrl(this, XRCID(id_name2), user_field_name, wxDefaultPosition,wxSize(240,-1)));
sizer->Add(txt_input[ctrl_cnt], 0, wxALIGN_LEFT|wxALL, 5);
txt_info.push_back(new wxStaticText(this, XRCID(id_name3), warn_msg));
sizer->Add(txt_info[ctrl_cnt], 0, wxALIGN_LEFT|wxALL, 5);

++ctrl_cnt;
}

size_t ctrl_cnt = 0;
for (set<wxString>::iterator it=bad_fname.begin();
it != bad_fname.end(); ++it ) {
wxString field_name = *it;
warn_msg=INV_WARN;

wxString id_name1, id_name2, id_name3;
id_name1 << "ID_FNAME_STAT_TXT_BASE" << ctrl_cnt;
id_name2 << "ID_INPUT_TXT_CTRL_BASE" << ctrl_cnt;
id_name3 << "ID_INFO_STAT_TXT_BASE" << ctrl_cnt;

wxString user_field_name = GetSuggestFieldName(field_name);
txt_fname.push_back(new wxStaticText(this, XRCID(id_name1), field_name));
sizer->Add(txt_fname[ctrl_cnt], 0, wxALIGN_LEFT|wxALL, 5);
txt_input.push_back(new wxTextCtrl(this, XRCID(id_name2), user_field_name, wxDefaultPosition,wxSize(240,-1)));
sizer->Add(txt_input[ctrl_cnt], 0, wxALIGN_LEFT|wxALL, 5);
txt_info.push_back(new wxStaticText(this, XRCID(id_name3), warn_msg));
sizer->Add(txt_info[ctrl_cnt], 0, wxALIGN_LEFT|wxALL, 5);

++ctrl_cnt;
}
/*
for (size_t i=0; i<num_controls; ++i) {
wxString field_name = merged_field_names[i];
if (dup_fname.find(field_name)!=dup_fname.end())
warn_msg=DUP_WARN;
else if (bad_fname.find(field_name)!=bad_fname.end())
Expand All @@ -155,6 +202,7 @@ void ScrolledWidgetsPane::Init(vector<wxString>& merged_field_names,
++ctrl_cnt;
}
*/

// buttons
wxStaticText* txt_dummy = new wxStaticText(this, wxID_ANY, "");
Expand Down
4 changes: 2 additions & 2 deletions Explore/LineChartView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2067,7 +2067,7 @@ void LineChartFrame::UpdateStatsWinContent(int var)

s<< "<table width=100% rules=\"rows\" >";
s<< "<tr bgcolor=\"#CCCCCC\" >";
s<< "<th width=110 align=\"center\">Group</th>";
s<< "<th width=130 align=\"center\">Group</th>";
s<< "<th align=\"center\">&nbsp;Obs.&nbsp;</th>";
s<< "<th align=\"center\">&nbsp;Mean&nbsp;</th>";
s<< "<th align=\"center\">&nbsp;S.D.&nbsp;</th>";
Expand Down Expand Up @@ -2163,7 +2163,7 @@ void LineChartFrame::UpdateStatsWinContent(int var)
s<< "<td bgcolor=\"#CCCCCC\" align=\"center\">D.F.&nbsp;</td>";
stringstream _s;
if (choice_groups->GetSelection() == 0)
_s << (int)lcs.deg_free;
_s << (int)lcs.deg_free -1;
else
_s << (int)(lcs.deg_free * 2);

Expand Down
4 changes: 2 additions & 2 deletions Explore/LisaMapNewView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,14 +647,14 @@ void LisaMapFrame::OnSaveLisa(wxCommandEvent& event)
}

data[2].d_val = &sig;
data[2].label = "Significances";
data[2].label = "Significance";
data[2].field_default = "LISA_P";
data[2].type = GdaConst::double_type;

if (lc->is_diff) {
data[3].d_val = &diff;
data[3].label = "Diff Values";
data[3].field_default = "DIFF_VAL";
data[3].field_default = "DIFF_VAL2";
data[3].type = GdaConst::double_type;
}

Expand Down
2 changes: 1 addition & 1 deletion GdaConst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ const wxColour GdaConst::pcp_line_color(128, 0, 64); // dark cherry
const wxColour GdaConst::pcp_horiz_line_color(0, 98, 0); // dark green

// Averages Chart
const wxSize GdaConst::line_chart_default_size(720, 580);
const wxSize GdaConst::line_chart_default_size(760, 580);

// colors defined in init()
wxColour GdaConst::ln_cht_clr_regimes_hl;
Expand Down
19 changes: 15 additions & 4 deletions ShapeOperations/OGRDataAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,26 @@ OGRDataAdapter::ExportDataSource(string o_ds_format,
int time_steps = table->GetTimeSteps();

for ( int id=0; id < table->GetNumberCols(); id++ ) {
for ( int t=0; t < time_steps; t++ ) {
wxString fname = table->GetColName(id, t);
if (table->IsColTimeVariant(id)) {
for ( int t=0; t < time_steps; t++ ) {
wxString fname = table->GetColName(id, t);
if (fname.IsEmpty()) {
wxString msg;
msg << "Field name is empty at position: " << id << " and time " << t;
throw GdaException(msg.mb_str(), GdaException::FIELD_NAME_EMPTY);
}
all_fnames.push_back(fname);
field_dict[fname] = make_pair(id, t);
}
} else {
wxString fname = table->GetColName(id);
if (fname.IsEmpty()) {
wxString msg;
msg << "Field name is empty at position: " << id << " and time " << t;
msg << "Field name is empty at position: " << id ;
throw GdaException(msg.mb_str(), GdaException::FIELD_NAME_EMPTY);
}
all_fnames.push_back(fname);
field_dict[fname] = make_pair(id, t);
field_dict[fname] = make_pair(id, 0);
}
}

Expand Down
4 changes: 2 additions & 2 deletions version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ namespace Gda {
const int version_major = 1;
const int version_minor = 8;
const int version_build = 7;
const int version_subbuild = 0;
const int version_subbuild = 3;
const int version_year = 2016;
const int version_month = 5;
const int version_day = 8;
const int version_day = 20;
const int version_night = 0;
const int version_type = 1; // 0: alpha, 1: beta, 2: release
}

0 comments on commit d08cc94

Please sign in to comment.