示例#1
0
        private FlightLoopTime OnFlightLoopHook(TimeSpan elapsedTimeSinceLastCall, TimeSpan elapsedTimeSinceLastFlightLoop, int counter)
        {
            m_api.Log.Log($"LoggerPlugin: Hook(Now = {DateTime.Now.ToString("T")}, SinceLastCall = {elapsedTimeSinceLastCall.TotalSeconds}s, SinceLastLoop = {elapsedTimeSinceLastFlightLoop}s, Counter = {counter:000000})");
            LogDataRefs();
            m_api.Log.Log("");

            return(FlightLoopTime.FromSeconds(1.0f));
        }
示例#2
0
        private FlightLoopTime OnFlightLoopHook(TimeSpan elapsedTimeSinceLastCall, TimeSpan elapsedTimeSinceLastFlightLoop, int counter)
        {
            m_api.Log.Log($"LoggerPlugin: Hook(Now = {DateTime.Now.ToString("T")}, SinceLastCall = {elapsedTimeSinceLastCall.TotalSeconds}s, SinceLastLoop = {elapsedTimeSinceLastFlightLoop}s, Counter = {counter:000000})");
            LogDataRefs();
            m_api.Log.Log("ard_after_flight_hook_logdatarefs");
            var cmd = m_api.Commands.GetCommand("sim/GPS/g430n1_cdi");

            cmd.InvokeOnce();
            m_api.Log.Log("cmd_sent_sim / GPS / g430n1_cdi");

            return(FlightLoopTime.FromSeconds(1.0f));
        }
示例#3
0
        public LoggerPlugin(IXPlaneApi api)
        {
            m_api = api ?? throw new ArgumentNullException(nameof(api));

            m_api.Log.Log("LoggerPlugin: Started");

            m_api.ConfigChanged += OnConfigurationChanged;

            m_flightLoopHook = m_api.Processing.RegisterFlightLoopHook(
                FlightLoopTime.FromSeconds(1.0f), OnFlightLoopHook
                );

            ReloadDataRefs();
        }
示例#4
0
        public LoggerPlugin(IXPlaneApi api)
        {
            m_api = api ?? throw new ArgumentNullException("api");

            m_api.Log.Log("LoggerPlugin: Started");

            m_api.ConfigChanged += OnConfigurationChanged;

            m_api.Messages.MessageReceived += Messages_MessageReceived;
            m_api.Messages.PlaneCrashed    += Messages_PlaneCrashed;
            m_api.Messages.PlaneLoaded     += Messages_PlaneLoaded;

            m_flightLoopHook = m_api.Processing.RegisterFlightLoopHook(
                FlightLoopTime.FromSeconds(1.0f), OnFlightLoopHook
                );

            ReloadDataRefs();
        }