From: Vásáry Dániel Date: Thu, 13 Sep 2018 08:17:50 +0000 (+0000) Subject: git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube... X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=72ad75c46822717ba8ed77499c8d1646477cc377;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C31260 --- diff --git a/client/AudioRecorder/AudioRecorder.csproj b/client/AudioRecorder/AudioRecorder.csproj index 631bac36..235a09c1 100644 --- a/client/AudioRecorder/AudioRecorder.csproj +++ b/client/AudioRecorder/AudioRecorder.csproj @@ -195,6 +195,7 @@ + diff --git a/client/AudioRecorder/Configuration/audiorecorder.json b/client/AudioRecorder/Configuration/audiorecorder.json index 32bb81e6..f44fe685 100644 --- a/client/AudioRecorder/Configuration/audiorecorder.json +++ b/client/AudioRecorder/Configuration/audiorecorder.json @@ -20,13 +20,13 @@ "metadatas": [ { "$type": "NativeOctopusMetadata", - "uiFileName": "audiorecorder.en", "server": { - "address": " http://10.10.1.11/api/v1/", - "userName": "mam", - "password": "fPLnV9N5gc7aC9ICvspjzJkGLnTWxAgEhwGOrXilAiD8+/IXviRlNJA0lrZ3ZX+7WG5EE3ZlaIitAhRGk+QIPGEOF3fEJCBJI2I9NN1e2JGi/my3WwXt0fu7dgbMxVid", + "address": " http://10.10.0.30/api/v1/", + "userName": "maestro", + "password": "GS2YlUmEJ1d2M9W4uLXB0OVimdprXHpgDqvUkUPUvhniMLU237kZQOY0pieKyvx0yGpmB1ZuBvoqqLGDSVBmUFNNhp+8CO6yJN4hWNvQJegUZBfINwkHMxKrMXnd9ws0", "timeout": 3000 - } + }, + "uiFileName": "audiorecorder.en" } ] } \ No newline at end of file diff --git a/client/AudioRecorder/MainForm.Designer.cs b/client/AudioRecorder/MainForm.Designer.cs index 74292bb1..af36a0b7 100644 --- a/client/AudioRecorder/MainForm.Designer.cs +++ b/client/AudioRecorder/MainForm.Designer.cs @@ -34,10 +34,11 @@ namespace AudioRecorder { this.pauseButton = new System.Windows.Forms.Button(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.tbVolume = new System.Windows.Forms.TrackBar(); - this.pmVolume = new Ernzo.WinForms.Controls.PeakMeterCtrl(); this.playButton = new System.Windows.Forms.Button(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.txtRecordFilePath = new System.Windows.Forms.TextBox(); + this.panel1 = new System.Windows.Forms.Panel(); + this.pmVolume = new Ernzo.WinForms.Controls.PeakMeterCtrl(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.tbVolume)).BeginInit(); @@ -51,9 +52,9 @@ namespace AudioRecorder { this.recordButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.recordButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.recordButton.Image = ((System.Drawing.Image)(resources.GetObject("recordButton.Image"))); - this.recordButton.Location = new System.Drawing.Point(33, 79); + this.recordButton.Location = new System.Drawing.Point(32, 79); this.recordButton.Name = "recordButton"; - this.recordButton.Size = new System.Drawing.Size(181, 56); + this.recordButton.Size = new System.Drawing.Size(219, 56); this.recordButton.TabIndex = 0; this.recordButton.Text = "Record"; this.recordButton.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; @@ -68,9 +69,9 @@ namespace AudioRecorder { this.stopButton.Enabled = false; this.stopButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.stopButton.Image = ((System.Drawing.Image)(resources.GetObject("stopButton.Image"))); - this.stopButton.Location = new System.Drawing.Point(33, 180); + this.stopButton.Location = new System.Drawing.Point(32, 180); this.stopButton.Name = "stopButton"; - this.stopButton.Size = new System.Drawing.Size(181, 38); + this.stopButton.Size = new System.Drawing.Size(219, 38); this.stopButton.TabIndex = 1; this.stopButton.Text = "Stop "; this.stopButton.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; @@ -83,7 +84,7 @@ namespace AudioRecorder { this.timecodeLabel.Font = new System.Drawing.Font("Calibri", 28F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.timecodeLabel.Location = new System.Drawing.Point(3, 16); this.timecodeLabel.Name = "timecodeLabel"; - this.timecodeLabel.Size = new System.Drawing.Size(241, 46); + this.timecodeLabel.Size = new System.Drawing.Size(278, 46); this.timecodeLabel.TabIndex = 2; this.timecodeLabel.Text = "00:00:00:00"; this.timecodeLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -93,7 +94,7 @@ namespace AudioRecorder { this.btnSelectAudio.BackColor = System.Drawing.Color.White; this.btnSelectAudio.Location = new System.Drawing.Point(9, 19); this.btnSelectAudio.Name = "btnSelectAudio"; - this.btnSelectAudio.Size = new System.Drawing.Size(312, 23); + this.btnSelectAudio.Size = new System.Drawing.Size(352, 23); this.btnSelectAudio.TabIndex = 3; this.btnSelectAudio.Text = "Select audio"; this.btnSelectAudio.UseVisualStyleBackColor = false; @@ -107,7 +108,7 @@ namespace AudioRecorder { this.groupBox1.Controls.Add(this.timecodeLabel); this.groupBox1.Location = new System.Drawing.Point(15, 12); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(247, 240); + this.groupBox1.Size = new System.Drawing.Size(284, 240); this.groupBox1.TabIndex = 5; this.groupBox1.TabStop = false; // @@ -119,9 +120,9 @@ namespace AudioRecorder { this.pauseButton.Enabled = false; this.pauseButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold); this.pauseButton.Image = ((System.Drawing.Image)(resources.GetObject("pauseButton.Image"))); - this.pauseButton.Location = new System.Drawing.Point(33, 142); + this.pauseButton.Location = new System.Drawing.Point(32, 142); this.pauseButton.Name = "pauseButton"; - this.pauseButton.Size = new System.Drawing.Size(181, 32); + this.pauseButton.Size = new System.Drawing.Size(219, 32); this.pauseButton.TabIndex = 3; this.pauseButton.Text = "Pause "; this.pauseButton.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; @@ -132,7 +133,7 @@ namespace AudioRecorder { // this.groupBox2.Controls.Add(this.tbVolume); this.groupBox2.Controls.Add(this.pmVolume); - this.groupBox2.Location = new System.Drawing.Point(272, 12); + this.groupBox2.Location = new System.Drawing.Point(308, 12); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(75, 240); this.groupBox2.TabIndex = 6; @@ -152,24 +153,6 @@ namespace AudioRecorder { this.tbVolume.TickStyle = System.Windows.Forms.TickStyle.Both; this.tbVolume.ValueChanged += new System.EventHandler(this.OnVolumeChanged); // - // pmVolume - // - this.pmVolume.BandsCount = 1; - this.pmVolume.ColorHigh = System.Drawing.Color.Red; - this.pmVolume.ColorHighBack = System.Drawing.Color.White; - this.pmVolume.ColorMedium = System.Drawing.Color.Yellow; - this.pmVolume.ColorMediumBack = System.Drawing.Color.White; - this.pmVolume.ColorNormal = System.Drawing.Color.Green; - this.pmVolume.ColorNormalBack = System.Drawing.Color.White; - this.pmVolume.FalloffColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(180)))), ((int)(((byte)(180))))); - this.pmVolume.GridColor = System.Drawing.Color.Gainsboro; - this.pmVolume.LEDCount = 17; - this.pmVolume.Location = new System.Drawing.Point(6, 19); - this.pmVolume.Name = "pmVolume"; - this.pmVolume.Size = new System.Drawing.Size(15, 207); - this.pmVolume.TabIndex = 12; - this.pmVolume.Text = "pmVolume"; - // // playButton // this.playButton.BackColor = System.Drawing.Color.White; @@ -178,7 +161,7 @@ namespace AudioRecorder { this.playButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.playButton.Image = ((System.Drawing.Image)(resources.GetObject("playButton.Image"))); this.playButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.playButton.Location = new System.Drawing.Point(250, 46); + this.playButton.Location = new System.Drawing.Point(290, 46); this.playButton.Name = "playButton"; this.playButton.Size = new System.Drawing.Size(71, 23); this.playButton.TabIndex = 9; @@ -194,7 +177,7 @@ namespace AudioRecorder { this.groupBox3.Controls.Add(this.playButton); this.groupBox3.Location = new System.Drawing.Point(15, 258); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(332, 80); + this.groupBox3.Size = new System.Drawing.Size(367, 80); this.groupBox3.TabIndex = 10; this.groupBox3.TabStop = false; // @@ -203,15 +186,44 @@ namespace AudioRecorder { this.txtRecordFilePath.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.txtRecordFilePath.Location = new System.Drawing.Point(10, 46); this.txtRecordFilePath.Name = "txtRecordFilePath"; - this.txtRecordFilePath.Size = new System.Drawing.Size(233, 23); + this.txtRecordFilePath.Size = new System.Drawing.Size(274, 23); this.txtRecordFilePath.TabIndex = 10; // + // panel1 + // + this.panel1.BackgroundImage = global::AudioRecorder.Properties.Resources.bs_user_logo; + this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.panel1.Location = new System.Drawing.Point(0, 344); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(399, 55); + this.panel1.TabIndex = 11; + // + // pmVolume + // + this.pmVolume.BandsCount = 1; + this.pmVolume.ColorHigh = System.Drawing.Color.Red; + this.pmVolume.ColorHighBack = System.Drawing.Color.White; + this.pmVolume.ColorMedium = System.Drawing.Color.Yellow; + this.pmVolume.ColorMediumBack = System.Drawing.Color.White; + this.pmVolume.ColorNormal = System.Drawing.Color.Green; + this.pmVolume.ColorNormalBack = System.Drawing.Color.White; + this.pmVolume.FalloffColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(180)))), ((int)(((byte)(180))))); + this.pmVolume.GridColor = System.Drawing.Color.Gainsboro; + this.pmVolume.LEDCount = 17; + this.pmVolume.Location = new System.Drawing.Point(6, 19); + this.pmVolume.Name = "pmVolume"; + this.pmVolume.Size = new System.Drawing.Size(15, 207); + this.pmVolume.TabIndex = 12; + this.pmVolume.Text = "pmVolume"; + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.White; - this.ClientSize = new System.Drawing.Size(363, 352); + this.ClientSize = new System.Drawing.Size(399, 399); + this.Controls.Add(this.panel1); this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); @@ -248,6 +260,7 @@ namespace AudioRecorder { private Ernzo.WinForms.Controls.PeakMeterCtrl pmVolume; private System.Windows.Forms.TrackBar tbVolume; private System.Windows.Forms.TextBox txtRecordFilePath; + private System.Windows.Forms.Panel panel1; } } diff --git a/client/AudioRecorder/Program.cs b/client/AudioRecorder/Program.cs index 5b168483..84a7a7f0 100644 --- a/client/AudioRecorder/Program.cs +++ b/client/AudioRecorder/Program.cs @@ -1,6 +1,5 @@ using MaestroShared.Configuration; using System; -using System.Collections.Generic; using System.Windows.Forms; namespace AudioRecorder { diff --git a/client/AudioRecorder/Properties/Resources.Designer.cs b/client/AudioRecorder/Properties/Resources.Designer.cs index d543edb0..fc729285 100644 --- a/client/AudioRecorder/Properties/Resources.Designer.cs +++ b/client/AudioRecorder/Properties/Resources.Designer.cs @@ -60,6 +60,16 @@ namespace AudioRecorder.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap bs_user_logo { + get { + object obj = ResourceManager.GetObject("bs-user-logo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized string similar to Mégsem. /// diff --git a/client/AudioRecorder/Properties/Resources.resx b/client/AudioRecorder/Properties/Resources.resx index a03ecf13..7f9af991 100644 --- a/client/AudioRecorder/Properties/Resources.resx +++ b/client/AudioRecorder/Properties/Resources.resx @@ -117,23 +117,23 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Felvétel + + + Lejátszás + Mégsem - - Válasszon mikrofont - Rendben Szunet - - Lejátszás - - - Felvétel + + Válasszon mikrofont Azonosító kiválasztása @@ -141,4 +141,8 @@ Leállítás + + + ..\Resources\bs-user-logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/client/AudioRecorder/Resources/bs-user-logo.png b/client/AudioRecorder/Resources/bs-user-logo.png new file mode 100644 index 00000000..50e8075d Binary files /dev/null and b/client/AudioRecorder/Resources/bs-user-logo.png differ diff --git a/client/DxPlay/Configuration/dxplay - Copy.json b/client/DxPlay/Configuration/dxplay - Copy.json new file mode 100644 index 00000000..cc6f5e6a --- /dev/null +++ b/client/DxPlay/Configuration/dxplay - Copy.json @@ -0,0 +1,19 @@ +{ + "targetDirectory": "DONE", + "uiFileName": "dxplay.en", + "isMaximized": true, + "player": { + "autoStart": false, + "segmentEditor": true + }, + "metadata": { + "$type": "TrafficMetadata", + "uiFileName": "dxplay.en", + "server": { + "address": "Data Source=10.10.1.45;Initial Catalog=PA_Echo;Persist Security Info=True;", + "userName": "MAM", + "password": "7RKZYBzumKjL40SJwuwiFCvX57xuCN8zay6OttUm2wbrgImyYZBHyZTUUYrXX31Ge2Uwew07HYsqh2uzdJeDBDwcVntxaHg3nIpv9Dyq/odVoiC4tUF/K+lgvKWANcrZ", + "timeout": 10000 + } + } +} diff --git a/client/DxPlay/Configuration/dxplay.json b/client/DxPlay/Configuration/dxplay.json index 921bee09..0bb643a1 100644 --- a/client/DxPlay/Configuration/dxplay.json +++ b/client/DxPlay/Configuration/dxplay.json @@ -9,11 +9,12 @@ "metadata": { "$type": "TrafficMetadata", "uiFileName": "dxplay.en", + "functionName": "dbo.clIFsp_KRCS_MAM", "server": { - "address": "Data Source=10.10.1.45;Initial Catalog=PA_Echo;Persist Security Info=True;", - "userName": "MAM", - "password": "7RKZYBzumKjL40SJwuwiFCvX57xuCN8zay6OttUm2wbrgImyYZBHyZTUUYrXX31Ge2Uwew07HYsqh2uzdJeDBDwcVntxaHg3nIpv9Dyq/odVoiC4tUF/K+lgvKWANcrZ", - "timeout": 1000 + "address": "Data Source=10.101.0.45;Initial Catalog=PA_KRCS;Persist Security Info=True;", + "userName": "mediacube", + "password": "znCf1a/nDdf2YnUe9s9QjNdMQKygO1ELTypS/MkLs9ZnX9kPcYxoibZptO8Lmpem0Mj5YWWjsgMYTNIQJ80qD5DtsWNSEIwkje+lQkpmNpzKVLO3nZS4KrmyhX5QfqT+", + "timeout": 10000 } } } diff --git a/client/DxPlay/Controls/PlayerControls.Designer.cs b/client/DxPlay/Controls/PlayerControls.Designer.cs index 6d68cf44..f0bf4b9c 100644 --- a/client/DxPlay/Controls/PlayerControls.Designer.cs +++ b/client/DxPlay/Controls/PlayerControls.Designer.cs @@ -185,13 +185,16 @@ // buttonsPanel // this.buttonsPanel.AutoSize = true; + this.buttonsPanel.BackgroundImage = global::DxPlay.Properties.Resources.bs_user_logo; + this.buttonsPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.buttonsPanel.Controls.Add(this.btnPlay); this.buttonsPanel.Controls.Add(this.btnStop); this.buttonsPanel.Controls.Add(this.btnPause); + this.buttonsPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.buttonsPanel.Location = new System.Drawing.Point(0, 56); this.buttonsPanel.Margin = new System.Windows.Forms.Padding(0); this.buttonsPanel.Name = "buttonsPanel"; - this.buttonsPanel.Size = new System.Drawing.Size(180, 60); + this.buttonsPanel.Size = new System.Drawing.Size(835, 60); this.buttonsPanel.TabIndex = 20; // // btnPlay diff --git a/client/DxPlay/DxPlay.csproj b/client/DxPlay/DxPlay.csproj index 2816111a..7f66a192 100644 --- a/client/DxPlay/DxPlay.csproj +++ b/client/DxPlay/DxPlay.csproj @@ -235,6 +235,10 @@ + + Always + + Always diff --git a/client/DxPlay/PlayerForm.Designer.cs b/client/DxPlay/PlayerForm.Designer.cs index 5034f1de..638a315a 100644 --- a/client/DxPlay/PlayerForm.Designer.cs +++ b/client/DxPlay/PlayerForm.Designer.cs @@ -37,7 +37,6 @@ namespace DxPlay { this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tabEditor = new System.Windows.Forms.TabControl(); this.tpMetadata = new System.Windows.Forms.TabPage(); - this.trafficBrowser = new TrafficClient.TrafficIDSelector(); this.tpSegments = new System.Windows.Forms.TabPage(); this.dgSegments = new System.Windows.Forms.DataGridView(); this.bsSegments = new System.Windows.Forms.BindingSource(this.components); @@ -50,13 +49,14 @@ namespace DxPlay { this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.tbDeleteSegment = new System.Windows.Forms.ToolStripButton(); this.imagesTabEdit = new System.Windows.Forms.ImageList(this.components); - this.btnToggleSegmentEditor = new MaestroShared.Controls.NoFocusCueButton(); this.pMetadataDisplay = new System.Windows.Forms.TableLayoutPanel(); - this.btnApprove = new MaestroShared.Controls.NoFocusCueButton(); this.labelSelectedMetadata = new System.Windows.Forms.Label(); this.txtSelectedID = new System.Windows.Forms.TextBox(); this.mainMenu = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.trafficBrowser = new TrafficClient.TrafficIDSelector(); + this.btnToggleSegmentEditor = new MaestroShared.Controls.NoFocusCueButton(); + this.btnApprove = new MaestroShared.Controls.NoFocusCueButton(); this.menuOpenFile = new DxPlay.Controls.BindableToolStripMenuItem(); this.menuApprove = new DxPlay.Controls.BindableToolStripMenuItem(); this.playerControls = new DxPlay.Controls.PlayerControls(); @@ -79,6 +79,7 @@ namespace DxPlay { // pVideo // this.pVideo.BackColor = System.Drawing.Color.Black; + this.pVideo.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.pVideo.Dock = System.Windows.Forms.DockStyle.Fill; this.pVideo.Location = new System.Drawing.Point(0, 0); this.pVideo.Name = "pVideo"; @@ -164,17 +165,6 @@ namespace DxPlay { this.tpMetadata.TabIndex = 0; this.tpMetadata.Text = "Metadata"; // - // trafficBrowser - // - this.trafficBrowser.BackColor = System.Drawing.Color.White; - this.trafficBrowser.Dock = System.Windows.Forms.DockStyle.Fill; - this.trafficBrowser.IDChangedEvent = null; - this.trafficBrowser.Location = new System.Drawing.Point(3, 3); - this.trafficBrowser.Margin = new System.Windows.Forms.Padding(0); - this.trafficBrowser.Name = "trafficBrowser"; - this.trafficBrowser.Size = new System.Drawing.Size(278, 371); - this.trafficBrowser.TabIndex = 0; - // // tpSegments // this.tpSegments.Controls.Add(this.dgSegments); @@ -184,7 +174,7 @@ namespace DxPlay { this.tpSegments.Location = new System.Drawing.Point(4, 4); this.tpSegments.Name = "tpSegments"; this.tpSegments.Padding = new System.Windows.Forms.Padding(3); - this.tpSegments.Size = new System.Drawing.Size(192, 30); + this.tpSegments.Size = new System.Drawing.Size(284, 377); this.tpSegments.TabIndex = 1; this.tpSegments.Text = "Segments"; this.tpSegments.UseVisualStyleBackColor = true; @@ -214,7 +204,7 @@ namespace DxPlay { this.dgSegments.Name = "dgSegments"; this.dgSegments.RowHeadersVisible = false; this.dgSegments.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dgSegments.Size = new System.Drawing.Size(186, 0); + this.dgSegments.Size = new System.Drawing.Size(278, 346); this.dgSegments.TabIndex = 1; this.dgSegments.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgSegments_CellContentClick); this.dgSegments.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgSegments_CellMouseDoubleClick); @@ -235,7 +225,7 @@ namespace DxPlay { this.segmentActions.Location = new System.Drawing.Point(3, 3); this.segmentActions.Name = "segmentActions"; this.segmentActions.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; - this.segmentActions.Size = new System.Drawing.Size(186, 25); + this.segmentActions.Size = new System.Drawing.Size(278, 25); this.segmentActions.TabIndex = 0; this.segmentActions.Text = "toolStrip1"; // @@ -311,22 +301,6 @@ namespace DxPlay { this.imagesTabEdit.Images.SetKeyName(0, "round_publish_black_24dp.png"); this.imagesTabEdit.Images.SetKeyName(1, "ic_playlist_add_check_black_24dp_1x.png"); // - // btnToggleSegmentEditor - // - this.btnToggleSegmentEditor.BackColor = System.Drawing.Color.White; - this.btnToggleSegmentEditor.FlatAppearance.BorderSize = 0; - this.btnToggleSegmentEditor.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnToggleSegmentEditor.Image = ((System.Drawing.Image)(resources.GetObject("btnToggleSegmentEditor.Image"))); - this.btnToggleSegmentEditor.Location = new System.Drawing.Point(0, 4); - this.btnToggleSegmentEditor.Margin = new System.Windows.Forms.Padding(0, 4, 0, 0); - this.btnToggleSegmentEditor.Name = "btnToggleSegmentEditor"; - this.btnToggleSegmentEditor.Size = new System.Drawing.Size(23, 63); - this.btnToggleSegmentEditor.TabIndex = 0; - this.btnToggleSegmentEditor.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; - this.btnToggleSegmentEditor.UseVisualStyleBackColor = false; - this.btnToggleSegmentEditor.Visible = false; - this.btnToggleSegmentEditor.Click += new System.EventHandler(this.OnToggleSegmentEditor); - // // pMetadataDisplay // this.pMetadataDisplay.AutoSize = true; @@ -346,24 +320,6 @@ namespace DxPlay { this.pMetadataDisplay.Size = new System.Drawing.Size(319, 63); this.pMetadataDisplay.TabIndex = 5; // - // btnApprove - // - this.btnApprove.AutoSize = true; - this.btnApprove.BackColor = System.Drawing.Color.White; - this.btnApprove.FlatAppearance.BorderSize = 0; - this.btnApprove.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnApprove.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.btnApprove.Image = ((System.Drawing.Image)(resources.GetObject("btnApprove.Image"))); - this.btnApprove.Location = new System.Drawing.Point(217, 29); - this.btnApprove.Margin = new System.Windows.Forms.Padding(0, 4, 0, 0); - this.btnApprove.Name = "btnApprove"; - this.btnApprove.Size = new System.Drawing.Size(102, 30); - this.btnApprove.TabIndex = 17; - this.btnApprove.Text = "Approve"; - this.btnApprove.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; - this.btnApprove.UseVisualStyleBackColor = false; - this.btnApprove.Click += new System.EventHandler(this.OnApprove); - // // labelSelectedMetadata // this.labelSelectedMetadata.AutoSize = true; @@ -408,6 +364,51 @@ namespace DxPlay { this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Text = "File"; // + // trafficBrowser + // + this.trafficBrowser.BackColor = System.Drawing.Color.White; + this.trafficBrowser.Dock = System.Windows.Forms.DockStyle.Fill; + this.trafficBrowser.IDChangedEvent = null; + this.trafficBrowser.Location = new System.Drawing.Point(3, 3); + this.trafficBrowser.Margin = new System.Windows.Forms.Padding(0); + this.trafficBrowser.Name = "trafficBrowser"; + this.trafficBrowser.Size = new System.Drawing.Size(278, 371); + this.trafficBrowser.TabIndex = 0; + // + // btnToggleSegmentEditor + // + this.btnToggleSegmentEditor.BackColor = System.Drawing.Color.White; + this.btnToggleSegmentEditor.FlatAppearance.BorderSize = 0; + this.btnToggleSegmentEditor.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnToggleSegmentEditor.Image = ((System.Drawing.Image)(resources.GetObject("btnToggleSegmentEditor.Image"))); + this.btnToggleSegmentEditor.Location = new System.Drawing.Point(0, 4); + this.btnToggleSegmentEditor.Margin = new System.Windows.Forms.Padding(0, 4, 0, 0); + this.btnToggleSegmentEditor.Name = "btnToggleSegmentEditor"; + this.btnToggleSegmentEditor.Size = new System.Drawing.Size(23, 63); + this.btnToggleSegmentEditor.TabIndex = 0; + this.btnToggleSegmentEditor.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; + this.btnToggleSegmentEditor.UseVisualStyleBackColor = false; + this.btnToggleSegmentEditor.Visible = false; + this.btnToggleSegmentEditor.Click += new System.EventHandler(this.OnToggleSegmentEditor); + // + // btnApprove + // + this.btnApprove.AutoSize = true; + this.btnApprove.BackColor = System.Drawing.Color.White; + this.btnApprove.FlatAppearance.BorderSize = 0; + this.btnApprove.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnApprove.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.btnApprove.Image = ((System.Drawing.Image)(resources.GetObject("btnApprove.Image"))); + this.btnApprove.Location = new System.Drawing.Point(217, 29); + this.btnApprove.Margin = new System.Windows.Forms.Padding(0, 4, 0, 0); + this.btnApprove.Name = "btnApprove"; + this.btnApprove.Size = new System.Drawing.Size(102, 30); + this.btnApprove.TabIndex = 17; + this.btnApprove.Text = "Approve"; + this.btnApprove.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; + this.btnApprove.UseVisualStyleBackColor = false; + this.btnApprove.Click += new System.EventHandler(this.OnApprove); + // // menuOpenFile // this.menuOpenFile.Name = "menuOpenFile"; @@ -427,6 +428,8 @@ namespace DxPlay { // playerControls // this.playerControls.AutoSize = true; + this.playerControls.BackColor = System.Drawing.Color.Transparent; + this.playerControls.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.playerControls.Dock = System.Windows.Forms.DockStyle.Bottom; this.playerControls.Location = new System.Drawing.Point(0, 513); this.playerControls.Margin = new System.Windows.Forms.Padding(0); diff --git a/client/DxPlay/PlayerForm.cs b/client/DxPlay/PlayerForm.cs index c70f627d..02d5f39b 100644 --- a/client/DxPlay/PlayerForm.cs +++ b/client/DxPlay/PlayerForm.cs @@ -7,6 +7,8 @@ using NLog; using DxPlay.Model; using MaestroShared.Commons; using DxPlay.Properties; +using System.Diagnostics; +using System.Runtime.InteropServices; namespace DxPlay { @@ -288,10 +290,29 @@ namespace DxPlay { e.SuppressKeyPress = true; } } + public static bool ApplicationIsActivated() { + var activatedHandle = GetForegroundWindow(); + if (activatedHandle == IntPtr.Zero) { + return false; // No window is currently activated + } + + var procId = Process.GetCurrentProcess().Id; + int activeProcId; + GetWindowThreadProcessId(activatedHandle, out activeProcId); + + return activeProcId == procId; + } + + + [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)] + private static extern IntPtr GetForegroundWindow(); + + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] + private static extern int GetWindowThreadProcessId(IntPtr handle, out int processId); private bool HandleHotKey(Keys keyCode) { logger.Debug("Key pressed " + keyCode); - if (trafficBrowser.ContainsFocus || openFileDialogOpened || dgSegments.IsCurrentCellInEditMode || (m_play != null && !m_play.IsFullscreen() && !ContainsFocus)) + if (!ApplicationIsActivated() || trafficBrowser.ContainsFocus || openFileDialogOpened || dgSegments.IsCurrentCellInEditMode || (m_play != null && !m_play.IsFullscreen() && !ContainsFocus)) return true; logger.Debug("Handling " + keyCode); bool result = false; diff --git a/client/DxPlay/PlayerForm.resx b/client/DxPlay/PlayerForm.resx index 48f49eaf..101f0fd0 100644 --- a/client/DxPlay/PlayerForm.resx +++ b/client/DxPlay/PlayerForm.resx @@ -173,7 +173,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABo - CAAAAk1TRnQBSQFMAgEBAgEAAVABAQFQAQEBGAEAARgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CAAAAk1TRnQBSQFMAgEBAgEAAWgBAQFoAQEBGAEAARgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABYAMAARgDAAEBAQABCAYAAQkYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/client/DxPlay/PlayerGraph.cs b/client/DxPlay/PlayerGraph.cs index ab23c592..cd9c2e92 100644 --- a/client/DxPlay/PlayerGraph.cs +++ b/client/DxPlay/PlayerGraph.cs @@ -72,8 +72,23 @@ namespace DxPlay { logger.Debug("Add VideoMixingRenderer9 to graph"); IBaseFilter videoRenderer = (IBaseFilter)new VideoMixingRenderer9(); DsError.ThrowExceptionForHR(graphBuilder.AddFilter(videoRenderer, "Video Mixing Renderer 9")); - logger.Debug("Connect SampleGrabber -> VideoMixingRenderer9"); + + try { + FilterGraphTools.ConnectFilters(graphBuilder, sampleGrabber, "Output", videoRenderer, "VMR Input0", true); + } catch (Exception e) { + logger.Error(e); + graphBuilder.RemoveFilter(videoRenderer); + logger.Info("Trying default VideoRenderer instead Video Mixing Renderer 9"); + AddSimpleRenderer(graphBuilder, sampleGrabber); + } + return videoRenderer; + } + + private IBaseFilter AddSimpleRenderer(IGraphBuilder graphBuilder, IBaseFilter sampleGrabber) { + logger.Debug("Add default VideoRenderer to graph"); + IBaseFilter videoRenderer = (IBaseFilter)new VideoRendererDefault(); + DsError.ThrowExceptionForHR(graphBuilder.AddFilter(videoRenderer, "VideoRendererDefault")); FilterGraphTools.ConnectFilters(graphBuilder, sampleGrabber, "Output", videoRenderer, "VMR Input0", true); return videoRenderer; } diff --git a/client/DxPlay/Properties/Resources.Designer.cs b/client/DxPlay/Properties/Resources.Designer.cs index ae4b1094..c682d60c 100644 --- a/client/DxPlay/Properties/Resources.Designer.cs +++ b/client/DxPlay/Properties/Resources.Designer.cs @@ -69,6 +69,16 @@ namespace DxPlay.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap bs_user_logo { + get { + object obj = ResourceManager.GetObject("bs-user-logo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized string similar to Megjegyzés. /// diff --git a/client/DxPlay/Properties/Resources.resx b/client/DxPlay/Properties/Resources.resx index 8df717b3..76f6644a 100644 --- a/client/DxPlay/Properties/Resources.resx +++ b/client/DxPlay/Properties/Resources.resx @@ -117,110 +117,113 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + A kilépő nem lehet a belépő előtt. + Aktuális pozíció belépőként - - Aktuális pozíció kilépőként - - - Belépő - - - Elhagyható - - - Nem tudok kapcsolódni a PlanAir rendszerhez ezen az útvonalon: {0} - - - Hossz - - - - ..\resources\ic_pause_black_24dp_2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + NINCS BEMENET - - ..\resources\ic_play_arrow_black_24dp_2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Kilépés - - ..\resources\ic_stop_black_24dp_2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Metaadat Kezdés - - Kilépés - - - Kilépő - Leállítás - - Lejátszás + + Hossz - - ..\resources\lgs.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Kész - - Megállítva + + Szegmensek - - Megjegyzés + + Elhagyható Nem található a PlanAir rendszer kapcsolódási információja a dxplay.json állományban. - - Nem található az {0} azonosító a PlanAir rendszerben. + + + ..\resources\lgs.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - NINCS BEMENET + + Szünet - - Szegmensek + + Nem tudok kapcsolódni a PlanAir rendszerhez ezen az útvonalon: {0} Szegmens definiálása - - Szegmens szétvágása + + Megjegyzés - - Szegmens törlése + + ..\resources\ic_play_arrow_black_24dp_2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Szünet + + Lejátszás - - Szüneteltetett + + A szegmensek között nem lehet átfedés. + + + Megállítva Vége - + + Szüneteltetett + + + Aktuális pozíció kilépőként + + Lejátszás - - Metaadat + + Belépő - - Kész + + ..\resources\ic_stop_black_24dp_2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Megnyitás + + Nem található az {0} azonosító a PlanAir rendszerben. Az utolsó szegmens az anyag végéig tart, így nem hozható létre új szegmens. + + Szegmens szétvágása + + + Kilépő + + + ..\resources\ic_pause_black_24dp_2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Szegmens törlése + + + Megnyitás + A belépő nem lehet a kilépő után. - - A kilépő nem lehet a belépő előtt. - - - A szegmensek között nem lehet átfedés. + + ..\Resources\bs-user-logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/client/DxPlay/Resources/bs-user-logo.png b/client/DxPlay/Resources/bs-user-logo.png new file mode 100644 index 00000000..50e8075d Binary files /dev/null and b/client/DxPlay/Resources/bs-user-logo.png differ diff --git a/client/IntegrationTests/PlanAIRTests.cs b/client/IntegrationTests/PlanAIRTests.cs index 3999eb5f..ee326400 100644 --- a/client/IntegrationTests/PlanAIRTests.cs +++ b/client/IntegrationTests/PlanAIRTests.cs @@ -19,7 +19,7 @@ namespace IntegrationTests { [TestInitialize] public void initialize() { - sut = new TrafficAPI(CONNECTION_STRING, USER_NAME, PASSWORD, TIMEOUT, null); + sut = new TrafficAPI(CONNECTION_STRING, USER_NAME, PASSWORD, TIMEOUT, null, null); } [TestMethod] diff --git a/client/MaestroShared/Configuration/ConfigurationInfo.cs b/client/MaestroShared/Configuration/ConfigurationInfo.cs index 1b46ebd5..00e5f631 100644 --- a/client/MaestroShared/Configuration/ConfigurationInfo.cs +++ b/client/MaestroShared/Configuration/ConfigurationInfo.cs @@ -183,6 +183,8 @@ namespace MaestroShared.Configuration { public class TrafficMetadata : MetadataProvider { public ProjectSettings ProjectSettings { get; set; } + public string FunctionName { get; set; } + } public class MediaCubeMetadata : MetadataProvider { diff --git a/client/MaestroShared/Metadata/MetadataType.cs b/client/MaestroShared/Metadata/MetadataType.cs index f5bf35c1..42627eb1 100644 --- a/client/MaestroShared/Metadata/MetadataType.cs +++ b/client/MaestroShared/Metadata/MetadataType.cs @@ -9,6 +9,7 @@ namespace MaestroShared.Metadata { public class MetadataTypeUtil { private const string REGEXP_TRAFFICMATERIALID = "^M{1}[0-9]{6}[A-Z]{1}$"; private const string REGEXP_TRAFFICADID = "^R{1}[0-9]{6}[A-Z]{1}$"; + private const string REGEXP_TRAFFICALTERNATEADID = "^C{1}[0-9]{6}[A-Z]{1}$"; private const string REGEXP_TRAFFICPROMOID = "^P{1}[0-9]{6}[A-Z]{1}$"; private const string REGEXP_OCTOPUSSTORYID = "^[0-9]+$"; private const string REGEXP_OCTOPUSPLACEHOLDERID = "^[0-9]+_[0-9]+$"; @@ -31,6 +32,10 @@ namespace MaestroShared.Metadata { if (match.Success) return MetadataType.TrafficAD; + match = Regex.Match(id, REGEXP_TRAFFICALTERNATEADID); + if (match.Success) + return MetadataType.TrafficAD; + match = Regex.Match(id, REGEXP_OCTOPUSSTORYID); if (match.Success) return MetadataType.OctopusStory; diff --git a/client/PlanAIRClient/TrafficAPI.cs b/client/PlanAIRClient/TrafficAPI.cs index 17e3fb33..903f8fd7 100644 --- a/client/PlanAIRClient/TrafficAPI.cs +++ b/client/PlanAIRClient/TrafficAPI.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Data; using System.Data.SqlClient; using NLog; using TrafficClient.Workers; @@ -18,16 +17,18 @@ namespace TrafficClient { private PromoWorker promoWorker; private ADWorker adWorker; private SegmentWorker segmentWorker; + private readonly string functionName; - public TrafficAPI(string connString, string user, string password, int timeout, IMessageBus messageBus) { + public TrafficAPI(string connString, string user, string password, int timeout, string functionName, IMessageBus messageBus) { var correctedTimeout = timeout < 1000 ? 1000 : timeout; connectionString = String.Format("{0};User ID={1};Password={2};Connection Timeout={3}", connString, user, password, correctedTimeout / 1000); connection = new SqlConnection(connectionString); cliFSPReader = new CliFSPReader(); - materialWorker = new MaterialWorker(connection, cliFSPReader, messageBus); - promoWorker = new PromoWorker(connection, cliFSPReader, messageBus); - adWorker = new ADWorker(connection, cliFSPReader, messageBus); - segmentWorker = new SegmentWorker(connection, cliFSPReader, messageBus); + materialWorker = new MaterialWorker(connection, cliFSPReader, functionName, messageBus); + promoWorker = new PromoWorker(connection, cliFSPReader, functionName, messageBus); + adWorker = new ADWorker(connection, cliFSPReader, functionName, messageBus); + segmentWorker = new SegmentWorker(connection, cliFSPReader, functionName, messageBus); + this.functionName = functionName; } public List GetMaterials(string strParam, bool problematic, DateTime? from = null, DateTime? to = null) { diff --git a/client/PlanAIRClient/TrafficIDSelector.cs b/client/PlanAIRClient/TrafficIDSelector.cs index d292e904..391782fb 100644 --- a/client/PlanAIRClient/TrafficIDSelector.cs +++ b/client/PlanAIRClient/TrafficIDSelector.cs @@ -43,7 +43,7 @@ namespace TrafficClient { parameters = value; var server = parameters.Configuration?.Server; if (server != null && server.Address != null) - trafficAPI = new TrafficAPI(server.Address.OriginalString, server.UserName, server.Password, server.Timeout, value.MessageBus); + trafficAPI = new TrafficAPI(server.Address.OriginalString, server.UserName, server.Password, server.Timeout, parameters.Configuration?.FunctionName, value.MessageBus); RefreshResults(); } } diff --git a/client/PlanAIRClient/Workers/ADWorker.cs b/client/PlanAIRClient/Workers/ADWorker.cs index e47cc2b7..40498b50 100644 --- a/client/PlanAIRClient/Workers/ADWorker.cs +++ b/client/PlanAIRClient/Workers/ADWorker.cs @@ -10,8 +10,8 @@ namespace TrafficClient.Workers { private static Logger logger = LogManager.GetCurrentClassLogger(); - public ADWorker(SqlConnection connection, CliFSPReader cliFSPReader, IMessageBus messageBus) : - base(connection, cliFSPReader, messageBus) { + public ADWorker(SqlConnection connection, CliFSPReader cliFSPReader, string functionName, IMessageBus messageBus) : + base(connection, cliFSPReader, functionName, messageBus) { } private TrafficItem ToTrafficItem(clIFsp_EC_MAMAdvertismentResult data) { @@ -36,7 +36,7 @@ namespace TrafficClient.Workers { List result = null; try { TryConnect(); - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { cmd.CommandType = CommandType.StoredProcedure; //cmd.Parameters.AddWithValue("@Operation", 3001); cmd.Parameters.AddWithValue("@Operation", 3002); @@ -83,7 +83,7 @@ namespace TrafficClient.Workers { try { TryConnect(); int options = ok ? 1 : 0; - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Operation", 3100); cmd.Parameters.AddWithValue("@@ItemID", itemID); @@ -105,7 +105,7 @@ namespace TrafficClient.Workers { List result = null; try { TryConnect(); - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Operation", 3001); cmd.Parameters.AddWithValue("@@@Options", 0); diff --git a/client/PlanAIRClient/Workers/MaterialWorker.cs b/client/PlanAIRClient/Workers/MaterialWorker.cs index 3c516c76..9b1f19b9 100644 --- a/client/PlanAIRClient/Workers/MaterialWorker.cs +++ b/client/PlanAIRClient/Workers/MaterialWorker.cs @@ -11,8 +11,8 @@ namespace TrafficClient.Workers { private static Logger logger = LogManager.GetCurrentClassLogger(); - public MaterialWorker(SqlConnection connection, CliFSPReader cliFSPReader, IMessageBus messageBus) - : base(connection, cliFSPReader, messageBus) { + public MaterialWorker(SqlConnection connection, CliFSPReader cliFSPReader, string functionName, IMessageBus messageBus) + : base(connection, cliFSPReader, functionName, messageBus) { } private TrafficItem ToTrafficItem(clIFsp_EC_MAMBradocastResult data) { @@ -46,7 +46,7 @@ namespace TrafficClient.Workers { List result = null; try { TryConnect(); - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Operation", 1002); if (problematic) @@ -86,7 +86,7 @@ namespace TrafficClient.Workers { List result = null; try { TryConnect(); - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Operation", 1002); cmd.Parameters.AddWithValue("@@@Options", 0); @@ -116,7 +116,7 @@ namespace TrafficClient.Workers { TrafficVersion result = null; try { TryConnect(); - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Operation", 1105); cmd.Parameters.AddWithValue("@@@Options", DBNull.Value); @@ -150,7 +150,7 @@ namespace TrafficClient.Workers { try { TryConnect(); int options = ok ? 1 : 0; - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Operation", 1100); cmd.Parameters.AddWithValue("@@ItemID", itemID); diff --git a/client/PlanAIRClient/Workers/PromoWorker.cs b/client/PlanAIRClient/Workers/PromoWorker.cs index fc9161a4..4fa6b06c 100644 --- a/client/PlanAIRClient/Workers/PromoWorker.cs +++ b/client/PlanAIRClient/Workers/PromoWorker.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using NLog; -using System.Drawing; using System.Diagnostics; using LinkDotNet.MessageHandling.Contracts; @@ -12,8 +11,8 @@ namespace TrafficClient.Workers { private static Logger logger = LogManager.GetCurrentClassLogger(); - public PromoWorker(SqlConnection connection, CliFSPReader cliFSPReader, IMessageBus messageBus) - : base(connection, cliFSPReader, messageBus) { + public PromoWorker(SqlConnection connection, CliFSPReader cliFSPReader, string functionName, IMessageBus messageBus) + : base(connection, cliFSPReader, functionName, messageBus) { } private TrafficItem ToTrafficItem(clIFsp_EC_MAMPromotionalResult data) { @@ -42,7 +41,7 @@ namespace TrafficClient.Workers { List result = null; try { TryConnect(); - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { cmd.CommandType = CommandType.StoredProcedure; //cmd.Parameters.AddWithValue("@Operation", 2001); cmd.Parameters.AddWithValue("@Operation", 2002); @@ -80,7 +79,7 @@ namespace TrafficClient.Workers { try { TryConnect(); int options = ok ? 1 : 0; - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Operation", 2100); cmd.Parameters.AddWithValue("@@ItemID", itemID); @@ -102,7 +101,7 @@ namespace TrafficClient.Workers { List result = null; try { TryConnect(); - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Operation", 2002); cmd.Parameters.AddWithValue("@@@Options", 0); diff --git a/client/PlanAIRClient/Workers/SegmentWorker.cs b/client/PlanAIRClient/Workers/SegmentWorker.cs index b986d1f3..8bc4c994 100644 --- a/client/PlanAIRClient/Workers/SegmentWorker.cs +++ b/client/PlanAIRClient/Workers/SegmentWorker.cs @@ -11,8 +11,8 @@ namespace TrafficClient.Workers { private static Logger logger = LogManager.GetCurrentClassLogger(); - public SegmentWorker(SqlConnection connection, CliFSPReader cliFSPReader, IMessageBus messageBus) : - base(connection, cliFSPReader, messageBus) { + public SegmentWorker(SqlConnection connection, CliFSPReader cliFSPReader, string functionName, IMessageBus messageBus) : + base(connection, cliFSPReader, functionName, messageBus) { } private MovieSegment ToSegment(clIFsp_EC_MAMPromotionalResult item) { @@ -42,7 +42,7 @@ namespace TrafficClient.Workers { List result = null; try { TryConnect(); - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Operation", 1010); cmd.Parameters.AddWithValue("@@@Options", DBNull.Value); @@ -69,7 +69,7 @@ namespace TrafficClient.Workers { public void DeleteMaterialSegments(int itemID) { try { TryConnect(); - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Operation", 1110); cmd.Parameters.AddWithValue("@@ItemID", itemID); @@ -89,7 +89,7 @@ namespace TrafficClient.Workers { public void DeleteMaterialSegment(int itemID, int segmentID) { try { TryConnect(); - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Operation", 1111); cmd.Parameters.AddWithValue("@@ItemID", itemID); @@ -113,7 +113,7 @@ namespace TrafficClient.Workers { comment = DBNull.Value; try { TryConnect(); - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { int optionalParam = segment.Optional ? 1 : 0; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Operation", 1115); @@ -140,7 +140,7 @@ namespace TrafficClient.Workers { comment = DBNull.Value; try { TryConnect(); - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { int optionalParam = segment.Optional ? 1 : 0; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Operation", 3100); @@ -166,7 +166,7 @@ namespace TrafficClient.Workers { comment = DBNull.Value; try { TryConnect(); - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { int optionalParam = segment.Optional ? 1 : 0; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Operation", 2100); @@ -190,7 +190,7 @@ namespace TrafficClient.Workers { List result = null; try { TryConnect(); - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Operation", 2001); cmd.Parameters.AddWithValue("@@@Options", 0); @@ -222,7 +222,7 @@ namespace TrafficClient.Workers { List result = null; try { TryConnect(); - using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + using (SqlCommand cmd = CreateCommmad()) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Operation", 3001); cmd.Parameters.AddWithValue("@@@Options", 0); diff --git a/client/PlanAIRClient/Workers/TrafficWorker.cs b/client/PlanAIRClient/Workers/TrafficWorker.cs index f9ecafc4..9d30dea7 100644 --- a/client/PlanAIRClient/Workers/TrafficWorker.cs +++ b/client/PlanAIRClient/Workers/TrafficWorker.cs @@ -9,11 +9,13 @@ namespace TrafficClient.Workers { protected IMessageBus messageBus; protected CliFSPReader cliFSPReader; + private readonly string functionName; protected SqlConnection connection; - public TrafficWorker(SqlConnection connection, CliFSPReader cliFSPReader, IMessageBus messageBus) { + public TrafficWorker(SqlConnection connection, CliFSPReader cliFSPReader, string functionName, IMessageBus messageBus) { this.connection = connection; this.cliFSPReader = cliFSPReader; + this.functionName = functionName; this.messageBus = messageBus; } @@ -30,6 +32,10 @@ namespace TrafficClient.Workers { messageBus.Send(new TrafficAPIMessage("Sikertelen kapcsolódás a TRAFFIC rendszerhez.")); } + protected SqlCommand CreateCommmad() { + string name = functionName ?? "dbo.clIFsp_EC_MAM"; + return new SqlCommand(name, connection); + } } } diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/CopyForArchiveNEXIOMaterialsStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/CopyForArchiveNEXIOMaterialsStep.java index 518beb98..55d64b9a 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/CopyForArchiveNEXIOMaterialsStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/CopyForArchiveNEXIOMaterialsStep.java @@ -192,13 +192,18 @@ public class CopyForArchiveNEXIOMaterialsStep extends JobStep { DBCollection clips = db.getCollection(NEXIOCLIPS); BasicDBObject clip = (BasicDBObject) clips.findOne(new BasicDBObject(LONGNAMEID, mosID)); if (clip == null) { - logger.debug("File NOT exists {}", mosID); + logger.debug("File NOT exists: {}", mosID); return null; //throw new Exception(String.format("File NOT exists %s", mosID)); } else { - logger.debug("File exists {}", mosID); + logger.debug("File exists: {}", mosID); } long duration = NoSQLUtils.asLong(clip, DURATION); + + if (duration == 0) { + logger.debug("File exists with 0 length: {}", mosID); + return null; + } return new FileArchive(mosID, duration); } diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/CopyForArchiveNEXIORecordingsStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/CopyForArchiveNEXIORecordingsStep.java index 043a098a..9137d1bc 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/CopyForArchiveNEXIORecordingsStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/CopyForArchiveNEXIORecordingsStep.java @@ -214,12 +214,19 @@ public class CopyForArchiveNEXIORecordingsStep extends JobStep { } if (clipName.startsWith("1900_")) { - String clipNameNext = clipName.replace("1900_", "1905_"); + String clipNameNext = clipName.replace("1900_", "1908_"); scheduledStart = getScheduledStart(clipNameNext, recordDate); rundown = octopusAPI.getRundown(scheduledStart); if (rundown == null) { - logger.error(systemMarker, "A '{}' anyaghoz nem található tükör '{}' kezdéssel, ezért nem archiválható.", clipName, scheduledStart); - return null; + Calendar calendar = CalendarUtils.createCalendar(scheduledStart); + int dow = calendar.get(Calendar.DAY_OF_WEEK); + if (dow == Calendar.SATURDAY || dow == Calendar.SUNDAY) { + logger.info(systemMarker, "A '{}' anyaghoz nem található tükör '{}' kezdéssel, de a hétvégi kivétel miatt archiválható.", clipName, + scheduledStart); + } else { + logger.error(systemMarker, "A '{}' anyaghoz nem található tükör '{}' kezdéssel, ezért nem archiválható.", clipName, scheduledStart); + return null; + } } RundownArchive item2 = null; diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/DeleteNEXIOMaterialsStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/DeleteNEXIOMaterialsStep.java index 2318509c..cd14224d 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/DeleteNEXIOMaterialsStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/DeleteNEXIOMaterialsStep.java @@ -24,7 +24,6 @@ import user.commons.remotestore.RemoteStoreProtocol; import user.jobengine.db.IItemManager; import user.jobengine.server.IJobEngine; import user.jobengine.server.IJobRuntime; -import user.jobengine.server.JobRuntime; public class DeleteNEXIOMaterialsStep extends JobStep { private static final Logger logger = LogManager.getLogger(); @@ -33,14 +32,14 @@ public class DeleteNEXIOMaterialsStep extends JobStep { private static final String LONGNAMEID = "longnameid"; private static final String EXTAGENCY = "extagency"; private StoreUri sourceUri; - private JobRuntime jobRuntime; + private IJobRuntime jobRuntime; private void delete(String name) { RemoteFile remoteFile = null; try { remoteFile = sourceUri.getRemoteFile(name); if (remoteFile == null) { - logger.warn(jobRuntime.getMarker(), "A '{}' fájl már nem található a NEXIO szerveren", name); + logger.warn(jobRuntime.getMarker(), "A '{}' fájl már nem található meg a NEXIO szerveren", name); return; } sourceUri.delete(remoteFile); @@ -53,6 +52,7 @@ public class DeleteNEXIOMaterialsStep extends JobStep { @StepEntry public Object[] execute(int port, String userName, String password, String filterAgencies, int gracePeriodDays, boolean notificationOnly, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { + this.jobRuntime = jobRuntime; String nexioHost = System.getProperty("nexio.host"); if (StringUtils.isBlank(nexioHost)) { logger.error(jobRuntime.getMarker(), "A 'nexio.host' rendszer paraméter nem található."); @@ -96,8 +96,8 @@ public class DeleteNEXIOMaterialsStep extends JobStep { Date killdate = clip.getDate(KILLDATE); if (notificationOnly) logger.info(jobRuntime.getMarker(), "Az {} fájl törölhető. Lejárt: {} ", name, df.format(killdate)); - // else - // delete(name); + else + delete(name); i++; setProgress(i * 100 / clips.size()); } diff --git a/server/user.jobengine.executors/test-deploy-steps-to-bsh-bkup.bat b/server/user.jobengine.executors/test-deploy-steps-to-bsh-bkup.bat index 023f9814..4d0256ce 100644 --- a/server/user.jobengine.executors/test-deploy-steps-to-bsh-bkup.bat +++ b/server/user.jobengine.executors/test-deploy-steps-to-bsh-bkup.bat @@ -9,6 +9,9 @@ SET REMOTE_STEPS_LOCATION=/opt/test-mediacube/configuration/executors/user SET LOCAL_TEMPLATES_LOCATION=jobtemplates SET REMOTE_TEMPLATES_LOCATION=/opt/test-mediacube/configuration/jobtemplates + +SET LOCAL_CONFIG_LOCATION=config +SET REMOTE_CONFIG_LOCATION=/opt/test-mediacube/configuration/executors ECHO *** Deploy steps to server %REMOTE_HOST% *** WinSCP.com /command ^ @@ -26,5 +29,12 @@ SET REMOTE_TEMPLATES_LOCATION=/opt/test-mediacube/configuration/jobtemplates "synchronize remote" ^ "exit" + ECHO *** Deploy config to server %REMOTE_HOST% *** + WinSCP.com /command ^ + "open %REMOTE_SERVER_ADDRESS% -hostkey=""%REMOTE_SERVER_HOSTKEY%"" -timeout=60" ^ + "lcd %LOCAL_CONFIG_LOCATION%" ^ + "cd %REMOTE_CONFIG_LOCATION%" ^ + "synchronize remote -filemask=config.xml" ^ + "exit" + @ECHO ON -