public void Insert(RecordDescription data) { lock (_recordDescriptions) { _recordDescriptions.Add(data); } }
public void Insert(RecordDescription data) { // RecordDescriptionはNotificationObjectを継承しているので、そのままInsertすると // Livet.WeakEventListenerHolderがunknown sqlce typeと言われてしまう。 // そこで、いったん匿名型に入れ替える必要がある。 DbExecutor.Insert(new SQLiteConnection(_connectionString), "RecordDescriptions", new { data.Title, data.CreatedDateTime, data.TimeSpan, data.NamingName, data.ComponentType, data.PortName, data.DataType, data.SumSize, data.Count, data.IsLittleEndian, data.IndexFileName, data.DataFileName }); }
public Player(RecordDescription desc, string namingName, string portName) { RecordDescription = desc; _namingName = namingName; _portName = portName; AutoActivate = true; EnableLoop = false; IsPlaying = false; IsAlive = false; IsPausing = false; Initialize(); }
public Player(RecordDescription desc, string namingName, string portName) { RecordDescription = desc; _namingName = namingName; _portName = portName; AutoActivate = true; EnableLoop = false; IsPlaying = false; IsAlive = false; IsPausing = false; Initialize(); }
public void キャンセルするテスト() { var description = new RecordDescription() { CreatedDateTime = DateTime.Now, TimeSpan = 17460, NamingName = "localhost:2809/ConsoleIn0.rtc", ComponentType = "ConsoleIn", PortName = "ConsoleIn0.out", DataType = "IDL:RTC/TimedLong:1.0", SumSize = 228, Count = 19, IsLittleEndian = 1, IndexFileName = "TestData002.index", DataFileName = "TestData002.data", }; var player = new Player(description, "127.0.0.1:2809/SampleIn0.rtc", "SampleIn0.in"); player.IsNotNull(); player.IsAlive.Is(true); player.Start(); player.IsAlive.Is(true); player.IsPlaying.Is(true); _observer.Take(3) .Do(x => Console.WriteLine(x[8])) .Timeout(TimeSpan.FromSeconds(30)) .ToEnumerable().ToList(); player.Stop(); player.IsAlive.Is(true); player.IsPlaying.Is(false); }
public bool Initialize() { lock (_lockObject) { if (IsAlive) { return(false); } try { var comp = NamingServiceManager.Default.GetComponent(_namingName); _portService = comp.GetPort(_portName); RecordDescription = new RecordDescription(); RecordDescription.NamingName = _namingName; RecordDescription.ComponentType = comp.get_component_profile().type_name; var prof = _portService.get_port_profile(); Key = _namingName + ":" + prof.name; RecordDescription.PortName = prof.name; RecordDescription.DataType = prof.GetDataType(); IsAlive = true; return(true); } catch (Exception) { IsAlive = false; NotifyError("RTコンポーネントの接続に失敗しました。"); return(false); } } }
// 検索結果が選択されたら通知される public void NotifyAdopt(RecordDescription description) { _notifier(description); Messenger.Raise(new WindowActionMessage("CloseWindow", WindowAction.Close)); }
public void NotifyAdopt(RecordDescription description) { _players.Add(new Player(description, SelectedPort.NamingName, SelectedPort.Name)); }
public SearchResultViewModel(RecordDescription description, Action<RecordDescription> notifier) { _recordDescription = description; _notifier = notifier; }
public void キャストのチェック() { // SQLiteを1.0.76.0にアップデートしたら、IsLittleEndianをlongからboolにキャストしようとしてエラーになった。 // SQLiteではboolは使えない。 dynamic descs = DbExecutor.SelectDynamic( new SQLiteConnection("Data Source=../../TestData/RecordDescriptions.db"), @"select * from RecordDescriptions ").First(); var data = new RecordDescription(); data.ComponentType = descs.ComponentType; data.Count = descs.Count; data.CreatedDateTime = descs.CreatedDateTime; data.DataFileName = descs.DataFileName; data.DataType = descs.DataType; data.IndexFileName = descs.IndexFileName; data.IsLittleEndian = descs.IsLittleEndian; data.NamingName = descs.NamingName; data.PortName = descs.PortName; data.SumSize = descs.SumSize; data.TimeSpan = descs.TimeSpan; data.Title = descs.Title; }
public void Insert(RecordDescription data) { // RecordDescriptionはNotificationObjectを継承しているので、そのままInsertすると // Livet.WeakEventListenerHolderがunknown sqlce typeと言われてしまう。 // そこで、いったん匿名型に入れ替える必要がある。 DbExecutor.Insert(new SQLiteConnection(_connectionString), "RecordDescriptions", new {data.Title, data.CreatedDateTime, data.TimeSpan, data.NamingName, data.ComponentType, data.PortName, data.DataType, data.SumSize, data.Count, data.IsLittleEndian, data.IndexFileName, data.DataFileName }); }
public void 初期化のテスト() { var description = new RecordDescription() { CreatedDateTime = DateTime.Now, TimeSpan = 1661, NamingName = "127.0.0.1:2809/ConsoleOut0.rtc", ComponentType = "SampleOut", PortName = "SampleOut0.out", DataType = "IDL:RTC/TimedLong:1.0", SumSize = 1200, Count = 100, IsLittleEndian = 1, IndexFileName = "TestData001.index", DataFileName = "TestData001.data", }; var player = new Player(description, "127.0.0.1:2809/SampleIn0.rtc", "SampleIn0.in"); player.IsNotNull(); player.IsAlive.Is(true); }
public void ファイルを再生するテスト() { var description = new RecordDescription() { CreatedDateTime = DateTime.Now, TimeSpan = 1661, NamingName = "127.0.0.1:2809/ConsoleOut0.rtc", ComponentType = "SampleOut", PortName = "SampleOut0.out", DataType = "IDL:RTC/TimedLong:1.0", SumSize = 1200, Count = 100, IsLittleEndian = 1, IndexFileName = "TestData001.index", DataFileName = "TestData001.data", }; var player = new Player(description, "127.0.0.1:2809/SampleIn0.rtc", "SampleIn0.in"); player.IsNotNull(); player.IsAlive.Is(true); player.Start(); player.IsAlive.Is(true); // 100回putされるまで待つ。10秒以内に完了しなかったらTimeoutException var data = _observer.Take(100) .Timeout(TimeSpan.FromSeconds(10)) .ToEnumerable().ToList(); data.Count().Is(100); player.Stop(); player.IsAlive.Is(true); }
public void Insert(RecordDescription data) { lock (_recordDescriptions) { _recordDescriptions.Add(data); } }
public void NotifyAdopt(RecordDescription description) { Analyzer = new Analyzer(description); UpdateCommand.Execute(null); }
public Analyzer(RecordDescription description) { _recordDescription = description; PartitionNumber = 10; }
public Analyzer(RecordDescription description) { _recordDescription = description; PartitionNumber = 10; }