casr-logbook 0.6.9 → 0.6.10
raw patch · 5 files changed
+27/−26 lines, 5 files
Files
- casr-logbook.cabal +1/−1
- src/Data/Aviation/Casr/Logbook/Html/Html.hs +4/−2
- src/Data/Aviation/Casr/Logbook/Reports/FlightTimeReport.hs +15/−3
- src/Data/Aviation/Casr/Logbook/Types/AircraftFlight.hs +3/−8
- src/Data/Aviation/Casr/Logbook/Types/Command.hs +4/−12
casr-logbook.cabal view
@@ -1,5 +1,5 @@ name: casr-logbook-version: 0.6.9+version: 0.6.10 license: OtherLicense license-file: LICENSE author: Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ>
src/Data/Aviation/Casr/Logbook/Html/Html.hs view
@@ -315,8 +315,10 @@ do span_ [class_ "command dualunderinstruction"] "Dual Under-Instruction" span_ [class_ "commandphrase"] " by " span_ [class_ "commandaviator"] $ htmlAviatorShort a-htmlCommand _ (ApprovedSolo a) =- do span_ [class_ "command approvedsolo"] "Approved Solo"+htmlCommand _ (ApprovedSolo a r) =+ do span_ [class_ "instructionrating"] (toHtmlRaw (shortStringRating r))+ span_ [class_ "commandphrase"] " for "+ span_ [class_ "command approvedsolo"] "Approved Solo" span_ [class_ "commandphrase"] " by " span_ [class_ "commandaviator"] $ htmlAviatorShort a
src/Data/Aviation/Casr/Logbook/Reports/FlightTimeReport.hs view
@@ -228,19 +228,31 @@ Just a -> if isn't _GA1InstructionRating (view instructionRating a) then mempty else x Nothing ->- mempty+ case preview (command . _ApprovedSolo) fl of+ Just (_, r) ->+ if isn't _GA1InstructionRating r then mempty else x+ Nothing ->+ mempty instrGA2 x = case preview (command . _InCommandInstructing) fl of Just a -> if isn't _GA2InstructionRating (view instructionRating a) then mempty else x Nothing ->- mempty+ case preview (command . _ApprovedSolo) fl of+ Just (_, r) ->+ if isn't _GA2InstructionRating r then mempty else x+ Nothing ->+ mempty instrGA3 x = case preview (command . _InCommandInstructing) fl of Just a -> if isn't _GA3InstructionRating (view instructionRating a) then mempty else x Nothing ->- mempty+ case preview (command . _ApprovedSolo) fl of+ Just (_, r) ->+ if isn't _GA3InstructionRating r then mempty else x+ Nothing ->+ mempty hoursmap k = Map.singleton k (hoursdaynight, icus hoursdaynight, dual hoursdaynight, comd hoursdaynight) singleengine x =
src/Data/Aviation/Casr/Logbook/Types/AircraftFlight.hs view
@@ -19,10 +19,9 @@ import Control.Lens ( view, makeClassy ) import Data.Aviation.Casr.Logbook.Types.Aircraft(Aircraft, HasAircraft(aircraft)) import Data.Aviation.Casr.Logbook.Types.Command- ( Command(InCommandInstructing, InCommand, Dual, ICUS),- isAeronauticalHours )+ ( Command(InCommandInstructing, InCommand, Dual, ICUS) ) import Data.Aviation.Casr.Logbook.Types.DayNight- ( DayNight(DayNight), HasDayNight(dayNight) )+ ( DayNight, HasDayNight(dayNight) ) import Data.Aviation.Casr.Logbook.Types.FlightPath(FlightPath, HasFlightPath(flightPath)) import Data.Aviation.Casr.Logbook.Types.Instruction ( Instruction ) import Data.Aviation.Casr.Logbook.Types.Aviator(Aviator)@@ -196,8 +195,4 @@ AircraftFlight -> DayNight aeronauticalHours fl =- if isAeronauticalHours (view command fl)- then- view dayNight fl- else- DayNight zerotimeamount zerotimeamount+ view dayNight fl
src/Data/Aviation/Casr/Logbook/Types/Command.hs view
@@ -6,7 +6,6 @@ Command(..) , AsCommand(..) , getUnderInstructionPic-, isAeronauticalHours , _InCommandIncludingInstructing ) where @@ -15,7 +14,7 @@ import Control.Lens ( Prism', preview, makeClassyPrisms, isn't, prism', (#) ) import Data.Aviation.Casr.Logbook.Types.Aviator(Aviator)-import Data.Aviation.Casr.Logbook.Types.Instruction ( Instruction )+import Data.Aviation.Casr.Logbook.Types.Instruction ( Instruction, InstructionRating ) import Data.Bool ( Bool(..) ) import Data.Eq(Eq) import Data.Functor ( Functor((<$)), (<$>) )@@ -28,7 +27,7 @@ | Dual Aviator | InCommand | InCommandInstructing Instruction- | ApprovedSolo Aviator+ | ApprovedSolo Aviator InstructionRating deriving (Eq, Ord, Show) makeClassyPrisms ''Command@@ -44,15 +43,8 @@ Nothing getUnderInstructionPic (InCommandInstructing _) = Nothing-getUnderInstructionPic (ApprovedSolo _) =- Nothing--isAeronauticalHours ::- AsCommand c =>- c- -> Bool-isAeronauticalHours =- isn't _ApprovedSolo+getUnderInstructionPic (ApprovedSolo a _)=+ Just a _InCommandIncludingInstructing :: AsCommand c =>