public ProjectorPluginPanel(ProjectorPlugin plugin) : this() { mPlugin = plugin; roomPositionPanel.Text = "Room Position (cm)"; mPlugin.Change += new Action(mPlugin_Change); mPlugin.ProjectorAdded += new Action<Projector>(mPlugin_ProjectorAdded); mPlugin_Change(); foreach (var projector in mPlugin.Projectors) mPlugin_ProjectorAdded(projector); }
public Projector(Frame frame, ProjectorPlugin projectorPlugin) { mProjectorPlugin = projectorPlugin; mFrame = frame; mTargetH = frame.Height; ProjectorConfig cfg = new ProjectorConfig(frame.Name); mOrientation = new Rotation(cfg.ProjectorPitch, cfg.ProjectorYaw); //Constants mThrowRatio = cfg.ThrowRatio; mUpsideDown = cfg.UpsideDown; mVOffset = cfg.VOffset; mNativeAspectRatio = cfg.NativeAspectRatio; SetAspectRatio(cfg.AspectRatio); CalculateAngles(); mLock = cfg.Lock; if (mLock == LockedVariable.Position /* || mLock == LockedVariable.Nothing*/) { mPosition = cfg.ProjectorPosition; mD = cfg.WallDistance; mFrame.Orientation.Yaw = mOrientation.Yaw; } else { mD = mLock == LockedVariable.Width ? CalculateDFromW() :CalculateDFromH(); mPosition = CalculatePositionFromH(); mOrientation.Yaw = mFrame.Orientation.Yaw; } mOldW = mFrame.Width; mOldH = mFrame.Height; mDraw = cfg.Draw; mDrawLabels = cfg.DrawLabels; mProjectorPlugin.RoomChanged += new Action(mProjectorPlugin_RoomChanged); mOrientation.Changed += new EventHandler(mOrientation_Changed); frame.Changed += new Action <Frame, EventArgs>(frame_Changed); }
public Projector(Frame frame, ProjectorPlugin projectorPlugin) { mProjectorPlugin = projectorPlugin; mFrame = frame; mTargetH = frame.Height; ProjectorConfig cfg = new ProjectorConfig(frame.Name); mOrientation = new Rotation(cfg.ProjectorPitch, cfg.ProjectorYaw); //Constants mThrowRatio = cfg.ThrowRatio; mUpsideDown = cfg.UpsideDown; mVOffset = cfg.VOffset; mNativeAspectRatio = cfg.NativeAspectRatio; SetAspectRatio(cfg.AspectRatio); CalculateAngles(); mLock = cfg.Lock; if (mLock == LockedVariable.Position/* || mLock == LockedVariable.Nothing*/) { mPosition = cfg.ProjectorPosition; mD = cfg.WallDistance; mFrame.Orientation.Yaw = mOrientation.Yaw; } else { mD = mLock == LockedVariable.Width ? CalculateDFromW() :CalculateDFromH(); mPosition = CalculatePositionFromH(); mOrientation.Yaw = mFrame.Orientation.Yaw; } mOldW = mFrame.Width; mOldH = mFrame.Height; mDraw = cfg.Draw; mDrawLabels = cfg.DrawLabels; mProjectorPlugin.RoomChanged += new Action(mProjectorPlugin_RoomChanged); mOrientation.Changed += new EventHandler(mOrientation_Changed); frame.Changed += new Action<Frame,EventArgs>(frame_Changed); }