Exemplo n.º 1
0
        private SettingsTemplate createSettingsObject()
        {
            SettingsTemplate        sets = new SettingsTemplate();
            ChannelSettingsTemplate chan;

            for (int i = 0; i < 8; i++)
            {
                chan                = new ChannelSettingsTemplate();
                chan.DutyCycle      = channelControls[i].channelSettings.DutyCycleS;
                chan.Enabled        = channelControls[i].channelSettings.Enabled;
                chan.Frequency      = channelControls[i].channelSettings.Frequency;
                chan.DutyCycleUnits = channelControls[i].DcUnits;
                chan.FrequencyUnits = channelControls[i].FrequencyUnits;

                sets.ChannelSettings.Add(chan);
            }

            if (ControlMode == PwmGeneratorModes.Synchronous)
            {
                sets.SynchronousFrequency      = synchronousPwmFrequency;
                sets.SynchronousFrequencyUnits = channelControls[0].FrequencyUnits;
            }

            return(sets);
        }
Exemplo n.º 2
0
        private SettingsTemplate createSettingsObject()
        {
            SettingsTemplate sets = new SettingsTemplate();
            ChannelSettingsTemplate chan;
            for (int i = 0; i < 8; i++)
            {
                chan = new ChannelSettingsTemplate();
                chan.DutyCycle = channelControls[i].channelSettings.DutyCycleS;
                chan.Enabled = channelControls[i].channelSettings.Enabled;
                chan.Frequency = channelControls[i].channelSettings.Frequency;
                chan.DutyCycleUnits = channelControls[i].DcUnits;
                chan.FrequencyUnits = channelControls[i].FrequencyUnits;

                sets.ChannelSettings.Add(chan);
            }

            if (ControlMode == PwmGeneratorModes.Synchronous)
            {
                sets.SynchronousFrequency = synchronousPwmFrequency;
                sets.SynchronousFrequencyUnits = channelControls[0].FrequencyUnits;
            }

            return sets;
        }