Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@electroCutie
Created June 5, 2019 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save electroCutie/a8547176c3d95ba27023f0cac7388930 to your computer and use it in GitHub Desktop.
Save electroCutie/a8547176c3d95ba27023f0cac7388930 to your computer and use it in GitHub Desktop.
Getting the compile line for a spec
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE PatternSynonyms #-}
module Main where
import Text.Printf
import Calibration.CalUnits
spec = newCalSpec 7.481
ManualWater ManualReader
-- VoltageCmd_0_10 X866VoltsIn
CurrentCmd_4_20 NewX866MillisIn
-- KhsNlCurrentCmd2_4_20 X866MillisIn
main :: IO ()
main = do
printf "make DEFINES='-D ZeroFlowCurrent=%.0f -D DeadbandUlps=%.0f -D MaxUlps=%.0f -D ADC_VOLTAGE=%d -D TEST=1' && ./test | tee /tmp/test.xyz\n\n"
(calCmdZeroUlps spec)
(calCmdUlpSpan spec * 0.03)
(calCmdUlpMax spec)
(compileSensorNumber $ calCmd spec)
-- print (splineParams khsNlData)
-- writeF "/tmp/spline.xyz" id
-- [spline khsNlData] [(0,0),(1,1)]
putStr "plot \"cal.xyz\" with lines, \"pts.xyz\", \"test.xyz\" with lines\n\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment