示例#1
0
        ///////////////////////////////////////////////////////////////////////////////
        // HCallback is invoked after the drawing is loaded, before object hirarchy
        // is set up, but before the drawing is dispalyed for the first time.
        // It may be used to initialize the drawing before it is displayed.
        ///////////////////////////////////////////////////////////////////////////////
        private void glgControl1_GlgH(object sender, GenLogic.GlgEventArgs e)
        {
            // Set initial values for a GLG widget.

            // Disable InputHandler for a dial control so that the dial acts
            // only as an output device and doesn't respond to user input.
            e.viewport.SetDResource("CurrentDial/HandlerDisabled", 1.0);
            e.viewport.SetDResource("CurrentDial/Low", currentLowRange);
            e.viewport.SetDResource("CurrentDial/High", currentHighRange);
            e.viewport.SetDResource("CurrentDial/Value", currentInitValue);

            e.viewport.SetDResource("VoltageDial/HandlerDisabled", 1.0);
            e.viewport.SetDResource("VoltageDial/Low", voltageLowRange);
            e.viewport.SetDResource("VoltageDial/High", voltageHighRange);
            e.viewport.SetDResource("VoltageDial/Value", voltageInitValue);

            e.viewport.SetDResource("AmpHoursDial/HandlerDisabled", 1.0);
            e.viewport.SetDResource("AmpHoursDial/Low", ampHoursLowRange);
            e.viewport.SetDResource("AmpHoursDial/High", ampHoursHighRange);
            e.viewport.SetDResource("AmpHoursDial/Value", ampHoursInitValue);

            e.viewport.SetDResource("TempDial/HandlerDisabled", 1.0);
            e.viewport.SetDResource("TempDial/Low", tempLowRange);
            e.viewport.SetDResource("TempDial/High", tempHighRange);
            e.viewport.SetDResource("TempDial/Value", tempInitValue);
        }
        ///////////////////////////////////////////////////////////////////////////////
        // HCallback is invoked after the drawing is loaded, before object hirarchy
        // is set up, but before the drawing is dispalyed for the first time.
        // It may be used to initialize the drawing before it is displayed.
        ///////////////////////////////////////////////////////////////////////////////
        private void glgControl1_GlgH(object sender, GenLogic.GlgEventArgs e)
        {
            // Set initial values for a GLG widget.

            // Disable InputHandler for a dial control so that the dial acts
            // only as an output device and doesn't respond to user input.
            e.viewport.SetDResource("Dial/HandlerDisabled", 1.0);

            // Set High and Low range resources for both Slider and Dial
            e.viewport.SetDResource("Dial/Low", LowRange);

            e.viewport.SetDResource("Dial/High", HighRange);

            // Set initial values of a dial and a slider
            e.viewport.SetDResource("Dial/Value", InitValue);
        }