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

Generate Excel for flying time #40

Open
huguesf opened this issue Sep 12, 2019 · 6 comments
Open

Generate Excel for flying time #40

huguesf opened this issue Sep 12, 2019 · 6 comments
Labels
enhancement New feature or request

Comments

@huguesf
Copy link
Collaborator

huguesf commented Sep 12, 2019

Under #28

Glider and Tow
As maintenance
I want a csv file
... so that they can use the numbers in other systems (AMS) or manual reports.
... use in Excel.

@huguesf huguesf added this to the Provide reports milestone Sep 12, 2019
@Davisonp
Copy link

This report is required in both PDF and CSV (excel) formats. PDFs are stored for reference, CSVs are used for data manipulation and stats

@huguesf huguesf changed the title Generate CSV for flying time Generate Excel for flying time Nov 23, 2019
@huguesf huguesf added the enhancement New feature or request label Nov 27, 2019
huguesf added a commit that referenced this issue Nov 30, 2019
…tart exploratory testing of FlyingTime report.

The refactoring goal was to isolate the report code from the production and distribution.
huguesf added a commit that referenced this issue Dec 7, 2019
…ination and validation when more than one winch or more than one auto. More testing necessary.
huguesf added a commit that referenced this issue Dec 9, 2019
…ce the previous version of the timesheets report by the new one the produce HTML, PDF and Excel. Added section pagination mechanism to the HTML report formatter. Added the capability to set a title for the report (mainly for the HTML to be able to produce an appropriate title element).

For the Excel reports,
1) when adding the section title to the worksheet, it span across 10 cells
2) table heading, table row and table total all support colSpan and rowSpan.
3) it now automatically produce unique worksheet name (Excel tabs) to prevent error when opening in Excel.
4) fix a bug with <br> translation into new line (now caseInsensitive)
huguesf added a commit that referenced this issue Dec 9, 2019
huguesf added a commit that referenced this issue Dec 10, 2019
…s with table after a first repeating section was configured; no reset when paginated section completed.
huguesf added a commit that referenced this issue Dec 14, 2019
…more), and corresponding clean-up. Simplified the variable replacement code. Added more rows to the timesheets test to see behavior on 3 pages of one aircraft table. Added a utility function to count the number of occurence of a specific pattern.
huguesf added a commit that referenced this issue Dec 14, 2019
#40; fix page break and replaced with CSS only (no code condition any…
@huguesf
Copy link
Collaborator Author

huguesf commented Dec 16, 2019

Q. What is a connectedAircraftRecord (FlightRecord property of type FlightRecord)? Is it two plane (towplane and glider) "connected" together? Or Twice the same plane doing a connection (transit) between to legs of the flight?

@huguesf
Copy link
Collaborator Author

huguesf commented Dec 16, 2019

Q. In provided Excel example, numbers are treated as String. This result in "warning" in Excel, plus they are left aligned. Do we want them right aligned and treated as Number by Excel? If yes how important is this? Can we wait till later release?

@kirvanp
Copy link
Collaborator

kirvanp commented Dec 16, 2019

That relationship links a glider flight to the corresponding flight for the launch vehicle. That's important so that, for example, if you change the takeoff time of a glider it makes sure the towplane takeoff time is also changed to be the same. The relationship is not always used, for example if a towplane flies by itself.

@huguesf
Copy link
Collaborator Author

huguesf commented Dec 16, 2019

In the timesheets report for the sequence column, there is this code:

                var text = recordBeingExamined.flightSequence
                
                if recordBeingExamined.flightSequence == "Transit"
                {
                    text += " \(recordBeingExamined.transitRoute)"
                }
                
                if let connectedRoute = recordBeingExamined.connectedAircraftRecord?.transitRoute,
                    recordBeingExamined.connectedAircraftRecord?.flightSequence == "Transit"
                {
                    text += " \(connectedRoute)"
                }

Which seem to allow two differents transitRoute for the glider and the towplane. How is this possible? Or am I mistaken?

@kirvanp
Copy link
Collaborator

kirvanp commented Dec 16, 2019

Negative. The issue here is that the sequence for a towplane that is towing is always "towing". This is a throwback to paper timesheets where there was only one "sequence" column and hence only one sequence for each flight. I suppose in a digital world we could design something where flights could have multiple sequence tags, but when I started this project I had to stay pretty close to what works on paper. So recording all tows as "towing", whether they are x-country or not, seemed like the best idea since that means that there will be the same number of tows as glider flights. Always. Now unfortunately that leaves the problem of how to figure out if the "towing" flight was also a x-country, which brings us to your code snippet.

So what the code snipped actually does is that if its outputting a glider transit flight or a towplane transit flight without a glider, the first IF statement is triggered. If its outputting a record for a towplane that was doing a transit flight with a glider, the second IF statement is triggered because it checks and sees that there is a connected glider record, that that record is for a x-country, and it then uses the route from the glider record. Therefore, for a joint glider/towplane x-country, only the glider routing is used, for both planes, so the situation where transitRoute is different would not arise.

huguesf added a commit that referenced this issue Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants