12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace Uestc.Auto6.Dso.Hardware.Driver
- {
- public class AbstractAcquirer_Temperaturer : AbstractAcquirer
- {
- internal override void Init()
- {
- #if !Product_B21_JinHui_PXI
- HdIO.WriteReg(PcieBdReg.W.SysMon_Reset, 0);
- HdIO.WriteReg(PcieBdReg.W.SysMon_Reset, 1);
- HdIO.WriteReg(PcieBdReg.W.SysMon_Reset, 0);
- #else
- #endif
- }
- internal override void InitAcq()
- {
- }
- private Int32 readbackData = 0;
- internal override bool ReadAcqData()
- {
- #if !Product_B21_JinHui_PXI
- UInt32 data = (HdIO.ReadReg(PcieBdReg.R.SysMon_ReadData) >> 8) & 0xffff;
- readbackData = (Int32)data;
- #else
- #endif
- return true;
- }
- /// <summary>
- /// 读取以摄氏度为单位的温度传感器数据。
- /// </summary>
- /// <param name="whichSensor">第几个传感器,目前只有一个。</param>
- /// <returns></returns>
- public virtual double ReadByCentigrade(int whichSensor = 0)
- {
- return readbackData * 1.0 / 10;
- }
- }
- }
|