ReadByte() публичный Метод

Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.
Modified [20051124]
public ReadByte ( ) : int
Результат int
Пример #1
0
        public Telemetry(byte[] raw)
        {
            this.originalpacketlength = raw.Length;
            if (Telemetry.logHeaderLine)
            {
                Console.WriteLine("UTCTime,");
            }
            else if (this.originalpacketlength > 0)
            {
                Console.WriteLine(string.Format("{0} {1},", System.DateTime.UtcNow.ToShortDateString(), System.DateTime.UtcNow.ToLongTimeString()));
            }
            if (raw.Length == 0)
            {
                return;
            }
            BitStream bitStream = new BitStream();
            bitStream.Write(raw);
            bitStream.Position = 0L;
            this.Set(Telemetry.DataIndex.SatelliteId, new SatelliteIdTelemetryValue(this.Get2bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.FrameId, new FrameIdTelemetryValue(this.Get6bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.PanelVoltX, new RawTelemetryValue(this.Get16bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.PanelVoltY, new RawTelemetryValue(this.Get16bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.PanelVoltZ, new RawTelemetryValue(this.Get16bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.PanelCurrentTotal, new RawTelemetryValue(this.Get16bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.BattVolt0, new RawTelemetryValue(this.Get16bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.BattCurrentBus, new RawTelemetryValue(this.Get16bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.RebootCount, new RawTelemetryValue(this.Get16bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.EpsErrorCount, new RawTelemetryValue(this.Get16bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.EpsTemp1, new RawTelemetryValue(this.Get8bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.EpsTemp2, new RawTelemetryValue(this.Get8bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.EpsTemp3, new RawTelemetryValue(this.Get8bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.BattTemp0, new RawTelemetryValue(this.Get8bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.LatchCount5_0, new RawTelemetryValue(this.Get8bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.LatchCount3_3, new RawTelemetryValue(this.Get8bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.ResetCause, new EPSResetcauseTelemetryValue(this.Get8bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.PptTrackingMode, new EPSPowerTrackingTelemetryValue(this.Get8bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.AsibSunSensorX1, new SunSensorTelemetryValue(this.Get10bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.AsibSunSensorY1, new SunSensorTelemetryValue(this.Get10bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.AsibSunSensorZ1, new SunSensorTelemetryValue(this.Get10bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.AsibPanelTempX1, new MultiplierOffsetTelemetryValue(-0.2073, 158.239, this.Get10bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.AsibPanelTempX2, new MultiplierOffsetTelemetryValue(-0.2083, 159.227, this.Get10bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.AsibPanelTempY1, new MultiplierOffsetTelemetryValue(-0.2076, 158.656, this.Get10bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.AsibPanelTempY2, new MultiplierOffsetTelemetryValue(-0.2087, 159.045, this.Get10bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.AsibBusVolt3_3, new MultiplierTelemetryValue(4.0, this.Get10bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.AsibBusCurrent3_3, new MultiplierTelemetryValue(1.0, this.Get10bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.AsibBusVolt5_0, new MultiplierTelemetryValue(6.0, this.Get10bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.RfReceiverDoppler, new RawTelemetryValue(this.Get8bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.RfReceiverRSSI, new RawTelemetryValue(this.Get8bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.RfTemp, new MultiplierOffsetTelemetryValue(-0.857, 193.672, this.Get8bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.RfReceiveCurrent, new RawTelemetryValue(this.Get8bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.RfTransmitCurrent3_3, new RawTelemetryValue(this.Get8bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.RfTransmitCurrent5_0, new RawTelemetryValue(this.Get8bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.PaReversePower, new PaPowerTelemetryValue(this.Get8bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.PaForwardPower, new PaPowerTelemetryValue(this.Get8bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.PaTemperature, new PaTemperatureTelemetryValue(this.Get8bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.PaCurrent, new PaCurrentTelemetryValue(this.Get8bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.AntTempA, new AntsTemperatureTelemetryValue(this.Get8bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.AntTempB, new AntsTemperatureTelemetryValue(this.Get8bitsAsUInt(bitStream)));
            this.Set(Telemetry.DataIndex.AntDeploy1, new AntsDeployTelemetryValue(this.Get1bitAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.AntDeploy2, new AntsDeployTelemetryValue(this.Get1bitAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.AntDeploy3, new AntsDeployTelemetryValue(this.Get1bitAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.AntDeploy4, new AntsDeployTelemetryValue(this.Get1bitAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.SequenceNumber, new RawTelemetryValue(this.Get24bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.DtmfCommandCount, new RawTelemetryValue(this.Get6bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.DtmfLastCommand, new RawTelemetryValue(this.Get5bitsAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.DtmfCommandSuccess, new DeviceDataValidTelemetryValue(this.Get1bitAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.DataValidBob, new DeviceDataValidTelemetryValue(this.Get1bitAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.DataValidEps, new DeviceDataValidTelemetryValue(this.Get1bitAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.DataValidPa, new DeviceDataValidTelemetryValue(this.Get1bitAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.DataValidRf, new DeviceDataValidTelemetryValue(this.Get1bitAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.DataValidMse, new DeviceDataValidTelemetryValue(this.Get1bitAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.DataValidAnts2, new DeviceDataValidTelemetryValue(this.Get1bitAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.DataValidAnts1, new DeviceDataValidTelemetryValue(this.Get1bitAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.InEclipse, new RawTelemetryValue(this.Get1bitAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.InSafeMode, new RawTelemetryValue(this.Get1bitAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.HardwareABF, new BoolOnOffTelemetryValue(this.Get1bitAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.SoftwareABF, new SoftwareAbfTelemetryValue(this.Get1bitAsInt(bitStream)));
            this.Set(Telemetry.DataIndex.DeployWait, new BoolOnOffTelemetryValue(this.Get1bitAsInt(bitStream)));
            bitStream.Position = 448L;
            BitStream bitStream2 = new BitStream(1600L);
            for (int i = 0; i < 200; i++)
            {
                bitStream2.WriteByte((byte)bitStream.ReadByte());
            }
            bitStream2.Position = 0L;
            this.Set(Telemetry.DataIndex.Payload, new PayloadTelemetryValue(bitStream2));

            if (this.originalpacketlength > 0)
            {
                Console.WriteLine(string.Empty);
            }

            if (Settings.Default.LoggingEnabled)
            {
                Telemetry.logHeaderLine = false;
            }
        }