vatis icon indicating copy to clipboard operation
vatis copied to clipboard

[Feature Request] Departure Frequency

Open gurselalp opened this issue 1 year ago • 1 comments

Hello,

I would like to give an idea about Departure Frequency broadcast via ATIS. Just like the Transition Level tab, another tab for Departure frequency would be very useful for us. Listing from bottom to top vATIS might search for callsign and first match can be broadcast on the ATIS automatically. We are currently using airport condition but if vATIS would do it automatically be perfect for us. I am also trying to find a solution to publish ground frequency in the ATIS, so after landing people can automaticly switch to ground.

Here is an example of real D-ATIS for LTFJ.

image

gurselalp avatar Mar 26 '24 11:03 gurselalp

Walkthrough

This pull request updates how ATIS text is processed in two areas. In the builder class, the CreateTextAtis method now conditionally replaces placeholders based on the presence of VoiceReplace and TextReplace values. If TextReplace is empty, it removes corresponding lines via a regex, and a previously executed removal of text parsing characters is now commented out. In the networking class, the OnClientQueryReceived method checks for line breaks in the ATIS text and splits the text accordingly, falling back to a fixed-length segmentation if none are detected.

Changes

File(s) Change Summary
vATIS.Desktop/Atis/...Builder.cs, vATIS.Desktop/Networking/...Connection.cs AtisBuilder.cs: Updated CreateTextAtis to conditionally perform voice/text replacements only when the replacement values are non-empty. Introduced regex-based removal of lines when TextReplace is empty and commented out the removal of text parsing characters.

NetworkConnection.cs: Modified OnClientQueryReceived to detect existing line breaks in ATIS text and split accordingly, otherwise falling back to breaking the text into 64-character segments using regex. Also, the collection is now explicitly declared as a List<string>.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant AtisBuilder
    participant Template
    participant Regex

    Caller->>AtisBuilder: Call CreateTextAtis(template, variable)
    alt Replacement values provided
        AtisBuilder->>Template: Replace placeholders using VoiceReplace/TextReplace
    else TextReplace empty
        AtisBuilder->>Regex: Remove lines containing variable placeholder
        Regex-->>AtisBuilder: Return cleaned template
    end
    Note over AtisBuilder: Removal of text parsing characters is commented out
    AtisBuilder-->>Caller: Return modified template
sequenceDiagram
    participant Client
    participant NetworkConnection
    participant Regex

    Client->>NetworkConnection: Send ATIS query with text
    NetworkConnection->>NetworkConnection: Check for line breaks in text
    alt Line breaks detected
        NetworkConnection->>NetworkConnection: Split text using existing line breaks
    else No line breaks
        NetworkConnection->>Regex: Split text into 64-character segments
        Regex-->>NetworkConnection: Return segmented text
    end
    NetworkConnection-->>Client: Return processed text collection

Possibly related PRs

  • vatis-project/vatis#82: The changes in the main PR focus on conditional checks and regex logic in the CreateTextAtis method of AtisBuilder.cs, while the retrieved PR modifies the construction of weather strings in the same file, indicating a direct relationship in their handling of ATIS text formatting.
  • vatis-project/vatis#100: The changes in the main PR to the CreateTextAtis method in AtisBuilder.cs are related to the modifications in the ReplaceContractionVariable method from the retrieved PR, as both involve handling variable replacements within the same class.
  • vatis-project/vatis#126: The changes in the main PR to the CreateTextAtis method in AtisBuilder.cs are related to the modifications in the RemoveTextParsingCharacters method from the retrieved PR, as both involve text formatting and handling of whitespace in the ATIS output.

Poem

I'm a rabbit, hopping through the code,
Seeing changes in text that lighten the load.
With checks and regex in playful array,
No stray lines shall come our way.
I nibble on bugs and leap with cheer,
For cleaner ATIS code is finally here!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI Review profile: CHILL Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eaf702a6a6b4993d5d92f5cad334508e53f9a667 and 1a4f03bb9fc1afd66c48a5748a233f4cefaf673e.

📒 Files selected for processing (1)
  • vATIS.Desktop/Networking/NetworkConnection.cs (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: build (macos-latest)
  • GitHub Check: Analyze (cpp)
  • GitHub Check: build (windows-latest)
  • GitHub Check: Analyze (csharp)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: Analyze (cpp)
  • GitHub Check: Analyze (csharp)
🔇 Additional comments (2)
vATIS.Desktop/Networking/NetworkConnection.cs (2)

355-355: Improved ATIS text processing approach

The code now calls the new FormatAtisText method instead of directly applying regex splitting. This change aligns with the PR objective to preserve existing line breaks in text ATIS.


496-510: Well-implemented line break preservation logic

This new method intelligently handles ATIS text formatting by checking for existing line breaks first and only falling back to fixed-length segmentation when necessary. The implementation:

  1. First checks if the text contains line breaks (\n or \r)
  2. If it does, splits the text at those breaks, respecting the original formatting
  3. If not, falls back to breaking the text into 64-character lines using regex

The code uses modern C# features like collection expressions and properly handles different line break formats.

✨ Finishing Touches
  • [ ] 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Mar 08 '25 16:03 coderabbitai[bot]