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

continueLength is not used in the XSLT and could be removed #106

Closed
bartneck opened this issue May 9, 2024 · 10 comments
Closed

continueLength is not used in the XSLT and could be removed #106

bartneck opened this issue May 9, 2024 · 10 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@bartneck
Copy link
Owner

bartneck commented May 9, 2024

The <continueLength> element is used in the xsd schema and in some assertions. But it is not used in the xsl file. If it is no longer used then it should be removed.

@bartneck bartneck added the bug Something isn't working label May 9, 2024
@bartneck bartneck added this to the Version 2 milestone May 9, 2024
@calloc262
Copy link
Collaborator

I had been using this tag so that you can write a 200 as 50fr 50bk but set continueLength to 200
rather than writing 50fr 50bk 50fr 50bk, however, this hasn't been translated over to the xslt, and isn't used in the length calculating function.
I could either add this so that the length will be calculated correctly, or remove the continueLength which would mean the 200 is represented as 2x(50fr 50bk) which still makes sense.

@bartneck
Copy link
Owner Author

I am happy to keep it in, but I suspect that it then needs to be used in the XSLT. I would need a detailed explanation of how exactly this works. I am busy writing the documentation, so all these questions come up.

@bartneck
Copy link
Owner Author

Could you please keep it and explain how exactly it works?

@calloc262
Copy link
Collaborator

By setting the continueLength of a continue to something larger than what its contents actually are you are expecting the contents of the continue to repeat.
Instead of writing a continue as 50fr 50bk 50fr 50bk which would be swum as a 200,
you set continueLength to 200 then the contents of the continue will just be 50fr 50bk, which the swimmers would then repeat to get to the total length of 200.

@bartneck
Copy link
Owner Author

Thanks for the documentation. I created an example to test the <continueLength> element. It is available here:

/bookExamples/swiML-documentation/continueLength.xml

When giving this instruction:

    <instruction>
        <continue>
            <continueLength>200</continueLength>
            <instruction>
                <length>
                    <lengthAsDistance>50</lengthAsDistance>
                </length>
                <stroke>
                    <standardStroke>freestyle</standardStroke>
                </stroke>
            </instruction>
            <instruction>
                <length>
                    <lengthAsDistance>50</lengthAsDistance>
                </length>
                <stroke>
                    <standardStroke>backstroke</standardStroke>
                </stroke>
            </instruction>
        </continue>
    </instruction>

I get this unexpected result:
SCR-20240520-jzcg

Could you please enable the <continueLength> element?

@calloc262
Copy link
Collaborator

Should be working now

@bartneck
Copy link
Owner Author

Yes, this error is now gone, but the calculation of the total length is still wrong. In the example file, the total should be 300, not 200.

Screenshot 2024-05-24 at 9 40 42 AM

@bartneck
Copy link
Owner Author

For consistency reasons and to be able to express different types of length, the <continueLength> element should be treated the same way as the <length> element. It should include <lengthAsDistance>, <lengthAsLaps> and <lengthAsTime>. It should also be assured that the unit used is compatible with the instructions included. The easiest would be to ensure that they all use the same unit.

@bartneck
Copy link
Owner Author

This error occurs again not in the program length, but in the calculation of the simplified repetition. Have a look at the file jasiMasters/JasiMasters2024041401.xml

SCR-20240528-kbqs

The two enclosed continue elements are summed up to only 50 meters although the continueLength is set to 100.

calloc262 added a commit that referenced this issue May 28, 2024
Completely remade length functions
Fixes:
#99 continues now calculate correctly and missing lengths should be present
#106 fixed length calculations and changed continue length to lengthType
#108 fixed program length calculation
#111 fixed specific bug in alignment
#113 fixed bug where counter was not bolded
@bartneck
Copy link
Owner Author

tested and okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants