public BinaryChunkWriterTest(string fileName)
        {
            using (SpiDevice spi = SpiDevice.Create(new SpiConnectionSettings(1, 0)
            {
                Mode = SpiMode.Mode0, ClockFrequency = 900000
            }))
            {
                _accelerometerDevice = new Mcp3208Custom(spi, (int)Channel.X, (int)Channel.Y, (int)Channel.Z);
            }
            // _accelerometerDevice = new Accelerometer(new SpiConnectionSettings(0, 0) { Mode = SpiMode.Mode0, ClockFrequency = 1900000 });
            _gyroscopeDevice = new Gyroscope(new SpiConnectionSettings(0, 0)
            {
                Mode = SpiMode.Mode0, ClockFrequency = 900000
            });
            _cpuDevice = new CpuTemperature();
            _rtcDevice = new RTC();
            _uart      = new UART();

            fs = new FileStream(fileName, FileMode.Create, FileAccess.Write);
        }
Ejemplo n.º 2
0
        void Init(Scene scene)
        {
            RTC.Register();
            scenePtr = RTC.NewScene(SceneFlags.Static | SceneFlags.Coherent | SceneFlags.Incoherent | SceneFlags.Robust,
                                    TraversalFlags.Single | TraversalFlags.Packet4);

            foreach (var obj in scene.Objects)
            {
                this.AddObj(obj);
            }

            foreach (var light in scene.Lights)
            {
                if (light is IObj)
                {
                    var geomId = this.AddObj((IObj)light);
                    this.geometryIdLights.Add(geomId, (IObj)light);
                }
            }


            RTC.Commit(scenePtr);
            RTC.CheckLastError();
        }
        private void SyncTime()
        {
            var time   = RTC.CurrentTime();
            var millis = BitConverter.GetBytes(Clock.Instance.ElapsedMilliseconds);

            var dataIndex = _metaDataCount;

            _dataArray[dataIndex++] = time[0];
            _dataArray[dataIndex++] = time[1];
            _dataArray[dataIndex++] = time[2];

            _dataArray[dataIndex++] = millis[0];
            _dataArray[dataIndex++] = millis[1];
            _dataArray[dataIndex++] = millis[2];
            _dataArray[dataIndex++] = millis[3];
            _dataArray[dataIndex++] = millis[4];
            _dataArray[dataIndex++] = millis[5];
            _dataArray[dataIndex++] = millis[6];
            _dataArray[dataIndex]   = millis[7];

            Array.Copy(_dataArray, _workItem.PacketData, 0);

            Thread.Sleep(_delay);
        }
Ejemplo n.º 4
0
 public void Dispose()
 {
     RTC.DeleteScene(scenePtr);
     //RTC.Unregister();
 }
Ejemplo n.º 5
0
 public int Run_GetRTC(ref RTC p_stRTCInfo)
 {
     return(comm.Run_GetRTC(ref p_stRTCInfo));
 }
