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

Fix registration marks support #12

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open

Conversation

FCare
Copy link

@FCare FCare commented Jul 10, 2024

This MR is mainly extracting regmarks information from the SVG, based on layer name.
It also allows to open a SVG file with regmarks, printing layer and cutting layer. In that case, only cutting layer is sent to the plotter. It avoids generating multiple files.
I also fixed so display issues regarding dpi and I modified the grid on main display.
Finally, I fixed some error on USB protocol (flushing buffer before reading data mainly) and inverting some operations so that unknon commands are not failing the CC200 protocol. I used wireshark on windows to realign the init sequence.

I tested on my CC200 and it works perfectly.

Do not hesitate to contact me if you need video or infos.

@Timmmm
Copy link
Owner

Timmmm commented Jul 10, 2024

This is amazing, thank you! I am going to test it and if it works for me I'll make a new release with this change. (May take me a little while though; I don't have too much free time - feel free to poke me if I haven't got around to it in a few weeks.)

@@ -8,9 +8,13 @@
#include <iomanip>
#include <iostream>

#include<unistd.h>
Copy link
Owner

Choose a reason for hiding this comment

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

Do you remember why you needed to add this? It isn't available on Windows and also isn't required but I'm guessing some function needs it on Linux?

Copy link
Author

Choose a reason for hiding this comment

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

It is not needed, you can remove. I may have added that while debugging

@@ -362,7 +374,7 @@ SResult<> Cut(CutParams p)
return Err(std::string("Moving, please try again."));
if (resp == "2\x03")
return Err(std::string("Empty tray, please load media.")); // Silhouette Cameo
return Err("Unexpected response from plotter: '" + resp + "' (" + string_to_hex(resp) + ")");
return Err("1 Unexpected response from plotter: '" + resp + "' (" + string_to_hex(resp) + ") instead "+ string_to_hex("1\x03"));
Copy link
Owner

Choose a reason for hiding this comment

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

Ok this is weird, since I don't think you really changed anything before this, but on my CC200-20 on your branch I hit this error with

Error: 1 Unexpected response from plotter: '    0,    0\x03' (20202020302c202020203003) instead 3103

But on develop I don't. Weird right? I'll try to bisect it.

I think I'll also cherry-pick some of your individual commits straight to develop. Thanks again for the code!

Copy link
Owner

Choose a reason for hiding this comment

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

Ah wait, it's nothing to do with your changes actually. It does it on the second cut. Now that I think about it the cutter sounds different after you've cut so there must be some part of the end of cut sequence we're missing or something.

Maybe need to break out wireshark again...

Copy link
Author

Choose a reason for hiding this comment

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

In fact, I found that this step depends what is the last usb request before this one. If there was a request and you did not fully read the usb buffer, then it is not flushed and you have to read more than expected.

I added prior to this call a while loop to read and flush the usb buffer content. Once you do that, the regmarks only send two response. The first one is always 0, the second one is 1 when it succeed.

I also noticed that the regmarks findiong is using the speed setting of the selected material. The fisrst one in the list (the default one) is really slow.

This is a non sense, registration marks should be done at the highest possible speed. That 's why I also moved the default material to the fifth one, so that it is always fast. This should improve (like using Setting 5, then, once regmarks are found, move back to the user setting) but it can explain why you have different sound, you may have choose a different material there.

@FCare
Copy link
Author

FCare commented Jul 14, 2024

For info, I found that when using a Svg without the cut layer, the playback of the cutting animation are misaligned. I need to find some time to fix this.

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