Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.8.7.9 with bug fixes #442

Merged
merged 12 commits into from May 27, 2016
Empty file modified BuildTools/ubuntu/build_travis.sh 100644 → 100755
Empty file.
28 changes: 9 additions & 19 deletions Explore/ConnectivityHistView.cpp
Expand Up @@ -309,15 +309,12 @@ void ConnectivityHistCanvas::PopulateCanvas()
}

double x_min = 0;
double x_max = left_pad_const + right_pad_const
+ interval_width_const * cur_intervals +
+ interval_gap_const * (cur_intervals-1);
double x_max = left_pad_const + right_pad_const + interval_width_const * cur_intervals + interval_gap_const * (cur_intervals-1);

// orig_x_pos is the center of each histogram bar
std::vector<double> orig_x_pos(cur_intervals);
for (int i=0; i<cur_intervals; i++) {
orig_x_pos[i] = left_pad_const + interval_width_const/2.0
+ i * (interval_width_const + interval_gap_const);
orig_x_pos[i] = left_pad_const + interval_width_const/2.0 + i * (interval_width_const + interval_gap_const);
}

shps_orig_xmin = x_min;
Expand All @@ -326,32 +323,27 @@ void ConnectivityHistCanvas::PopulateCanvas()
shps_orig_ymax = max_num_obs_in_ival;

if (show_axes) {
axis_scale_y = AxisScale(0, shps_orig_ymax, 5);
axis_scale_y = AxisScale(0, shps_orig_ymax, 5, 0);
shps_orig_ymax = axis_scale_y.scale_max;
y_axis = new GdaAxis("Frequency", axis_scale_y,
wxRealPoint(0,0), wxRealPoint(0, shps_orig_ymax),
-9, 0);
y_axis = new GdaAxis("Frequency", axis_scale_y, wxRealPoint(0,0), wxRealPoint(0, shps_orig_ymax), -9, 0);
background_shps.push_back(y_axis);

axis_scale_x = AxisScale(0, max_ival_val);
//shps_orig_xmax = axis_scale_x.scale_max;
axis_scale_x.data_min = min_ival_val;
axis_scale_x.data_max = max_ival_val;
axis_scale_x.scale_min = axis_scale_x.data_min;
axis_scale_x.scale_max = axis_scale_x.data_max;

double range = axis_scale_x.scale_max - axis_scale_x.scale_min;
LOG(axis_scale_x.data_max);
axis_scale_x.scale_range = range;
axis_scale_x.p = floor(log10(range));
axis_scale_x.ticks = cur_intervals+1;
axis_scale_x.ticks = cur_intervals + 1;
axis_scale_x.tics.resize(axis_scale_x.ticks);
axis_scale_x.tics_str.resize(axis_scale_x.ticks);
axis_scale_x.tics_str_show.resize(axis_scale_x.tics_str.size());
for (int i=0; i<axis_scale_x.ticks; i++) {
axis_scale_x.tics[i] =
axis_scale_x.data_min +
range*((double) i)/((double) axis_scale_x.ticks-1);
LOG(axis_scale_x.tics[i]);
axis_scale_x.tics[i] = axis_scale_x.data_min + range*((double) i)/((double) axis_scale_x.ticks-1);
std::ostringstream ss;
ss << std::setprecision(3) << axis_scale_x.tics[i];
axis_scale_x.tics_str[i] = ss.str();
Expand All @@ -364,9 +356,7 @@ void ConnectivityHistCanvas::PopulateCanvas()
}
}
axis_scale_x.tic_inc = axis_scale_x.tics[1]-axis_scale_x.tics[0];
x_axis = new GdaAxis("Number of Neighbors",
axis_scale_x, wxRealPoint(0,0),
wxRealPoint(shps_orig_xmax, 0), 0, 9);
x_axis = new GdaAxis("Number of Neighbors", axis_scale_x, wxRealPoint(0,0), wxRealPoint(shps_orig_xmax, 0), 0, 9);
background_shps.push_back(x_axis);
}

