pcdshub / pytmc

Generate EPICS IOCs and records from TwinCAT projects - along with many TwinCAT project tools
https://pcdshub.github.io/pytmc/
Other
10 stars 11 forks source link

FIX: arrays and string waveform NELM #108

Closed klauer closed 5 years ago

klauer commented 5 years ago

Discovered by @ZLLentz, this bug caused arrays to be represented as scalar records (i.e., not waveform) in the EPICS db.

This now generates what appears to be correct to me:

record(waveform, "TST:PPM:SPM:VOLT_BUFFER_RBV"){
  field(PINI, "1")
  field(TSE, "-2")
  field(INP, "@asyn($(PORT),0,1)ADSPORT=851/Main.fbPPM.stPPM.stPowerMeter.fVoltageBuffer?")
  field(DTYP, "asynFloat64ArrayIn")
  field(SCAN, "I/O Intr")
  field(FTVL, "DOUBLE")
  field(NELM, "1000")
}

record(waveform, "TST:PPM:SPM:MJ_BUFFER_RBV"){
  field(PINI, "1")
  field(TSE, "-2")
  field(INP, "@asyn($(PORT),0,1)ADSPORT=851/Main.fbPPM.stPPM.stPowerMeter.fCalibMJBuffer?")
  field(DTYP, "asynFloat64ArrayIn")
  field(SCAN, "I/O Intr")
  field(FTVL, "DOUBLE")
  field(NELM, "1000")
}

(This also shows we have a lot of holes in the test suite, which probably shouldn't be a surprise given how much I thrashed it...)

codecov-io commented 5 years ago

Codecov Report

Merging #108 into master will increase coverage by 0.37%. The diff coverage is 93.33%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #108      +/-   ##
========================================
+ Coverage   74.62%    75%   +0.37%     
========================================
  Files          15     15              
  Lines        1600   1612      +12     
========================================
+ Hits         1194   1209      +15     
+ Misses        406    403       -3
Impacted Files Coverage Δ
pytmc/pragmas.py 97.7% <100%> (+0.02%) :arrow_up:
pytmc/parser.py 83.36% <100%> (+0.94%) :arrow_up:
pytmc/record.py 93.82% <88.88%> (-0.41%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0492cfe...c154ceb. Read the comment docs.

klauer commented 5 years ago

Confirmed locally - instead of 81 for all strings, it gets the correct value now.

teddyrendahl commented 5 years ago

👍