module Drasil.PDController.SpSysDesc where

import Language.Drasil
import Language.Drasil.Chunk.Concept.NamedCombinators
import qualified Language.Drasil.Development as D

import Data.Drasil.Concepts.Documentation (goalStmtDom)

import Drasil.PDController.Concepts

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

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
. NPStruct -> Sentence
D.toSent (NPStruct -> Sentence)
-> (ConceptChunk -> NPStruct) -> ConceptChunk -> Sentence
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
atStartNP (NP -> NPStruct)
-> (ConceptChunk -> NP) -> ConceptChunk -> NPStruct
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]

sysGoalInput :: [Sentence]
sysGoalInput :: [Sentence]
sysGoalInput
  = [ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
setPoint, ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
simulationTime, ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
propGain, ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
derGain,
     ConceptChunk -> Sentence
forall 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 String
"calculateProcessVariable"
      ([Sentence] -> Sentence
foldlSent
         [String -> Sentence
S String
"Calculate the output of the", ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
powerPlant,
            Sentence -> Sentence
sParen (ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
processVariable),
            String -> Sentence
S String
"over time"])
      String
"Process-Variable"
      ConceptChunk
goalStmtDom