Esempio n. 1
0
        private void HandleShowSensors(string module, string[] cmdparams)
        {
            if (!IsSceneSelected())
            {
                return;
            }

            SensorRepeat sr = AsyncCommandManager.GetSensorRepeatPlugin(m_engine);

            if (sr == null)
            {
                MainConsole.Instance.Output("Plugin not yet initialized");
                return;
            }

            List <SensorRepeat.SensorInfo> sensorInfo = sr.GetSensorInfo();

            ConsoleDisplayTable cdt = new ConsoleDisplayTable();

            cdt.AddColumn("Part name", 40);
            cdt.AddColumn("Script item ID", 36);
            cdt.AddColumn("Type", 4);
            cdt.AddColumn("Interval", 8);
            cdt.AddColumn("Range", 8);
            cdt.AddColumn("Arc", 8);

            foreach (SensorRepeat.SensorInfo s in sensorInfo)
            {
                cdt.AddRow(s.host.Name, s.itemID, s.type, s.interval, s.range, s.arc);
            }

            MainConsole.Instance.Output(cdt.ToString());
            MainConsole.Instance.Output("Total: {0}", sensorInfo.Count);
        }