Expand Down
92 changes: 53 additions & 39 deletions Explore/LineChartView.cpp
Expand Up @@ -323,13 +323,16 @@ void LineChartFrame::InitTimeChoiceCtrl()

choice_time1->Clear();
choice_time2->Clear();
for (size_t i=0; i<tm_strs.size(); i++ ) {
wxString t_str = tm_strs[i];
choice_time1->Append(t_str);
choice_time2->Append(t_str);
}


if (tm_strs.size() > 0) {
if (tm_strs.size() > 1) {

for (size_t i=0; i<tm_strs.size(); i++ ) {
wxString t_str = tm_strs[i];
choice_time1->Append(t_str);
choice_time2->Append(t_str);
}

int group_selection = choice_groups->GetSelection();
if (group_selection == 0 &&
choice_group1->GetSelection() != choice_group2->GetSelection())
Expand Down Expand Up @@ -447,7 +450,8 @@ void LineChartFrame::OnVariableChoice(wxCommandEvent& event)
TableInterface* table_int = project->GetTableInt();
int col = table_int->FindColId(col_name);

if (!table_int->IsColTimeVariant(col_name)) {
if (!table_int->IsColTimeVariant(col_name) ||
table_int->GetTimeSteps() <= 1) {
choice_groups->SetSelection(0);
}

Expand Down Expand Up @@ -477,32 +481,35 @@ void LineChartFrame::OnTime1Choice(wxCommandEvent& event)
int time1_selection = choice_time1->GetSelection();
int time2_selection = choice_time2->GetSelection();
int group_selection = choice_groups->GetSelection();


int time_count = choice_time1->GetCount();

if (group_selection == 0 ) {
if (choice_group1->GetSelection() != choice_group2->GetSelection()) {
// sel vs excl
choice_time2->SetSelection(time1_selection);
} else {
// sel vs sel or excl vs excl
if (time2_selection == time1_selection) {
if (time2_selection -1 >=0)
choice_time2->SetSelection(time2_selection-1);
else if (time2_selection + 1 < choice_time2->GetCount()) {
choice_time2->SetSelection(time2_selection+1);
if (time2_selection == time1_selection ||
time1_selection > time2_selection) {
if (time1_selection +1 < time_count) {
choice_time2->SetSelection(time1_selection+1);
} else {
choice_time2->SetSelection(-1);
wxMessageBox("Please select Period 1 < Period 2.");
choice_time1->SetSelection(time_count-2);
choice_time2->SetSelection(time_count-1);
}
}
}
} else {
if (time2_selection == time1_selection) {
if (time2_selection -1 >=0)
choice_time2->SetSelection(time2_selection-1);
else if (time2_selection + 1 < choice_time2->GetCount()) {
choice_time2->SetSelection(time2_selection+1);
if (time2_selection == time1_selection||
time1_selection > time2_selection) {
if (time1_selection +1 < time_count) {
choice_time2->SetSelection(time1_selection+1);
} else {
choice_time2->SetSelection(-1);
wxMessageBox("Please select Period 1 < Period 2.");
choice_time1->SetSelection(time_count-2);
choice_time2->SetSelection(time_count-1);
}
}
}
Expand All @@ -515,31 +522,34 @@ void LineChartFrame::OnTime2Choice(wxCommandEvent& event)
int time1_selection = choice_time1->GetSelection();
int time2_selection = choice_time2->GetSelection();
int group_selection = choice_groups->GetSelection();
int time_count = choice_time1->GetCount();

if (group_selection == 0 ) {
if (choice_group1->GetSelection() != choice_group2->GetSelection()) {
// sel vs excl
choice_time1->SetSelection(time2_selection);
} else {
if (time2_selection == time1_selection) {
if (time1_selection -1 >=0)
choice_time1->SetSelection(time1_selection-1);
else if (time1_selection + 1 < choice_time1->GetCount()) {
choice_time1->SetSelection(time1_selection+1);
if (time2_selection == time1_selection ||
time1_selection > time2_selection) {
if (time2_selection - 1 >=0 ) {
choice_time1->SetSelection(time2_selection-1);
} else {
choice_time1->SetSelection(-1);
wxMessageBox("Please select Period 2 > Period 1.");
choice_time1->SetSelection(0);
choice_time2->SetSelection(1);
}
}
}

} else {
if (time2_selection == time1_selection) {
if (time1_selection -1 >=0)
choice_time1->SetSelection(time1_selection-1);
else if (time1_selection + 1 < choice_time1->GetCount()) {
choice_time1->SetSelection(time1_selection+1);
if (time2_selection == time1_selection||
time1_selection > time2_selection) {
if (time2_selection - 1 >=0 ) {
choice_time1->SetSelection(time2_selection-1);
} else {
choice_time1->SetSelection(-1);
wxMessageBox("Please select Period 2 > Period 1.");
choice_time1->SetSelection(0);
choice_time2->SetSelection(1);
}
}
}
Expand All @@ -553,9 +563,9 @@ void LineChartFrame::OnGroupsChoice(wxCommandEvent& event)
wxString col_name = variable_names[variable_selection];

TableInterface* table_int = project->GetTableInt();
if (!table_int->IsColTimeVariant(col_name)) {
if (!table_int->IsColTimeVariant(col_name) ||table_int->GetTimeSteps() <= 1) {
if (choice_groups->GetSelection() == 1) {
wxMessageBox("Please select a time variable first.");
wxMessageBox("Please select a time variable first, and make sure more than one time steps have been defined.");
choice_groups->SetSelection(0);
return;
}
Expand Down Expand Up @@ -1279,7 +1289,8 @@ void LineChartFrame::RunDIDTest()
logReport = ">>" + now.FormatDate() + " " + now.FormatTime() + "\nREGRESSION (DIFF-IN-DIFF, COMPARE REGIMES) \n----------\n" + logReport;

} else if (compare_time_periods) {
m_Xnames.push_back("TIME");
wxString time_var = "T" + choice_time1->GetString(choice_time1->GetSelection()) + "_" + choice_time2->GetString(choice_time2->GetSelection());
m_Xnames.push_back(time_var);
nX = m_Xnames.size();

int n1 = 0, n2 = 0;
Expand Down Expand Up @@ -1343,7 +1354,8 @@ void LineChartFrame::RunDIDTest()

} else if (compare_r_and_t) {
m_Xnames.push_back("SPACE");
m_Xnames.push_back("TIME");
wxString time_var = "T" + choice_time1->GetString(choice_time1->GetSelection()) + "_" + choice_time2->GetString(choice_time2->GetSelection());
m_Xnames.push_back(time_var);
m_Xnames.push_back("INTERACT");
nX = m_Xnames.size();

Expand Down Expand Up @@ -1823,16 +1835,18 @@ void LineChartFrame::UpdateTitleText()
int time1 = choice_time1->GetSelection();
int time2 = choice_time2->GetSelection();

if (time1 == time2 ) {
if (time1 == time2) {

if (project->GetTableInt()->IsColTimeVariant(col)) {
if (project->GetTableInt()->IsColTimeVariant(col) &&
time1 >= 0) {

frame_title << " - " << choice_group1->GetString(group1) << " vs " << choice_group2->GetString(group2) << " " << choice_time1->GetString(time1);
} else {
frame_title << " - " << choice_group1->GetString(group1) << " vs " << choice_group2->GetString(group2);
}

} else {
if (project->GetTableInt()->IsColTimeVariant(col)) {
if (project->GetTableInt()->IsColTimeVariant(col) && time1 >= 0 && time2 >=0) {
frame_title << " - " << choice_group1->GetString(group1) << " " << choice_time1->GetString(time1) << " vs " << choice_time2->GetString(time2);
} else {
frame_title << " - " << choice_group1->GetString(group1);
Expand Down
4 changes: 2 additions & 2 deletions version.h
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 = 7;
const int version_subbuild = 9;
const int version_year = 2016;
const int version_month = 5;
const int version_day = 24;
const int version_day = 26;
const int version_night = 0;
const int version_type = 1; // 0: alpha, 1: beta, 2: release
}