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

ogma-core: Replace queueSize with QUEUE_SIZE in FPP file. Refs #186. #187

Merged

Conversation

ivanperez-keera
Copy link
Member

Replace variable with new correct name in F' template, as prescribed in the solution proposed for #186.

The variable queueSize is no longer defined by default in the component
generated by fprime. This makes components generated by Ogma not compile
with the latest version of fprime.

This commit replaces the variable Default.queueSize with
Default.QUEUE_SIZE, which is defined and meant as its replacement.
@ivanperez-keera
Copy link
Member Author

Change Manager: The changelog uses the wrong format to reference the issue (Refs #186 vs (#186)).

@ivanperez-keera ivanperez-keera force-pushed the develop-fprime-queueSize branch from 15fb90a to 88441c0 Compare December 5, 2024 21:26
@ivanperez-keera
Copy link
Member Author

Impementor: Fix implemented, review requested.

@ivanperez-keera
Copy link
Member Author

ivanperez-keera commented Dec 5, 2024

Change Manager: Verified that:

  • Solution is implemented:
    • The code proposed compiles and passes all tests. Details:
    • The solution proposed produces the expected result. Details:
      Compiling a specification produces an fprime component and dockerfile that can be further compiled successfully:
      --- fprime-handlers
      handlerMyProperty
      
      --- fprime-variable-dbs
      ("pullup", "bool")
      ("input", "float")
      
      --- fprime-variables
      variables
      
      --- Monitor.hs
      import           Copilot.Compile.C99
      import           Copilot.Language      hiding (prop)
      import qualified Copilot.Library.PTLTL as PTLTL
      import           Language.Copilot      (reify)
      import           Prelude               hiding (not, (/=))
      
      input :: Stream Float
      input = extern "input" Nothing
      
      myProperty :: Stream Bool
      myProperty = PTLTL.alwaysBeen (input /= 30.0)
      
      spec :: Spec
      spec = do
        trigger "handlerMyProperty" (not myProperty) []
      
      main :: IO ()
      main = reify spec >>= compile "copilot"
      
      --- Dockerfile
      FROM ubuntu:trusty
      
      ENV DEBIAN_FRONTEND=noninteractive
      
      RUN apt-get update
      
      RUN apt-get install --yes software-properties-common
      RUN add-apt-repository ppa:hvr/ghc
      RUN apt-get update
      
      RUN apt-get install --yes ghc-8.6.5 cabal-install-2.4
      RUN apt-get install --yes libz-dev
      
      ENV PATH=/opt/ghc/8.6.5/bin:/opt/cabal/2.4/bin:$PWD/.cabal-sandbox/bin:$PATH
      
      RUN cabal update
      RUN cabal v1-sandbox init
      RUN cabal v1-install alex happy
      RUN apt-get install --yes git
      
      ADD fprime-variables    /tmp/fprime-variables
      ADD fprime-handlers     /tmp/fprime-handlers
      ADD fprime-variable-dbs /tmp/fprime-variable-dbs
      ADD Monitor.hs          /tmp/Monitor.hs
      
      CMD git clone $REPO && \
          cd $NAME && \
          git checkout $COMMIT && \
          cd .. && \
          cabal v1-sandbox init && \
          cabal v1-install copilot $NAME/$PAT**/ \
            --constraint="aeson>=2.0.3.0" \
            --constraint="copilot>=4.1" \
            --constraint="copilot-core>=4.1" \
            --constraint="copilot-language>=4.1" \
            --constraint="copilot-theorem>=4.1" \
            --constraint="copilot-c99>=4.1" \
            --constraint="copilot-interpreter>=4.1" \
            --constraint="copilot-prettyprinter>=4.1" \
            && \
          ./.cabal-sandbox/bin/ogma fprime --app-target-dir fprime_demo --variable-file /tmp/fprime-variables --handlers-file /tmp/fprime-handlers --variable-db /tmp/fprime-variable-dbs && \
          cabal v1-exec -- runhaskell /tmp/Monitor.hs && \
          mv copilot* fprime_demo/
      
      Command (substitute variables based on new path after merge):
      $ docker run -v $PWD/fprime_demo/:/fprime_demo -e "REPO=https://github.com/ivanperez-keera/ogma" -e "NAME=ogma" -e "PAT=ogma"  -e "COMMIT=88441c03167696ac0f078b3bcaf995459a76cd67" -it ogma-verify-186
      $ cd fprime_demo
      $ docker build -t ogma-verify-186-fprime -f Dockerfile .
      
  • Implementation is documented. Details:
    No updates needed.
  • Change history is clear.
  • Commit messages are clear.
  • Changelogs are updated.
  • Examples are updated. Details:
    No updates needed.
  • Required version bumps are evaluated. Details:
    Bump needed; change requires newer version of fprime.

@ivanperez-keera ivanperez-keera merged commit 786cc80 into nasa:develop Dec 5, 2024
2 checks passed
@ivanperez-keera ivanperez-keera deleted the develop-fprime-queueSize branch December 5, 2024 21:50
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.

1 participant