module Drasil.PDController.SpSysDesc where

import Data.Drasil.Concepts.Documentation (goalStmtDom, physicalSystem)

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

-- Introduction of the Problem Description section derives from purpose in
-- SystemInformation (purp in Body.hs)

sysParts :: [Sentence]
sysParts :: [Sentence]
sysParts
  = forall a b. (a -> b) -> [a] -> [b]
map (Sentence -> Sentence
(!.) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n. NounPhrase n => n -> Sentence
atStartNP forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t. NamedIdea t => t -> NP
the)
      [ConceptChunk
summingPt, ConceptChunk
pidC, ConceptChunk
powerPlant]

sysFigure :: LabelledContent
sysFigure :: LabelledContent
sysFigure
  = Reference -> RawContent -> LabelledContent
llcc (String -> Reference
makeFigRef String
"pidSysDiagram") forall a b. (a -> b) -> a -> b
$
      Sentence -> String -> MaxWidthPercent -> RawContent
figWithWidth (forall n. NounPhrase n => n -> Sentence
atStartNP forall a b. (a -> b) -> a -> b
$ forall t. NamedIdea t => t -> NP
the IdeaDict
physicalSystem)
        String
"../../../../datafiles/pdcontroller/Fig_PDController.png"
        MaxWidthPercent
70

sysGoalInput :: [Sentence]
sysGoalInput :: [Sentence]
sysGoalInput
  = [forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
setPoint, forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
simulationTime, forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
propGain, forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
derGain,
     forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
stepTime]

goals :: [ConceptInstance]
goals :: [ConceptInstance]
goals = [ConceptInstance
sysProcessVariable]

sysProcessVariable :: ConceptInstance
sysProcessVariable :: ConceptInstance
sysProcessVariable
  = forall c.
Concept c =>
String -> Sentence -> String -> c -> ConceptInstance
cic String
"processVariable"
      ([Sentence] -> Sentence
foldlSent
         [String -> Sentence
S String
"Calculate the output of the", forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
powerPlant,
            Sentence -> Sentence
sParen (forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
processVariable),
            String -> Sentence
S String
"over time"])
      String
"Process-Variable"
      ConceptChunk
goalStmtDom