コード例 #1
0
 /// <summary>
 /// 使用指定的容量初始化缓存数据块
 /// </summary>
 /// <param name="capacity">初始化的容量</param>
 public SoftBuffer(int capacity)
 {
     buffer        = new byte[capacity];
     this.capacity = capacity;
     hybirdLock    = new SimpleHybirdLock( );
     byteTransform = new RegularByteTransform( );
 }
コード例 #2
0
        /// <summary>
        /// 实例化一个mc协议的服务器
        /// </summary>
        public MelsecMcServer( )
        {
            // 共计使用了五个数据池
            xBuffer = new SoftBuffer(DataPoolLength);
            yBuffer = new SoftBuffer(DataPoolLength);
            mBuffer = new SoftBuffer(DataPoolLength);
            dBuffer = new SoftBuffer(DataPoolLength * 2);
            wBuffer = new SoftBuffer(DataPoolLength * 2);

            WordLength    = 1;
            ByteTransform = new RegularByteTransform( );
        }
コード例 #3
0
        /// <summary>
        /// LSisServer
        /// </summary>
        public LSisServer()
        {
            pBuffer = new SoftBuffer(DataPoolLength);
            qBuffer = new SoftBuffer(DataPoolLength);
            mBuffer = new SoftBuffer(DataPoolLength);
            dBuffer = new SoftBuffer(DataPoolLength);

            WordLength    = 2;
            ByteTransform = new RegularByteTransform();

            serialPort = new SerialPort();
        }
コード例 #4
0
ファイル: LSisServer.cs プロジェクト: zrla/HslCommunication
        /// <summary>
        /// LSisServer
        /// </summary>
        public LSisServer()
        {
            pBuffer = new SoftBuffer(DataPoolLength);
            qBuffer = new SoftBuffer(DataPoolLength);
            mBuffer = new SoftBuffer(DataPoolLength);
            dBuffer = new SoftBuffer(DataPoolLength);

            WordLength    = 2;
            ByteTransform = new RegularByteTransform();

#if !NETSTANDARD2_0
            serialPort = new SerialPort();
#endif
        }
コード例 #5
0
 /// <summary>
 /// 使用默认的大小初始化缓存空间
 /// </summary>
 public SoftBuffer( )
 {
     buffer        = new byte[capacity];
     hybirdLock    = new SimpleHybirdLock( );
     byteTransform = new RegularByteTransform( );
 }
コード例 #6
0
 public RegularByteTransformTest( )
 {
     byteTransform = new RegularByteTransform( );
 }
コード例 #7
0
 /// <summary>
 /// constructor
 /// </summary>
 public ByteTransformHelperTest( )
 {
     byteTransform = new RegularByteTransform( );
 }