public TMultiSettingDescriptor(string Name, string Descriptor, RFD.RFD900.TSetting Setting) : base(Name, Descriptor, new TATDescriptor(Setting.Name, Setting.Designator)) { _RFD900Setting = Setting.Value; if (Setting.Options == null) { for (int n = Setting.Range.Min; n <= Setting.Range.Max; n++) { _Options.Add(new TIntOption(n.ToString(), n)); } } else { foreach (var O in Setting.Options) { _Options.Add(new TIntOption(O.OptionName, O.Value)); } } }
/*public string GenerateSetCommand(IParam Param) * { * return "AT" + ATNumber + "=" + Param.ToString(); * }*/ public static ISetting GenerateSettingFromRFD900Setting(RFD.RFD900.TSetting Setting, uploader.Uploader.Board Board, uploader.Uploader.Frequency Freq, bool Async) { TSettingDescription Desc = TDesignatorLookupTable.TABLE.GetDescription(Setting.Name); if (Desc == null) { Desc = new TSettingDescription(Setting.Name, Setting.Name, Setting.Name); } //If there's no range or options... if ((Setting.Options == null) && (Setting.Range == null)) { if (Desc is TSettingDescWithID) { //This has to be referred back to a lookup table for this modem model in order to generate its setting. var TheMap = Map.TModemSettingMap.GetMapForModem(Board, Freq, Async); return(TheMap.GenerateSetting(((TSettingDescWithID)Desc).ID, Setting)); } else { TIntegerSettingFromSettingDescriptor ISFSD = new TIntegerSettingFromSettingDescriptor(Desc.Name, Desc.Description, Setting); return(ISFSD.CreateNewSetting()); } } else { if ((Setting.Options == null) && (Setting.Range.Min == 0) && (Setting.Range.Max == 1)) { TBoolSettingFromSettingDescriptor BSFSD = new TBoolSettingFromSettingDescriptor(Desc.Name, Desc.Description, Setting); return(BSFSD.CreateNewSetting()); } else { TMultiSettingDescriptor MSD = new TMultiSettingDescriptor(Desc.Name, Desc.Description, Setting); return(MSD.CreateNewSetting()); } } }
public override TSettingDescriptor GetSettingDescriptor(RFD.RFD900.TSetting Setting) { var Desc = Config.TDesignatorLookupTable.TABLE.GetDescription(ID); return(new Config.TBoolSettingFromSettingDescriptor(Desc.Name, Desc.Description, Setting)); }
public abstract RFDLib.Config.TSettingDescriptor GetSettingDescriptor(RFD.RFD900.TSetting Setting);
public TIntegerSettingFromSettingDescriptor(string Name, string Descriptor, RFD.RFD900.TSetting Setting) : base(Name, Descriptor, new TATDescriptor(Setting.Name, Setting.Designator)) { _RFD900Setting = Setting; }