コード例 #1
0
ファイル: xIMUfile.cs プロジェクト: dunhaiyang/xIMUcppAPI
 protected virtual void OnDigitalIODataRead(DigitalIOdata e)
 {
     if (DigitalIODataRead != null)
     {
         DigitalIODataRead(this, e);
     }
 }
コード例 #2
0
 /// <summary>
 /// Constructs an encoded digital I/O packet.
 /// </summary>
 /// <param name="digitalIOdata">
 /// DigitalIOdata object containing output states to be set.
 /// </param>
 /// <returns>
 /// Constructed and encoded digital I/O packet.
 /// </returns>
 public static byte[] ConstructDigitalIOpacket(DigitalIOdata digitalIOdata)
 {
     byte[] decodedPacket = new byte[] { (byte)PacketHeaders.DigitalIOdata,
                                         0x00,
                                         digitalIOdata.State.ConvertToByte(),
                                         0 };
     decodedPacket = InsertChecksum(decodedPacket);
     return(PacketEncoding.EncodePacket(decodedPacket));
 }
コード例 #3
0
ファイル: xIMUserial.cs プロジェクト: docmartini/xIMUcppAPI
 protected virtual void OnDigitalIODataReceived(DigitalIOdata e) { if (DigitalIODataReceived != null) DigitalIODataReceived(this, e); }
コード例 #4
0
ファイル: xIMUserial.cs プロジェクト: docmartini/xIMUcppAPI
 /// <summary>
 /// Sends digital IO packet to set digital output states.
 /// </summary>
 /// <param name="digitalIOdata">
 /// Digital IO data representing digital output states to be set.
 /// </param>
 public void SendDigitalIOpacket(DigitalIOdata digitalIOdata)
 {
     SendByteArray(PacketConstruction.ConstructDigitalIOpacket(digitalIOdata));
     PacketsWrittenCounter.DigitalIOdataPackets++;
 }
コード例 #5
0
 /// <summary>
 /// Sends digital IO packet to set digital output states.
 /// </summary>
 /// <param name="digitalIOdata">
 /// Digital IO data representing digital output states to be set.
 /// </param>
 public void SendDigitalIOpacket(DigitalIOdata digitalIOdata)
 {
     SendByteArray(PacketConstruction.ConstructDigitalIOpacket(digitalIOdata));
     PacketsWrittenCounter.DigitalIOdataPackets++;
 }
コード例 #6
0
 /// <summary>
 /// Writes <see cref="DigitalIOdata"/> to CSV file. Will create new file if required.
 /// </summary>
 /// <param name="digitalIOdata">
 /// x-IMU digital I/O data.
 /// </param>
 public void WriteDigitalIOdata(DigitalIOdata digitalIOdata)
 {
     WriteCSVlineAtFileIndex(digitalIOdata.ConvertToCSVstring(), FileIndexes.DigitalIO);
     PacketsWrittenCounter.DigitalIOdataPackets++;
 }
コード例 #7
0
 /// <summary>
 /// Writes <see cref="DigitalIOdata"/> to CSV file. Will create new file if required.
 /// </summary>
 /// <param name="digitalIOdata">
 /// x-IMU digital I/O data.
 /// </param>
 public void WriteDigitalIOdata(DigitalIOdata digitalIOdata)
 {
     WriteCSVlineAtFileIndex(digitalIOdata.ConvertToCSVstring(), FileIndexes.DigitalIO);
     PacketsWrittenCounter.DigitalIOdataPackets++;
 }
コード例 #8
0
 /// <summary>
 /// Constructs an encoded digital I/O packet.
 /// </summary>
 /// <param name="digitalIOdata">
 /// DigitalIOdata object containing output states to be set.
 /// </param> 
 /// <returns>
 /// Constructed and encoded digital I/O packet.
 /// </returns> 
 public static byte[] ConstructDigitalIOpacket(DigitalIOdata digitalIOdata)
 {
     byte[] decodedPacket = new byte[] { (byte)PacketHeaders.DigitalIOdata,
                                         0x00,
                                         digitalIOdata.State.ConvertToByte(),
                                         0};
     decodedPacket = InsertChecksum(decodedPacket);
     return PacketEncoding.EncodePacket(decodedPacket);
 }