X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FTSN%2FXML%2FHeartbeat.hs;h=8fafba1c6c80d6435793a1345ab733329ebfc9a9;hb=22ef5496c109815e1c97d9350181b4a96145fb94;hp=89b91adb4605a35a1b6203c0ec2d578f0488b154;hpb=52632b1b0ae2421877a960e80f717a69e8a38f85;p=dead%2Fhtsn-import.git diff --git a/src/TSN/XML/Heartbeat.hs b/src/TSN/XML/Heartbeat.hs index 89b91ad..8fafba1 100644 --- a/src/TSN/XML/Heartbeat.hs +++ b/src/TSN/XML/Heartbeat.hs @@ -10,6 +10,7 @@ module TSN.XML.Heartbeat ( where -- System imports. +import Data.Time.Clock ( UTCTime ) import Data.Tuple.Curry ( uncurryN ) import Test.Tasty ( TestTree, testGroup ) import Test.Tasty.HUnit ( (@?=), testCase ) @@ -25,6 +26,7 @@ import Text.XML.HXT.Core ( -- Local imports. import TSN.DbImport ( ImportResult(..) ) +import TSN.Picklers ( xp_time_stamp ) import Xml ( pickle_unpickle, unpickleable ) @@ -40,7 +42,7 @@ data Message = Message { xml_file_id :: Int, heading :: String, - time_stamp :: String } + time_stamp :: UTCTime } deriving (Eq, Show) @@ -53,7 +55,7 @@ pickle_message = xpWrap (from_tuple, to_tuple) $ xpTriple (xpElem "XML_File_ID" xpInt) (xpElem "heading" xpText) - (xpElem "time_stamp" xpText) + (xpElem "time_stamp" xp_time_stamp) where from_tuple = uncurryN Message to_tuple m = (xml_file_id m,