internal bool Init(JupiterDisplayConfig display, JupiterWindow wnd) { this.InitBorderTitle(wnd, axGalileoCtrl); Text = wnd.TitleText; try { if (wnd.VideoIn < 0 || wnd.VideoIn >= display.InOutConfigList.Count) throw new IndexOutOfRangeException("Указан не существующий вход видеостены"); axGalileoCtrl.SuspendLayout(); //axGalileoCtrl.BeginInit(); try { JupiterInOutConfig configWindow = display.InOutConfigList[wnd.VideoIn - 1]; switch (configWindow.WindowType) { case WindowTypeEnum.RGB: CreateRGB(display, wnd, configWindow); break; case WindowTypeEnum.Video: CreateLive(display, wnd, configWindow); break; default: throw new ApplicationException(String.Format( "Данный тип окна: {0}, не поддерживается системой ", configWindow.WindowType)); } // Бага в OCX, чтобы работало контрол должен получить команду Move axGalileoCtrl.Width = 0; axGalileoCtrl.Height = 0; axGalileoCtrl.Width = Width; axGalileoCtrl.Height = Height; SetCropping(wnd); axGalileoCtrl.Start(); } finally { //axGalileoCtrl.EndInit(); axGalileoCtrl.ResumeLayout(); } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); } return true; }
internal int[] getAvailableInputs(JupiterWindow wnd) { Slide slide = JupiterModule._slideMapping[wnd]; var busyInputs = from d in slide.DisplayList where d.Type.Equals(this.Type) from w in d.WindowList where (w is JupiterWindow && w != wnd) select (w as JupiterWindow).VideoIn; var list = getAvailableInputs(wnd.Source); return (from i in list where !busyInputs.Contains(i) select i).ToArray(); }
internal bool isVideoWindow(JupiterWindow wnd) { if (wnd == null) return false; var type = (from io in (this.Type as JupiterDisplayConfig).InOutConfigList where io.VideoIn == wnd.VideoIn select io.WindowType).First(); return type == WindowTypeEnum.Video; }
protected override Window CreateWindowProtected(Source source, Slide slide) { if (source is HardwareSource) { //return new JupiterWindow(); // временно пока не реализована таблица совместимости var busyInputs = from d in slide.DisplayList where d.Type.Equals(this.Type) from w in d.WindowList where w is JupiterWindow select (w as JupiterWindow).VideoIn; JupiterWindow wnd = new JupiterWindow(); AfterWindowAdded(wnd, slide); var list = getAvailableInputs(source); if (list.Count() == 0) throw new Exception(String.Concat("Источник недопустим для данного дисплея. Добавление источника ", source.Name, " на раскладку невозможно")); var freeInputs = from io in list where !busyInputs.Contains(io) select io; if (freeInputs.Count() == 0) throw new Exception(String.Concat("Свободные входы на видеостене отсутствуют. Добавление источника ", source.Name, " на раскладку невозможно")); wnd.VideoIn = freeInputs.First(); return wnd; } return new ActiveWindow(); }
public void CreateLive(JupiterDisplayConfig display, JupiterWindow wnd, JupiterInOutConfig configWindow) { axGalileoCtrl.LVChannel = configWindow.VideoIn; }
public void CreateRGB(JupiterDisplayConfig display, JupiterWindow wnd, JupiterInOutConfig configWindow) { axGalileoCtrl.RGBChannel = configWindow.VideoIn; SetRGBTiming(wnd); }