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

sysProblemDesc :: Sentence
sysProblemDesc :: Sentence
sysProblemDesc
  = [Sentence] -> Sentence
foldlSent_
      [String -> Sentence
S "provide a model of a", ConceptChunk -> Sentence
forall n. (HasUID n, NamedIdea n) => n -> Sentence
phrase ConceptChunk
pidC,
         String -> Sentence
S "that can be used for the tuning of the gain constants before",
         String -> Sentence
S "the deployment of the controller"]

sysParts :: [Sentence]
sysParts :: [Sentence]
sysParts
  = (ConceptChunk -> Sentence) -> [ConceptChunk] -> [Sentence]
forall a b. (a -> b) -> [a] -> [b]
map (Sentence -> Sentence
(!.) (Sentence -> Sentence)
-> (ConceptChunk -> Sentence) -> ConceptChunk -> Sentence
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NP -> Sentence
forall n. NounPhrase n => n -> Sentence
atStartNP (NP -> Sentence)
-> (ConceptChunk -> NP) -> ConceptChunk -> Sentence
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ConceptChunk -> NP
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 "pidSysDiagram") (RawContent -> LabelledContent) -> RawContent -> LabelledContent
forall a b. (a -> b) -> a -> b
$
      Sentence -> String -> MaxWidthPercent -> RawContent
figWithWidth (NP -> Sentence
forall n. NounPhrase n => n -> Sentence
atStartNP (NP -> Sentence) -> NP -> Sentence
forall a b. (a -> b) -> a -> b
$ NamedChunk -> NP
forall t. NamedIdea t => t -> NP
the NamedChunk
physicalSystem)
        "../../../../datafiles/pdcontroller/Fig_PDController.png"
        70

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

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

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