Ejemplo n.º 6
0
 public int Run_SetRTC(RTC p_stRTCInfo)
 {
     return(comm.Run_SetRTC(p_stRTCInfo));
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Entry point - pass "verbose" as a command-line
        /// argument to initialize Embree in verbose mode.
        /// </summary>
        public static int Main(String[] args)
        {
            try
            {
                var verbose = (args.Select(s => s.ToLower()).Contains("verbose"));
                if (verbose)
                {
                    args.Select(s => s != "verbose"); // Clean up arglist
                }
                ParseCommandLineArguments(args);      // For selecting ray packet sizes

                if (verbose)
                {
                    Console.WriteLine("Embree.NET Benchmark [VERBOSE]");
                    Console.WriteLine("==============================");
                    RTC.Register("verbose=999"); // max verbosity?
                }
                else
                {
                    Console.WriteLine("Embree.NET Benchmark");
                    Console.WriteLine("====================");
                }

                Console.WriteLine(""); // this is for debugging
                Console.WriteLine("[+] " + Bits + "-bit mode.");

                // Note this is similar to the original Embree benchmark program
                Console.WriteLine("[+] Performance indicators are per-thread.");

                {
                    // Benchmark parameters
                    int w = 1024, h = 1024;

                    Console.WriteLine("[+] Benchmarking intersection queries.");

                    foreach (var item in Benchmarks.Intersections(SceneFlags.Static, Flags, 501, w, h))
                    {
                        Measure(item.Item2, item.Item3, (s) => Console.WriteLine("    {0} = {1}", item.Item1.PadRight(35), s));
                    }

                    Console.WriteLine("[+] Benchmarking occlusion queries.");

                    foreach (var item in Benchmarks.Occlusions(SceneFlags.Static, Flags, 501, w, h))
                    {
                        Measure(item.Item2, item.Item3, (s) => Console.WriteLine("    {0} = {1}", item.Item1.PadRight(35), s));
                    }
                }

                /*{
                 *  Console.WriteLine("[+] Benchmarking geometry manipulations.");
                 *
                 *  foreach (var item in Benchmarks.Geometries(SceneFlags.Static, Flags))
                 *      Measure(item.Item2, item.Item3, (s) => Console.WriteLine("    {0} = {1}", item.Item1.PadRight(35), s));
                 * }*/

                if (verbose)
                {
                    RTC.Unregister();
                }

                return(EXIT_SUCCESS);
            }
            catch (Exception e)
            {
                var msg = e is AggregateException ? e.InnerException.Message : e.Message;
                Console.WriteLine(String.Format("[!] Error: {0}.", msg));
                Console.WriteLine("\n========= STACK TRACE =========\n");
                Console.WriteLine(e.StackTrace);
                return(EXIT_FAILURE);
            }
        }
Ejemplo n.º 8
0
        public FrmMain()
        {
            //Always intialize the WebRTC engine first!
            RTC.Init();

            InitializeComponent();

            currParticipants = new List <CurrentParticipants>();

            snd = new SoundPlayer();

            ShowStatus("Initializing RTC..");

            iconfRTC = new RTCControl {
                Dock = DockStyle.Fill
            };

            settings = new frmSettings(iconfRTC);

            //setup the signaling
            iconfRTC.SignalingUrl  = ConfigurationManager.AppSettings["SignalingUrl"];
            iconfRTC.SignalingType = SignalingTypes.Socketio;

            //logging
            iconfRTC.LoggingEnabled = true;
            iconfRTC.LogFilePath    = Path.GetTempPath() + @"\rtclog.txt";

            #region iConfRTC Events

            iconfRTC.DoubleClick            += IconfRTC_DoubleClick;
            iconfRTC.RTCInitialized         += IconfRTC_RTCInitialized;
            iconfRTC.IJoinedMeeting         += IconfRTC_IJoinedMeeting;
            iconfRTC.UserJoinedMeeting      += IconfRTC_UserJoinedMeeting;
            iconfRTC.UserLeftMeeting        += IconfRTC_UserLeftMeeting;
            iconfRTC.ILeftMeeting           += IconfRTC_ILeftMeeting;
            iconfRTC.NewDevices             += IconfRTC_NewDevices;
            iconfRTC.MeetingMessageReceived += IconfRTC_MeetingMessageReceived;

            #endregion


            var pnlMyViewerParent = new OutlookPanelEx()
            {
                Width = 480, Height = 360, Visible = true, HeaderText = ""
            };


            pnlMyViewerParent.Controls.Add(iconfRTC);



            pnlLayout.Controls.Add(pnlMyViewerParent);

            //rtf text  box for chat
            rtBox = new HtmlPanel {
                Parent = pnlFill, Dock = DockStyle.Fill, AutoScroll = true
            };

            chatFont = new Font(Font, FontStyle.Bold);

            pnlLayout.Show();

            PositionJoinPanel();
        }
Ejemplo n.º 9
0
 public override void Execute(string param)
 {
     //TODO: For some reason the values output are too high. F.instance GetSeconds goes to 90.
     System.Console.WriteLine((int)RTC.GetHours() + ":" + RTC.GetMinutes() + ":" + RTC.GetSeconds());
 }