public BrewLoggerGuiController(Subject guiModel, IBrewLoggerGuiView guiView, ReportGenerator reportGenerator)
 {
     this.guiModel          = guiModel;
     this.guiView           = guiView;
     brewParametersGuiModel = (Models.BrewParametersGuiModel)guiModel;
     this.reportGenerator   = reportGenerator;
 }
예제 #2
0
        public AppForm()
        {
            //Initialize picturebox static parameters
            ProcessViewPictureBox.ImagesFolderPath = imagesFolderPath;
            ProcessViewPictureBox.ProcessViewScale = processViewScale;

            // Default Constructor
            Text = "Windows Forms app";

            // Model & Controller for process parameters views
            brewingProcessHandler = BrewingProcessHandler.GetInstance();
            guiModel = brewingProcessHandler;
            // Register with BrewingProcessHandler Subject
            guiModel.Attach(this);

            brewParametersGuiModel    = new BrewParametersGuiModel();
            guiProcessParametersModel = brewParametersGuiModel;
            ReportGenerator reportGenerator = new XlReportGenerator();

            guiController = new BrewLoggerGuiController(guiProcessParametersModel, this, reportGenerator);
            // Register with BrewParametersGuiModel Subject
            guiProcessParametersModel.Attach(this);

            // Model for process equipment view
            //processViewModel = new ProcessViewModel();
            //processViewModel.AddObserver(this);

            this.Size = new Size(1200, 800);

            //Setup GUI elements
            SetupProcessView();
            SetupNewBrewView();
            SetupBrewsListView();
            SetupProcessEquipmentParametersView();
            SetupReportView();

            render();
        }