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

fixes for Mainframe.cpp, CalibrationPressureAdvDialog.cpp, some other corrections, additions #4364

Open
wants to merge 2 commits into
base: nightly_dev
Choose a base branch
from

Conversation

wschadow
Copy link

@wschadow wschadow commented Jul 9, 2024

Some fixes:

CalibrationPressureAdvDialog.cpp: The conversions from string to double depend on locale / language ( , vs. . as delimiter) . Switching to German will cause a crash. This is fixed here.

Mainframe.cpp: fixes setting of braces and #endif

.gitignore: adds cmake/CPackConfig.cmake

filament_pressure.html: some typos corrected

BuildLinux.sh: remove --all from export NCORES=nproc --all. When --all is activated too many processes are generated on a virtual machine

@legend069
Copy link

can you please create this PR for my repo/branch?

thanks.

@wschadow
Copy link
Author

wschadow commented Jul 11, 2024

can you please create this PR for my repo/branch?

thanks.

I would have to clone your repo first or need write access to your repo. You can merge the code much easier this way:

git remote add caribou3d [email protected]:Caribou3d/SuperSlicer.git
git fetch caribou3d
git merge caribou3d/nightly_dev-orig

and finally remove remote

git remote remove caribou3d

std::string nozzle_diameter_str = std::to_string(nozzle_diameter);
std::replace(nozzle_diameter_str.begin(), nozzle_diameter_str.end(), ',', '.');
nozzle_diameter_str.erase(nozzle_diameter_str.find_last_not_of('0') + 2, std::string::npos);
std::cout << "Nozzle: " << nozzle_diameter_str << std::endl;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you forget to remove the console debugging ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep :)

@legend069
Copy link

figured it would be easier on others to keep changes in my repo as merils repo can be outofdate with changes i make.

the localization bug originates with wxString choices_start_PA[] = { "0.0", "0.010", "0.020", "0.030", "0.040", "0.050" };
it would be better to make the changes there yes?

@wschadow
Copy link
Author

figured it would be easier on others to keep changes in my repo as merils repo can be outofdate with changes i make.

the localization bug originates with wxString choices_start_PA[] = { "0.0", "0.010", "0.020", "0.030", "0.040", "0.050" }; it would be better to make the changes there yes?

`
std::vector < std::vector<ModelObject*>> pressure_tower;
bool smooth_time = false;

std::string nozzle_diameter_str = std::to_string(nozzle_diameter);
nozzle_diameter_str.erase(nozzle_diameter_str.find_last_not_of('0') + 2, std::string::npos);

 if (nozzle_diameter_str.back() == '.') {//if nozzle_diameter_str broke fix it by adding '0' to end, prob not needed?
    nozzle_diameter_str += '0';
}
std::string bend_90_nozzle_size_3mf = "90_bend_" + nozzle_diameter_str + ".3mf";
std::string extrusion_role = dynamicExtrusionRole[0]->GetValue().ToStdString();

`

I'm not sure why this happens here. I noticesd that the conversion of the nozzle diameter causes a problem when loading the files
.

@legend069
Copy link

I'm not sure why this happens here. I noticesd that the conversion of the nozzle diameter causes a problem when loading the files .

bend_90_nozzle_size_3mf is the variable that gets changed based on nozzle sizes to load the correct model.
it was easier to have a model for each common nozzle size rather than make the 90_bend models larger.

if it only crashes/breaks because not being able to load the model it'll be better to just adjust it like

std::string nozzle_diameter_str = std::to_string(nozzle_diameter);
std::replace(nozzle_diameter_str.begin(), nozzle_diameter_str.end(), ',', '.');
nozzle_diameter_str.erase(nozzle_diameter_str.find_last_not_of('0') + 2, std::string::npos);

is it only crashing on loading a model or elsewhere?

@wschadow
Copy link
Author

I'm not sure why this happens here. I noticesd that the conversion of the nozzle diameter causes a problem when loading the files .

bend_90_nozzle_size_3mf is the variable that gets changed based on nozzle sizes to load the correct model. it was easier to have a model for each common nozzle size rather than make the 90_bend models larger.

if it only crashes/breaks because not being able to load the model it'll be better to just adjust it like

std::string nozzle_diameter_str = std::to_string(nozzle_diameter);
std::replace(nozzle_diameter_str.begin(), nozzle_diameter_str.end(), ',', '.');
nozzle_diameter_str.erase(nozzle_diameter_str.find_last_not_of('0') + 2, std::string::npos);

is it only crashing on loading a model or elsewhere?

The conversion of other vakues fails as well

` double first_pa = wxAtof(firstPaValue);
double start_pa = wxAtof(startPaValue);
double end_pa = wxAtof(endPaValue);
double pa_increment = wxAtof(paIncrementValue);
extrusion_role = dynamicExtrusionRole[id_item]->GetValue().ToStdString();

    int countincrements = 0;
    int sizeofarray = static_cast<int>((end_pa - start_pa) / pa_increment) + 2;//'+2' needed for odd/even numbers 
    std::vector<double> pa_values(sizeofarray);
    std::vector<std::string> c_pa_values_c(sizeofarray);

`

pa_increment is zero and the dimension of the array is infinity. There is another section of the code with that error.

@legend069
Copy link

The conversion of other vakues fails as well

it'll be failing there because the comobox box contains a string of numbers and the OS/something else see's it as a string of text and changes it.

pa_increment is zero and the dimension of the array is infinity. There is another section of the code with that error.

this would be failing because of above main issue. but i guess i could add a safe guard check before it starts the while loop to confirm if the variables have , where it shouldn't

i'll need to look more into wxwidgets to see how to create a combobox for double/floats instead of strings.

@wschadow
Copy link
Author

some modification to enable translation of the lables, initial German trnaslation of the html page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants