module Drasil.HGHC.Body (srs, si, symbMap, printSetting, fullSI) where

import Drasil.System (mkSystem, SystemKind(Specification))
import Language.Drasil hiding (Manual) -- Citation name conflict. FIXME: Move to different namespace
import Drasil.SRSDocument
import Database.Drasil.ChunkDB (cdb)
import qualified Language.Drasil.Sentence.Combinators as S

import Drasil.HGHC.HeatTransfer (fp, dataDefs, htInputs, htOutputs,
    nuclearPhys, symbols)
import Drasil.HGHC.MetaConcepts (progName)

import Data.Drasil.People (spencerSmith)
import Data.Drasil.Concepts.Thermodynamics as CT (heatTrans)

srs :: Document
srs :: Document
srs = SRSDecl -> (IdeaDict -> IdeaDict -> Sentence) -> System -> Document
mkDoc SRSDecl
mkSRS IdeaDict -> IdeaDict -> Sentence
forall c d. (NamedIdea c, NamedIdea d) => c -> d -> Sentence
S.forT System
si

fullSI :: System
fullSI :: System
fullSI = SRSDecl -> System -> System
fillcdbSRS SRSDecl
mkSRS System
si

printSetting :: PrintingInformation
printSetting :: PrintingInformation
printSetting = System -> Stage -> PrintingConfiguration -> PrintingInformation
piSys System
fullSI Stage
Equational PrintingConfiguration
defaultConfiguration

si :: System
si :: System
si = CI
-> SystemKind
-> People
-> Purpose
-> Purpose
-> Purpose
-> Purpose
-> [DefinedQuantityDict]
-> [TheoryModel]
-> [GenDefn]
-> [DataDefinition]
-> [InstanceModel]
-> [String]
-> [DefinedQuantityDict]
-> [DefinedQuantityDict]
-> [ConstrConcept]
-> [ConstQDef]
-> ChunkDB
-> System
forall a e h i j.
(CommonIdea a, Idea a, Quantity e, Eq e, MayHaveUnit e, Concept e,
 Quantity h, MayHaveUnit h, Concept h, Quantity i, MayHaveUnit i,
 Concept i, HasUID j, Constrained j) =>
a
-> SystemKind
-> People
-> Purpose
-> Purpose
-> Purpose
-> Purpose
-> [e]
-> [TheoryModel]
-> [GenDefn]
-> [DataDefinition]
-> [InstanceModel]
-> [String]
-> [h]
-> [i]
-> [j]
-> [ConstQDef]
-> ChunkDB
-> System
mkSystem
  CI
progName SystemKind
Specification [Person
spencerSmith]
  [Sentence
purp] [] [] []
  [DefinedQuantityDict]
symbols
  [] [] [DataDefinition]
dataDefs [] []
  [DefinedQuantityDict]
htInputs [DefinedQuantityDict]
htOutputs ([] :: [ConstrConcept]) []
  ChunkDB
symbMap


mkSRS :: SRSDecl
mkSRS :: SRSDecl
mkSRS = [DocSection
TableOfContents,
    RefSec -> DocSection
RefSec (RefSec -> DocSection) -> RefSec -> DocSection
forall a b. (a -> b) -> a -> b
$
    Contents -> [RefTab] -> RefSec
RefProg Contents
intro [RefTab
TUnits, [TSIntro] -> RefTab
tsymb [TSIntro
TSPurpose, [Literature] -> TSIntro
SymbConvention [IdeaDict -> Literature
Lit (IdeaDict -> Literature) -> IdeaDict -> Literature
forall a b. (a -> b) -> a -> b
$ IdeaDict -> IdeaDict
forall c. Idea c => c -> IdeaDict
nw IdeaDict
nuclearPhys, IdeaDict -> Literature
Manual (IdeaDict -> Literature) -> IdeaDict -> Literature
forall a b. (a -> b) -> a -> b
$ IdeaDict -> IdeaDict
forall c. Idea c => c -> IdeaDict
nw IdeaDict
fp]]],
    SSDSec -> DocSection
SSDSec (SSDSec -> DocSection) -> SSDSec -> DocSection
forall a b. (a -> b) -> a -> b
$ [SSDSub] -> SSDSec
SSDProg [
      SolChSpec -> SSDSub
SSDSolChSpec (SolChSpec -> SSDSub) -> SolChSpec -> SSDSub
forall a b. (a -> b) -> a -> b
$ [SCSSub] -> SolChSpec
SCSProg [
          Purpose -> Fields -> SCSSub
TMs [] []
        , Purpose -> Fields -> DerivationDisplay -> SCSSub
GDs [] [] DerivationDisplay
HideDerivation
        , Purpose -> Fields -> DerivationDisplay -> SCSSub
DDs [] [Field
Label, Field
Symbol, Field
Units, Field
DefiningEquation,
          Verbosity -> InclUnits -> Field
Description Verbosity
Verbose InclUnits
IncludeUnits] DerivationDisplay
HideDerivation
        , Purpose -> Fields -> DerivationDisplay -> SCSSub
IMs [] [] DerivationDisplay
HideDerivation
      ]]]

purp :: Sentence
purp :: Sentence
purp = Purpose -> Sentence
foldlSent [String -> Sentence
S String
"describe", ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
CT.heatTrans, String -> Sentence
S String
"coefficients related to clad"]

ideaDicts :: [IdeaDict]
ideaDicts :: [IdeaDict]
ideaDicts =
  -- Actual IdeaDicts
  [IdeaDict
fp, IdeaDict
nuclearPhys] [IdeaDict] -> [IdeaDict] -> [IdeaDict]
forall a. [a] -> [a] -> [a]
++
  -- CIs
  [CI -> IdeaDict
forall c. Idea c => c -> IdeaDict
nw CI
progName]

symbMap :: ChunkDB
symbMap :: ChunkDB
symbMap = [DefinedQuantityDict]
-> [IdeaDict]
-> [ConceptChunk]
-> [UnitDefn]
-> [DataDefinition]
-> [InstanceModel]
-> [GenDefn]
-> [TheoryModel]
-> [ConceptInstance]
-> [LabelledContent]
-> [Reference]
-> [Citation]
-> ChunkDB
forall q c u.
(Quantity q, MayHaveUnit q, Concept q, Concept c, IsUnit u) =>
[q]
-> [IdeaDict]
-> [c]
-> [u]
-> [DataDefinition]
-> [InstanceModel]
-> [GenDefn]
-> [TheoryModel]
-> [ConceptInstance]
-> [LabelledContent]
-> [Reference]
-> [Citation]
-> ChunkDB
cdb [DefinedQuantityDict]
symbols [IdeaDict]
ideaDicts ([] :: [ConceptChunk])
  ([] :: [UnitDefn]) [DataDefinition]
dataDefs [] [] [] [] [] [] []