Created
June 5, 2019 13:44
-
-
Save electroCutie/a8547176c3d95ba27023f0cac7388930 to your computer and use it in GitHub Desktop.
Getting the compile line for a spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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