コード例 #1
0
        public WisePin(string name,
                       WiseBoard brd,
                       DigitalPortType port,
                       int bit,
                       DigitalPortDirection dir,
                       bool inverse = false,
                       Const.Direction direction = Const.Direction.None,
                       bool controlled           = false)
        {
            this.WiseName = name +
                            "@Board" +
                            (brd.type == WiseBoard.BoardType.Hard ? brd.mccBoard.BoardNum : brd.boardNum) +
                            port.ToString() +
                            "[" + bit.ToString() + "]";

            if ((daq = brd.daqs.Find(x => x.porttype == port)) == null)
            {
                throw new WiseException(this.WiseName + ": Invalid Daq spec, no " + port + " on this board");
            }
            this.dir         = dir;
            this.bit         = bit;
            this.inverse     = inverse;
            this._direction  = direction;
            this._controlled = controlled;
            daq.setDir(dir);
            if (daq.owners != null && daq.owners[bit].owner == null)
            {
                daq.setOwner(name, bit);
            }
        }
コード例 #2
0
 public GPIO_PIN(DigitalPortType port, short val)
 {   //Defines the port name and port value of the associated GPIO signal
     //In order to do "atomic" writes to the GPIO module using multiple signals,
     //they will need to share the same port and be OR'd together
     this.port = port;
     this.val  = val;
 }
コード例 #3
0
ファイル: GPIO.cs プロジェクト: trogersVLS/mfg-527
        public short getPort(DigitalPortType port)
        {
            short val;

            this.gpio_board.DIn(port, out val);

            return(val);
        }
コード例 #4
0
ファイル: DataAcqBoard.cs プロジェクト: ScottAtUG/EvcProver
        public DataAcqBoard(int boardNumber, DigitalPortType channelType, int channelNumber)
        {
            _ulStatErrorInfo = MccService.ErrHandling(ErrorReporting.PrintAll, ErrorHandling.DontStop);

            _board       = new MccBoard(boardNumber);
            _channelType = channelType;
            _channelNum  = channelNumber;

            _pulseIsCleared = true;
            _log.Info("Initialized DataAcqBoard: {0}, channel type {1}, channel number {2}", boardNumber, channelType, channelNumber);
        }
コード例 #5
0
        public WiseDaq(WiseBoard wiseBoard, int devno)
        {
            int porttype;

            this.wiseBoard = wiseBoard;
            if (wiseBoard.type == WiseBoard.BoardType.Soft)
            {
                porttype = (int)DigitalPortType.FirstPortA + devno;
                WiseName = "Board" + wiseBoard.boardNum.ToString() + "." + ((DigitalPortType)porttype).ToString();
                _value   = 0;
                switch (devno % 4)
                {
                case 0: nbits = 8; break;       // XXX-PortA

                case 1: nbits = 8; break;       // XXX-PortB

                case 2: nbits = 4; break;       // XXX-PortCL

                case 3: nbits = 4; break;       // XXX-PortCH
                }
            }
            else
            {
                MccDaq.ErrorInfo err;

                err      = wiseBoard.mccBoard.DioConfig.GetDevType(devno, out porttype);
                err      = wiseBoard.mccBoard.DioConfig.GetNumBits(devno, out nbits);
                WiseName = "Board" + wiseBoard.mccBoard.BoardNum.ToString() + "." + ((DigitalPortType)porttype).ToString();
            }

            this.porttype = (DigitalPortType)porttype;
            _mask         = (ushort)((nbits == 8) ? 0xff : 0xf);
            owners        = new WiseBitOwner[nbits];
            for (int i = 0; i < nbits; i++)
            {
                owners[i] = new WiseBitOwner();
            }
        }
コード例 #6
0
ファイル: OutputManagement.cs プロジェクト: xhominum/Robot
 public ErrorInfo.ErrorCode Set(DigitalPortType port, int outputID, DigitalLogicState state)
 {
     lock (this)
     {
         Console.WriteLine(String.Format("port: {0}, outputID: {1}, state: {2}", port, outputID, state));
         if (!BoardFound)
         {
             return(ErrorInfo.ErrorCode.BoardNotExist);
         }
         if (port == DigitalPortType.FirstPortA && outputID >= 0 && outputID <= 7)
         {
             MccDaq.ErrorInfo ULStat;
             ULStat = DaqBoard.DBitOut(port, outputID, state);
             return(PrintError(ULStat));
         }
         else
         {
             SimpleLogger.Logger.Log("Port Not supported");
             Environment.Exit(1);
             return(ErrorInfo.ErrorCode.InvalidNetPort);
         }
     }
 }
コード例 #7
0
ファイル: MsgSingleOuput.cs プロジェクト: xhominum/Robot
 public MsgSingleOuput(DigitalPortType digiPortType, int outputID, DigitalLogicState digiLogicState)
 {
     DigiPortType   = digiPortType;
     OutputID       = outputID;
     DigiLogicState = digiLogicState;
 }
コード例 #8
0
ファイル: GPIO.cs プロジェクト: trogersVLS/mfg-527
 public int getBit(DigitalPortType port, int bit)
 {
     return(5);
 }
コード例 #9
0
ファイル: GPIO.cs プロジェクト: trogersVLS/mfg-527
 public void setPort(DigitalPortType port, ushort val)
 {
     this.gpio_board.DOut(port, val);
 }
コード例 #10
0
ファイル: GPIO.cs プロジェクト: trogersVLS/mfg-527
 public void setBit(DigitalPortType port, int bit, DigitalLogicState val)
 {
     this.gpio_board.DBitOut(port, bit, val);
 }
コード例 #11
0
ファイル: IOCommunication.cs プロジェクト: xhominum/Robot
        public void SendSetOneOutput(DigitalPortType port, int outputID, DigitalLogicState state)
        {
//			MessageContainer message;
            PushMessage(new MsgSingleOuput(port, outputID, state));
        }
コード例 #12
0
        public static IDInOutBoard CreateBoard(int boardNumber, DigitalPortType channelType, int channelNumber)
        {
            var board = new DataAcqBoard(boardNumber, channelType, channelNumber);

            return(board);
        }