bool VelParaSetupHandler::SetAreaParaSetupUiData(AreaPara ¶) { ConfigManager* conf = ConfigManager::GetInstance(); if (!conf->UpdateMineZoon(para.mine_area)) { return false; } if (!conf->UpdateSearchZoon(para.search_area)) { return false; } if (!conf->UpdateAppSettingFile("cellDelta", QString().sprintf("%0.1f", para.grid_step))) { return false; } if (!conf->Save()) { return false; } AppSettings &setting = conf->AppSetting(); setting.set_mine_area(para.mine_area); setting.set_search_area(para.search_area); setting.set_cell_delta(para.grid_step); return true; }
bool VelParaSetupHandler::SetModeSetupUiData(ModeSetupPara &info) { ConfigManager *conf = ConfigManager::GetInstance(); if (!conf->UpdateAppSettingFile("calculation_method", QString().sprintf("%d", info.calculate_method))) { return false; } if (!conf->UpdateAppSettingFile("mode", QString().sprintf("%d", info.mode))) { return false; } if (!conf->UpdateAppSettingFile("channel_filter", QString().sprintf("%d", info.channel_filter))) { return false; } if (!conf->UpdateAppSettingFile("accuracy", QString().sprintf("%0.1f", info.accuracy))) { return false; } if (!conf->UpdateAppSettingFile("z_join_calculate", QString().sprintf("%d", info.z_join_calculate? 1:0))) { return false; } if (!conf->Save()) { return false; } AppSettings &setting = conf->AppSetting(); setting.set_calculation_method(info.calculate_method); setting.set_mode(info.mode); setting.set_channel_filter(info.channel_filter); setting.set_accuracy(info.accuracy); setting.set_z_join_calculate(info.z_join_calculate); return true; }
bool VelParaSetupHandler::SetPSVelSetupUiData(PSVelSetupPara ¶) { ConfigManager *conf = ConfigManager::GetInstance(); if (!conf->UpdateAppSettingFile("p_start", QString().sprintf("%0.1f", para.p_start))) { return false; } if (!conf->UpdateAppSettingFile("p_end", QString().sprintf("%0.1f", para.p_end))) { return false; } if (!conf->UpdateAppSettingFile("s_start", QString().sprintf("%0.1f", para.s_start))) { return false; } if (!conf->UpdateAppSettingFile("s_end", QString().sprintf("%0.1f", para.s_end))) { return false; } if (!conf->UpdateAppSettingFile("p_step", QString().sprintf("%0.1f", para.p_step))) { return false; } if (!conf->UpdateAppSettingFile("s_step", QString().sprintf("%0.1f", para.s_step))) { return false; } if (!conf->UpdateAppSettingFile("p_divide_by_s", QString().sprintf("%0.2f", para.p_divide_by_s))) { return false; } if (!conf->UpdateAppSettingFile("plus_per", QString().sprintf("%0.1f", para.plus_per))) { return false; } if (!conf->UpdateAppSettingFile("minus_per", QString().sprintf("%0.1f", para.minus_per))) { return false; } if (!conf->UpdateLayerModelInfo(para.layer_info)) { return false; } if (!conf->Save()) { return false; } AppSettings &setting = conf->AppSetting(); setting.set_p_start(para.p_start); setting.set_p_end(para.p_end); setting.set_s_start(para.s_start); setting.set_s_end(para.s_end); setting.set_p_setp(para.p_step); setting.set_s_step(para.s_step); setting.set_p_divide_by_s(para.p_divide_by_s); setting.set_plus_per(para.plus_per); setting.set_minus_per(para.minus_per); setting.set_layer_info(para.layer_info); return true; }