Plot-ho-matic 0.12.2.1 → 0.12.2.2
raw patch · 5 files changed
+46/−9 lines, 5 filesdep ~generic-accessors
Dependency ranges changed: generic-accessors
Files
- Plot-ho-matic.cabal +2/−2
- examples/PlotExample.hs +4/−1
- src/PlotHo/HistoryChannel.hs +8/−1
- src/PlotHo/SignalSelector.hs +1/−2
- src/SetHo/LookupTree.hs +31/−3
Plot-ho-matic.cabal view
@@ -1,5 +1,5 @@ name: Plot-ho-matic-version: 0.12.2.1+version: 0.12.2.2 synopsis: Real-time line plotter for generic data license: BSD3 license-file: LICENSE@@ -45,7 +45,7 @@ , colour , containers , data-default-class- , generic-accessors >= 0.6.2.0+ , generic-accessors >= 0.7.0.0 , glib , gtk3 >= 0.14.2 , lens
examples/PlotExample.hs view
@@ -15,6 +15,7 @@ , w :: a } deriving Generic data Bar = MkBar { lol :: Double+ , a_bool :: Bool -- , xyzList :: S.Seq Xyz , foos :: Foo (Foo (Foo Double)) , foo :: Foo Double@@ -26,6 +27,7 @@ bar0 = MkBar 7+ False -- (S.fromList [MkFoo 1 2 3]) (MkFoo 1 2 3 (MkFoo 4 5 6 (MkFoo 7 8 9 10))) (MkFoo 1 2 3 4)@@ -34,9 +36,10 @@ foo0 = MkFoo 1 2 3 0.1 incrementBar :: Bar -> Bar-incrementBar (MkBar a _ _) =+incrementBar (MkBar a b _ _) = MkBar (a+0.2)+ (not b) (foo' (foo' (foo' (sin (3*a))))) (foo' (sin (2*a))) where
src/PlotHo/HistoryChannel.hs view
@@ -57,7 +57,14 @@ toDoubleGetter :: GAField a -> (a -> Double) toDoubleGetter (FieldDouble f) = (^. f) toDoubleGetter (FieldFloat f) = realToFrac . (^. f)- toDoubleGetter (FieldInt f) = fromIntegral . (^. f)+ toDoubleGetter (FieldInt8 f) = fromIntegral . (^. f)+ toDoubleGetter (FieldInt16 f) = fromIntegral . (^. f)+ toDoubleGetter (FieldInt32 f) = fromIntegral . (^. f)+ toDoubleGetter (FieldInt64 f) = fromIntegral . (^. f)+ toDoubleGetter (FieldWord8 f) = fromIntegral . (^. f)+ toDoubleGetter (FieldWord16 f) = fromIntegral . (^. f)+ toDoubleGetter (FieldWord32 f) = fromIntegral . (^. f)+ toDoubleGetter (FieldWord64 f) = fromIntegral . (^. f) toDoubleGetter (FieldString _) = const 0 toDoubleGetter FieldSorry = const 0
src/PlotHo/SignalSelector.hs view
@@ -269,8 +269,7 @@ } --- TODO(greg): tests--- swashRotorCommands.c{ollective, yclicPitch, yclicRoll}+ -- The greatest common prefix will be the title. -- Everything after that is the field name. gettersAndTitle :: forall a . [([String], a)] -> ([(String, a)], Maybe String)
src/SetHo/LookupTree.hs view
@@ -226,7 +226,14 @@ let showField :: DField -> String showField (DDouble x) = showDouble x showField (DFloat x) = showFloat x- showField (DInt x) = show x+ showField (DInt8 x) = show x+ showField (DInt16 x) = show x+ showField (DInt32 x) = show x+ showField (DInt64 x) = show x+ showField (DWord8 x) = show x+ showField (DWord16 x) = show x+ showField (DWord32 x) = show x+ showField (DWord64 x) = show x showField (DString x) = x showField DSorry = "" @@ -460,9 +467,30 @@ modifyField f0@(DFloat _) txt = case readMaybe txt of Nothing -> f0 Just x -> DFloat x- modifyField f0@(DInt _) txt = case readMaybe txt of+ modifyField f0@(DInt8 _) txt = case readMaybe txt of Nothing -> f0- Just x -> DInt x+ Just x -> DInt8 x+ modifyField f0@(DInt16 _) txt = case readMaybe txt of+ Nothing -> f0+ Just x -> DInt16 x+ modifyField f0@(DInt32 _) txt = case readMaybe txt of+ Nothing -> f0+ Just x -> DInt32 x+ modifyField f0@(DInt64 _) txt = case readMaybe txt of+ Nothing -> f0+ Just x -> DInt64 x+ modifyField f0@(DWord8 _) txt = case readMaybe txt of+ Nothing -> f0+ Just x -> DWord8 x+ modifyField f0@(DWord16 _) txt = case readMaybe txt of+ Nothing -> f0+ Just x -> DWord16 x+ modifyField f0@(DWord32 _) txt = case readMaybe txt of+ Nothing -> f0+ Just x -> DWord32 x+ modifyField f0@(DWord64 _) txt = case readMaybe txt of+ Nothing -> f0+ Just x -> DWord64 x modifyField (DString _) txt = DString txt modifyField DSorry _ = DSorry