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") forall a b. (a -> b) -> a -> b
$
      Lbl -> String -> RawContent
fig (forall n. NamedIdea n => n -> Lbl
titleize IdeaDict
sysCont)
        String
"../../../../datafiles/pdcontroller/Fig_SystemContext.png"

gsdSysContextP1, gsdSysContextP2 :: Contents
gsdSysContextP1 :: Contents
gsdSysContextP1
  = [Lbl] -> Contents
foldlSP
      [forall r. (HasUID r, HasRefAddress r, HasShortName r) => r -> Lbl
refS LabelledContent
gsdSysContextFig, String -> Lbl
S String
"shows the" Lbl -> Lbl -> Lbl
+:+. forall n. NamedIdea n => n -> Lbl
phrase IdeaDict
sysCont,
       String -> Lbl
S String
"The circle represents an external entity outside the",
         forall n. NamedIdea n => n -> Lbl
phrase IdeaDict
software Lbl -> Lbl -> Lbl
`sC` forall n. NounPhrase n => n -> Lbl
phraseNP (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",
        forall n. NamedIdea n => n -> Lbl
phrase IdeaDict
softwareSys, String -> Lbl
S String
"itself" Lbl -> Lbl -> Lbl
`sC` 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", 
        forall n. NounPhrase n => n -> Lbl
phraseNP (IdeaDict
system forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`andIts` IdeaDict
environment)]

gsdSysContextP2 :: Contents
gsdSysContextP2
  = [Lbl] -> Contents
foldlSPCol
      [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", forall n. NounPhrase n => n -> Lbl
phraseNP (IdeaDict
user 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
  = [forall n. NamedIdea n => n -> Lbl
titleize IdeaDict
user Lbl -> Lbl -> Lbl
+:+ String -> Lbl
S String
"Responsibilities",
     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
+:+ 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
+:+ forall n. NounPhrase n => n -> Lbl
phraseNP (ConceptChunk
pidC forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`and_` ConceptChunk
powerPlant)]

gsdSysContextList :: Contents
gsdSysContextList :: Contents
gsdSysContextList
  = UnlabelledContent -> Contents
UlC forall a b. (a -> b) -> a -> b
$
      RawContent -> UnlabelledContent
ulcc forall a b. (a -> b) -> a -> b
$
        ListType -> RawContent
Enumeration forall a b. (a -> b) -> a -> b
$
          [Lbl] -> [ListType] -> ListType
bulletNested [Lbl]
gsdTitle forall a b. (a -> b) -> a -> b
$ 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", 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"]