public EditSimulationPresenter(IEditSimulationView view, ISimulationChartPresenter chartPresenter, IHierarchicalSimulationPresenter hierarchicalPresenter, ISimulationDiagramPresenter simulationDiagramPresenter,
                                IEditSolverSettingsPresenter solverSettingsPresenter, IEditOutputSchemaPresenter editOutputSchemaPresenter,
                                IEditInSimulationPresenterFactory showPresenterFactory, IHeavyWorkManager heavyWorkManager, IChartFactory chartFactory,
                                IEditFavoritesInSimulationPresenter favoritesPresenter, IChartTasks chartTask, IUserDefinedParametersPresenter userDefinedParametersPresenter)
     : base(view)
 {
     _editOutputSchemaPresenter = editOutputSchemaPresenter;
     _showPresenterFactory      = showPresenterFactory;
     _heavyWorkManager          = heavyWorkManager;
     _chartFactory                   = chartFactory;
     _favoritesPresenter             = favoritesPresenter;
     _chartTask                      = chartTask;
     _userDefinedParametersPresenter = userDefinedParametersPresenter;
     _solverSettingsPresenter        = solverSettingsPresenter;
     _hierarchicalPresenter          = hierarchicalPresenter;
     _simulationDiagramPresenter     = simulationDiagramPresenter;
     _chartPresenter                 = chartPresenter;
     _view.SetTreeView(hierarchicalPresenter.BaseView);
     _view.SetModelDiagram(_simulationDiagramPresenter.View);
     _hierarchicalPresenter.ShowOutputSchema    = showOutputSchema;
     _hierarchicalPresenter.ShowSolverSettings  = showSolverSettings;
     _hierarchicalPresenter.SimulationFavorites = () => _favoritesPresenter.Favorites();
     _view.SetChartView(chartPresenter.View);
     AddSubPresenters(_chartPresenter, _hierarchicalPresenter, _simulationDiagramPresenter, _solverSettingsPresenter, _editOutputSchemaPresenter, _favoritesPresenter, _userDefinedParametersPresenter);
     _cacheShowPresenter = new Cache <Type, IEditInSimulationPresenter> {
         OnMissingKey = x => null
     };
 }
 public CommonChartControl(IChartFactory factory, int dataPointsCount, int maxValue, int width, int height)
 {
     _factory = factory;
     _dataPointsCount = dataPointsCount;
     _maxValue = maxValue;
     _width = width;
     _height = height;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ReportsController"/> class.
 /// </summary>
 /// <param name="mapper">Our Mapper injection</param>
 /// <param name="chartFactory">Evaluation servicer</param>
 /// <param name="logger">The Logger</param>
 public ReportsController(
     IMapper mapper,
     IChartFactory chartFactory,
     ILogger logger)
 {
     this.mapper       = mapper;
     this.chartFactory = chartFactory;
     this.logger       = logger;
 }
Ejemplo n.º 4
0
 public ChartTasks(IMoBiContext context, IEventPublisher eventPublisher, IMoBiApplicationController applicationController,
                   IChartFactory chartFactory, IDialogCreator dialogCreator, IMoBiProjectRetriever projectRetriever)
 {
     _context               = context;
     _eventPublisher        = eventPublisher;
     _applicationController = applicationController;
     _chartFactory          = chartFactory;
     _dialogCreator         = dialogCreator;
     _projectRetriever      = projectRetriever;
 }
Ejemplo n.º 5
0
 public SimpleChartPresenter(ISimpleChartView view, IChartDisplayPresenter chartDisplayPresenter, IChartFactory chartFactory,
                             IEventPublisher eventPublisher, IPresentationUserSettings presentationUserSettings, IDimensionFactory dimensionFactory)
     : base(view)
 {
     _chartDisplayPresenter    = chartDisplayPresenter;
     _chartFactory             = chartFactory;
     _eventPublisher           = eventPublisher;
     _presentationUserSettings = presentationUserSettings;
     _dimensionFactory         = dimensionFactory;
     _view.AddView(_chartDisplayPresenter.View);
     _chartDisplayPresenter.DisableCurveAndAxisEdits();
     LogLinSelectionEnabled = false;
     AddSubPresenters(_chartDisplayPresenter);
 }
        protected override void Context()
        {
            _view                     = A.Fake <ISimpleChartView>();
            _chartFactory             = A.Fake <IChartFactory>();
            _chartDisplayPresenter    = A.Fake <IChartDisplayPresenter>();
            _eventPublisher           = A.Fake <IEventPublisher>();
            _dimensionFactory         = A.Fake <IDimensionFactory>();
            _presentationUserSettings = A.Fake <IPresentationUserSettings>();
            sut = new SimpleChartPresenter(_view, _chartDisplayPresenter, _chartFactory, _eventPublisher, _presentationUserSettings, _dimensionFactory);

            _presentationUserSettings.DefaultChartYScaling = Scalings.Log;
            A.CallTo(() => _chartFactory.Create <CurveChart>()).ReturnsLazily(() => new CurveChart {
                DefaultYAxisScaling = _presentationUserSettings.DefaultChartYScaling
            });
        }
Ejemplo n.º 7
0
        protected override void Context()
        {
            _moBiContext               = A.Fake <IMoBiContext>();
            _eventPublisher            = A.Fake <IEventPublisher>();
            _moBiApplicationController = A.Fake <IMoBiApplicationController>();
            _chartFactory              = A.Fake <IChartFactory>();
            _dialogCreator             = A.Fake <IDialogCreator>();
            _currentProject            = A.Fake <IMoBiProject>();
            _projectRetriever          = A.Fake <IMoBiProjectRetriever>();

            sut = new ChartTasks(_moBiContext, _eventPublisher, _moBiApplicationController,
                                 _chartFactory, _dialogCreator, _projectRetriever);

            A.CallTo(() => _projectRetriever.CurrentProject).Returns(_currentProject);
            A.CallTo(() => _moBiContext.CurrentProject).Returns(_currentProject);
        }
Ejemplo n.º 8
0
        private void Form1_Click(object sender, EventArgs e)
        {
            //string AssemblyName = "工厂方法模式_简易图表_工厂方法版";//直接指定当前程序集名称
            string AssemblyName = Assembly.GetExecutingAssembly().GetName().Name;             //得到当前程序集名称

            Graphics g = this.CreateGraphics();
            var      p = new Pen(Color.Maroon);

            g.Clear(Color.LightBlue);

            IChartFactory chartFactory = null;

            //利用swich语句,选择要创建的工厂类对象
            //switch (this.comboBox1.Text)
            //{
            //	case "Pie":
            //		chartFactory = new PieChartFactory();
            //		break;
            //	case "Bar":
            //		chartFactory = new BarChartFactory();
            //		break;
            //	case "Line":
            //		chartFactory = new LineChartFactory();
            //		break;
            //}

            string className = AssemblyName + "." + comboBox1.Text + "ChartFactory";             //组装出需要的工厂类的类名

            chartFactory = (IChartFactory)Assembly.Load(AssemblyName).CreateInstance(className); //利用反射,创建指定类名的实例

            Chart chart = chartFactory.Create(g, p);

            //chart.Data = new int[]{100,400,300,500,200};
            //chart.Data = new int[] { 300, 200, 400, 500, 100 };
            string[] content = this.textBox1.Text.Split(',');

            chart.Data = new int[content.Length];             //创建需要的长度的int数组

            for (int i = 0; i < content.Length; i++)
            {
                chart.Data[i] = Convert.ToInt32(content[i]);
            }             //将字符串数组中各字符串转换为整型

            chart.Display();
        }
Ejemplo n.º 9
0
 public CurrencyRateController(IRequestToCbr requestToCbr, IChartFactory chartFactory)
 {
     _requestToCbr = requestToCbr;
     _chartFactory = chartFactory;
 }
Ejemplo n.º 10
0
 public ChartController(IChartFactory chartFactory, IModeDeterminer modeDeterminer, IFunctionsProvider functionsProvider)
 {
     _chartFactory      = chartFactory;
     _modeDeterminer    = modeDeterminer;
     _functionsProvider = functionsProvider;
 }
Ejemplo n.º 11
0
 public TestConstructorAutowired([Autowired("$FactoryName")] IChartFactory chartFactory,
                                 [Value(typeof(SettingExpressionParser), "$FactoryName")] string value)
 {
     factory = chartFactory;
 }
Ejemplo n.º 12
0
 public ParameterIdentificationAnalysisCreator(IChartFactory chartFactory, IOSPSuiteExecutionContext context, IContainerTask containerTask, IIdGenerator idGenerator, IObjectIdResetter objectIdResetter) : base(containerTask, context, objectIdResetter, idGenerator)
 {
     _chartFactory = chartFactory;
 }