Esempio n. 1
0
        public void BroadcastFsxData(FsxValueBag valueBag)
        {
            UdpResponseMessage msg = new UdpResponseMessage
            {
                MsgType = UdpResponseMessage.Types.MsgType.TransmissionData,
                TransmissionDataBody = new UdpResponseMessage.Types.TransmissionDataBody
                {
                    XAcceleration = valueBag.XAcceleration,
                    YAcceleration = valueBag.YAcceleration,
                    ZAcceleration = valueBag.ZAcceleration,
                    PitchVelocity = valueBag.PitchVelocity,
                    RollVelocity  = valueBag.RollVelocity,
                    YawVelocity   = valueBag.YawVelocity,
                },
            };

            using (ValueBag.HexiClientsLock.WriterLock())
            {
                foreach (var client in ValueBag.HexiClients)
                {
                    if (client.Valid)
                    {
                        client.SendMessage(msg);
                    }
                }
            }
        }
Esempio n. 2
0
 public void Sync(FsxValueBag fsxValueBag)
 {
     SetValue(StatusMapTypes.FSX_CONNECTED, fsxValueBag.Connected);
     SetValue(StatusMapTypes.FSX_PAUSED, fsxValueBag.Paused);
     SetValue(StatusMapTypes.FSX_AIR_SPEED, fsxValueBag.TrueAirSpeed);
     SetValue(StatusMapTypes.FSX_LAT, fsxValueBag.Lat);
     SetValue(StatusMapTypes.FSX_LNG, fsxValueBag.Lng);
     SetValue(StatusMapTypes.FSX_X_VEL, fsxValueBag.XVelocity);
     SetValue(StatusMapTypes.FSX_Y_VEL, fsxValueBag.YVelocity);
     SetValue(StatusMapTypes.FSX_Z_VEL, fsxValueBag.ZVelocity);
     SetValue(StatusMapTypes.FSX_X_ACC, fsxValueBag.XAcceleration);
     SetValue(StatusMapTypes.FSX_Y_ACC, fsxValueBag.YAcceleration);
     SetValue(StatusMapTypes.FSX_Z_ACC, fsxValueBag.ZAcceleration);
     SetValue(StatusMapTypes.FSX_PITCH_VEL, fsxValueBag.PitchVelocity);
     SetValue(StatusMapTypes.FSX_ROLL_VEL, fsxValueBag.RollVelocity);
     SetValue(StatusMapTypes.FSX_YAW_VEL, fsxValueBag.YawVelocity);
     RenderAllItems();
 }