示例#1
0
        public FileBackend(SequencedFilePath filePath, bool flushAfterEachWrite = false)
        {
            var stream = File.Open(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite);

            output = new StreamWriter(stream);
            sync   = new object();
            timer  = new Timer(x => Flush(), null, 0, 5000);
            this.flushAfterEachWrite = flushAfterEachWrite;
        }
        public UartFileBackend(SequencedFilePath path, IUART uart, bool immediateFlush = false)
        {
            this.uart           = uart;
            this.immediateFlush = immediateFlush;

            // SequencedFilePath asserts that file in given path doesn't exist
            writer             = new BinaryWriter(File.Open(path, FileMode.CreateNew));
            uart.CharReceived += WriteChar;
        }
        private void EnableProfilerInMachine(Machine machine)
        {
            var profilerPath = new SequencedFilePath($"{profilerPathPrefix}-{CurrentEmulation[machine]}");

            machine.EnableProfiler(profilerPath);
        }