module Drasil.PDController.GenSysDesc where

import Data.Drasil.Concepts.Documentation
       (environment, software, softwareSys, sysCont, system, user)

import Drasil.PDController.Concepts
import Language.Drasil
import Language.Drasil.Chunk.Concept.NamedCombinators

gsdSysContextFig :: LabelledContent
gsdSysContextFig :: LabelledContent
gsdSysContextFig
  = Reference -> RawContent -> LabelledContent
llcc (String -> Reference
makeFigRef String
"systemContextDiag") (RawContent -> LabelledContent) -> RawContent -> LabelledContent
forall a b. (a -> b) -> a -> b
$
      Lbl -> String -> RawContent
fig (IdeaDict -> Lbl
forall n. NamedIdea n => n -> Lbl
titleize IdeaDict
sysCont)
        String
"../../../../datafiles/pdcontroller/Fig_SystemContext.png"

gsdSysContextP1, gsdSysContextP2 :: Contents
gsdSysContextP1 :: Contents
gsdSysContextP1
  = [Lbl] -> Contents
foldlSP
      [LabelledContent -> Lbl
forall r. (HasUID r, HasRefAddress r, HasShortName r) => r -> Lbl
refS LabelledContent
gsdSysContextFig, String -> Lbl
S String
"shows the" Lbl -> Lbl -> Lbl
+:+. IdeaDict -> Lbl
forall n. NamedIdea n => n -> Lbl
phrase IdeaDict
sysCont,
       String -> Lbl
S String
"The circle represents an external entity outside the",
         IdeaDict -> Lbl
forall n. NamedIdea n => n -> Lbl
phrase IdeaDict
software Lbl -> Lbl -> Lbl
`sC` NP -> Lbl
forall n. NounPhrase n => n -> Lbl
phraseNP (IdeaDict -> NP
forall t. NamedIdea t => t -> NP
the IdeaDict
user) Lbl -> Lbl -> Lbl
+:+. String -> Lbl
S String
"in this case",
       String -> Lbl
S String
"The rectangle represents the",
        IdeaDict -> Lbl
forall n. NamedIdea n => n -> Lbl
phrase IdeaDict
softwareSys, String -> Lbl
S String
"itself" Lbl -> Lbl -> Lbl
`sC` ConceptChunk -> Lbl
forall n. NamedIdea n => n -> Lbl
phrase ConceptChunk
pidC Lbl -> Lbl -> Lbl
+:+. String -> Lbl
S String
"in this case",
       String -> Lbl
S String
"Arrows are used to show the data flow between the", 
        NP -> Lbl
forall n. NounPhrase n => n -> Lbl
phraseNP (IdeaDict
system IdeaDict -> IdeaDict -> NP
forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`andIts` IdeaDict
environment)]

gsdSysContextP2 :: Contents
gsdSysContextP2
  = [Lbl] -> Contents
foldlSPCol
      [ConceptChunk -> Lbl
forall n. NamedIdea n => n -> Lbl
phrase ConceptChunk
pidC, String -> Lbl
S String
"is self-contained. The only external interaction is"
         Lbl -> Lbl -> Lbl
+:+. String -> Lbl
S String
"with the user",
       String -> Lbl
S String
"The responsibilities of the", NP -> Lbl
forall n. NounPhrase n => n -> Lbl
phraseNP (IdeaDict
user IdeaDict -> IdeaDict -> NP
forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`andThe` IdeaDict
system),
         String -> Lbl
S String
"are as follows"]

gsdTitle :: [Sentence]
gsdTitle :: [Lbl]
gsdTitle
  = [IdeaDict -> Lbl
forall n. NamedIdea n => n -> Lbl
titleize IdeaDict
user Lbl -> Lbl -> Lbl
+:+ String -> Lbl
S String
"Responsibilities",
     ConceptChunk -> Lbl
forall n. NamedIdea n => n -> Lbl
phrase ConceptChunk
pidC Lbl -> Lbl -> Lbl
+:+ String -> Lbl
S String
"Responsibilities"]

gsdUsrResp :: [Sentence]
gsdUsrResp :: [Lbl]
gsdUsrResp
  = [String -> Lbl
S String
"Feed inputs to the model",
     String -> Lbl
S String
"Review the response of the" Lbl -> Lbl -> Lbl
+:+ ConceptChunk -> Lbl
forall n. NamedIdea n => n -> Lbl
phrase ConceptChunk
powerPlant,
     String -> Lbl
S String
"Tune the controller gains"]

gsdSysResp :: [Sentence]
gsdSysResp :: [Lbl]
gsdSysResp
  = [String -> Lbl
S String
"Check the validity of the inputs",
     String -> Lbl
S String
"Calculate the outputs of the" Lbl -> Lbl -> Lbl
+:+ NP -> Lbl
forall n. NounPhrase n => n -> Lbl
phraseNP (ConceptChunk
pidC ConceptChunk -> ConceptChunk -> NP
forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`and_` ConceptChunk
powerPlant)]

gsdSysContextList :: Contents
gsdSysContextList :: Contents
gsdSysContextList
  = UnlabelledContent -> Contents
UlC (UnlabelledContent -> Contents) -> UnlabelledContent -> Contents
forall a b. (a -> b) -> a -> b
$
      RawContent -> UnlabelledContent
ulcc (RawContent -> UnlabelledContent)
-> RawContent -> UnlabelledContent
forall a b. (a -> b) -> a -> b
$
        ListType -> RawContent
Enumeration (ListType -> RawContent) -> ListType -> RawContent
forall a b. (a -> b) -> a -> b
$
          [Lbl] -> [ListType] -> ListType
bulletNested [Lbl]
gsdTitle ([ListType] -> ListType) -> [ListType] -> ListType
forall a b. (a -> b) -> a -> b
$ ([Lbl] -> ListType) -> [[Lbl]] -> [ListType]
forall a b. (a -> b) -> [a] -> [b]
map [Lbl] -> ListType
bulletFlat [[Lbl]
gsdUsrResp, [Lbl]
gsdSysResp]

gsduserCharacteristics :: Contents
gsduserCharacteristics :: Contents
gsduserCharacteristics
  = [Lbl] -> Contents
foldlSP
      [String -> Lbl
S String
"The end-user of", ConceptChunk -> Lbl
forall n. NamedIdea n => n -> Lbl
phrase ConceptChunk
pidC,
         String -> Lbl
S String
"is expected to have taken a course on Control Systems at an",
         String -> Lbl
S String
"undergraduate level"]