コード例 #1
0
        /// <seealso cref="IInitPage.Initialize"/>
        public void Initialize(IPage page, IEditMethod editMethod)
        {
            ISymbol deviceSymbol = page.Component.Symbol;
            List <TimeGridColumnInfo> columnInfo = new List <TimeGridColumnInfo>();

            TimeGridColumnInfo currentColumnInfo = new TimeGridColumnInfo();
            IProperty          valveState        = deviceSymbol.Child("ValveState") as IProperty;

            Debug.Assert(valveState != null);
            currentColumnInfo.Property    = valveState;
            currentColumnInfo.DisplayName = "Valve State";
            columnInfo.Add(currentColumnInfo);

            currentColumnInfo = new TimeGridColumnInfo();
            ICommand switchValveTo1 = deviceSymbol.Child("SwitchValveTo1") as ICommand;

            Debug.Assert(switchValveTo1 != null);
            currentColumnInfo.Command     = switchValveTo1;
            currentColumnInfo.DisplayName = "Switch to '1'";
            columnInfo.Add(currentColumnInfo);

            currentColumnInfo = new TimeGridColumnInfo();
            ICommand switchValveTo2 = deviceSymbol.Child("SwitchValveTo2") as ICommand;

            Debug.Assert(switchValveTo2 != null);
            currentColumnInfo.Command     = switchValveTo2;
            currentColumnInfo.DisplayName = "Switch to '2'";
            columnInfo.Add(currentColumnInfo);

            currentColumnInfo = new TimeGridColumnInfo();
            ICommand switchValve = deviceSymbol.Child("SwitchValve") as ICommand;

            Debug.Assert(switchValve != null);
            currentColumnInfo.Command     = switchValve;
            currentColumnInfo.DisplayName = "Switch Valve Using Parameters";
            columnInfo.Add(currentColumnInfo);

            m_TimeGrid.Init(page.Component, columnInfo);
        }
コード例 #2
0
            public void ScriptUpdate(SeparationMethodStage stageType, string commandName, bool addCommand)
            {
                ITimeStep stage = m_EditMethod.Stages.GetFirstTimeStepOfStage(stageType, true);

                ICommand    command     = m_DeviceSymbol.Children[commandName] as ICommand;
                ISymbolStep commandStep = DDKHelper.FindStepInStage(command.Path, stage);

                if (addCommand)
                {
                    if (commandStep == null)  // The command is not in the script
                    {
                        command     = m_DeviceSymbol.Child(commandName) as ICommand;
                        commandStep = m_Page.Component.CreateStep(command) as ICommandStep;
                        stage.SymbolSteps.Add(commandStep);
                    }
                }
                else // Remove Command
                {
                    if (commandStep != null)  // The command is in the script
                    {
                        commandStep.Remove();
                    }
                }
            }
コード例 #3
0
        public void Initialize(IPage page, IEditMethod editMethod)
        {
            m_Page         = page;
            m_EditMethod   = editMethod;
            m_DeviceSymbol = m_Page.Component.Symbol;

            m_TemperatureController = new MinMaxNominalController(m_Page.Component, m_DeviceSymbol.Child("Temperature"),
                                                                  m_TextBoxLowerLimit,
                                                                  m_TextBoxUpperLimit,
                                                                  m_TextBoxNominal);

            m_EnableController = new EnableController(m_Page.Component, m_TempControlCheckBox.Controller);
            m_EnableController.ControlledItems.AddRange(new Control[]
            {
                m_TextBoxLowerLimit,
                m_TextBoxUpperLimit,
                m_TextBoxNominal
            });
        }