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

import Language.Drasil hiding (Manual) -- Citation name conflict. FIXME: Move to different namespace
import Drasil.SRSDocument
import qualified Language.Drasil.Sentence.Combinators as S

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

import Data.Drasil.SI_Units (siUnits, fundamentals, derived, degree)
import Data.Drasil.People (spencerSmith)
import Data.Drasil.Concepts.Documentation (doccon, doccon')
import Data.Drasil.Concepts.Math (mathcon)
import Data.Drasil.Concepts.Thermodynamics as CT (heatTrans)  
import qualified Data.Drasil.Concepts.Documentation as Doc (srs)
  
srs :: Document
srs :: Document
srs = SRSDecl
-> (IdeaDict -> IdeaDict -> Sentence)
-> SystemInformation
-> Document
mkDoc SRSDecl
mkSRS forall c d. (NamedIdea c, NamedIdea d) => c -> d -> Sentence
S.forT SystemInformation
si

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

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

si :: SystemInformation
si :: SystemInformation
si = SI {
  _sys :: CI
_sys         = CI
hghc,
  _kind :: CI
_kind        = CI
Doc.srs,
  _authors :: [Person]
_authors     = [Person
spencerSmith],
  _quants :: [QuantityDict]
_quants      = [QuantityDict]
symbols,
  _purpose :: Purpose
_purpose     = [Sentence
purp],
  _background :: Purpose
_background  = [],
  _concepts :: [UnitalChunk]
_concepts    = [] :: [UnitalChunk],
  _instModels :: [InstanceModel]
_instModels  = [], -- FIXME; empty _instModels
  _datadefs :: [DataDefinition]
_datadefs    = [DataDefinition]
dataDefs,
  _configFiles :: [String]
_configFiles = [],
  _inputs :: [QuantityDict]
_inputs      = [QuantityDict]
htInputs,
  _outputs :: [QuantityDict]
_outputs     = [QuantityDict]
htOutputs,
  _defSequence :: [Block SimpleQDef]
_defSequence = [] :: [Block SimpleQDef],
  _constraints :: [ConstrainedChunk]
_constraints = [] :: [ConstrainedChunk],
  _constants :: [ConstQDef]
_constants   = [],
  _sysinfodb :: ChunkDB
_sysinfodb   = ChunkDB
symbMap,
  _usedinfodb :: ChunkDB
_usedinfodb  = ChunkDB
usedDB,
   refdb :: ReferenceDB
refdb       = BibRef -> [ConceptInstance] -> ReferenceDB
rdb [] [] -- FIXME?
}
  
mkSRS :: SRSDecl
mkSRS :: SRSDecl
mkSRS = [DocSection
TableOfContents,
    RefSec -> DocSection
RefSec 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 forall a b. (a -> b) -> a -> b
$ forall c. Idea c => c -> IdeaDict
nw IdeaDict
nuclearPhys, IdeaDict -> Literature
Manual forall a b. (a -> b) -> a -> b
$ forall c. Idea c => c -> IdeaDict
nw IdeaDict
fp]]],
    SSDSec -> DocSection
SSDSec forall a b. (a -> b) -> a -> b
$ [SSDSub] -> SSDSec
SSDProg [
      SolChSpec -> SSDSub
SSDSolChSpec 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
"describes", forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
CT.heatTrans, String -> Sentence
S String
"coefficients related to clad"]

symbMap :: ChunkDB
symbMap :: ChunkDB
symbMap = forall q t c u.
(Quantity q, MayHaveUnit q, Idea t, Concept c, IsUnit u) =>
[q]
-> [t]
-> [c]
-> [u]
-> [DataDefinition]
-> [InstanceModel]
-> [GenDefn]
-> [TheoryModel]
-> [ConceptInstance]
-> [Section]
-> [LabelledContent]
-> [Reference]
-> ChunkDB
cdb [QuantityDict]
symbols (forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [QuantityDict]
symbols forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [IdeaDict]
doccon forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [UnitDefn]
fundamentals forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [UnitDefn]
derived
  forall a. [a] -> [a] -> [a]
++ [forall c. Idea c => c -> IdeaDict
nw IdeaDict
fp, forall c. Idea c => c -> IdeaDict
nw IdeaDict
nuclearPhys, forall c. Idea c => c -> IdeaDict
nw CI
hghc, forall c. Idea c => c -> IdeaDict
nw UnitDefn
degree] forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [CI]
doccon' forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [ConceptChunk]
mathcon)
  ([] :: [ConceptChunk])-- FIXME: Fill in concepts
  [UnitDefn]
siUnits [DataDefinition]
dataDefs [] [] [] [] [] [] []

usedDB :: ChunkDB
usedDB :: ChunkDB
usedDB = forall q t c u.
(Quantity q, MayHaveUnit q, Idea t, Concept c, IsUnit u) =>
[q]
-> [t]
-> [c]
-> [u]
-> [DataDefinition]
-> [InstanceModel]
-> [GenDefn]
-> [TheoryModel]
-> [ConceptInstance]
-> [Section]
-> [LabelledContent]
-> [Reference]
-> ChunkDB
cdb ([] :: [QuantityDict]) (forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [QuantityDict]
symbols)
           ([] :: [ConceptChunk]) ([] :: [UnitDefn])
           [] [] [] [] [] [] [] ([] :: [Reference])