async deleteUnusedDepartures(iDepTT, iDepartures){
		let StatesJSON;
		const SectionRegEx = `${this.Fahrplan.name}\\.${this.Fahrplan.instance}\\.DepartureTimetable${iDepTT.toString()}\\.(\\d*)\\..*$`;
		try{
			const States = await this.Fahrplan.getStatesAsync(`DepartureTimetable${iDepTT.toString()}.*`);
			StatesJSON = JSON.stringify(States);
			this.ReportingInfo("Debug", "Departure Timetable", `Delete unused departures for Departure Timetable #${iDepTT} with max Departures #${iDepartures} and regex:${SectionRegEx.toString()}`, "fHelpers", "deleteUnusedDepartures");
			for (const State in States){
				const Searcher = State.toString().match(new RegExp(SectionRegEx));
				if (Searcher !== null){
					if (parseInt(Searcher[1]) >= iDepartures ){
						// Verify that associated object exists
						const CurrentObj = await this.Fahrplan.getObjectAsync(State.toString());
						if (CurrentObj){
							if (this.isUnloaded === false) await this.Fahrplan.delObjectAsync(State.toString());
						} else{
							const CurrentState = await this.Fahrplan.getStateAsync(State.toString());
							if (CurrentState){
								if (this.isUnloaded === false) await this.Fahrplan.deleteStateAsync(State.toString());
							}
						}
					}
				}
			}
		}catch(e){
			this.ReportingError(e, `Exception removing unused Departures`, "fHelpers", "deleteUnusedDepartures", "DeleteStates", {json: StatesJSON});
		}
		let ChannelsJSON;
		try{
			const Channels = await this.Fahrplan.getChannels();
			if (Channels){
				ChannelsJSON = JSON.stringify(Channels);
				for (const Channel of Channels){
					const Searcher = Channel["_id"].toString().match(new RegExp(SectionRegEx));
					if (Searcher !== null){
						if (parseInt(Searcher[1]) >= iDepartures ){
							if (this.isUnloaded === false) this.Fahrplan.delObject(Channel["_id"]);
						}
					}
				}
			}
		}catch(e){
			this.ReportingError(e, `Exception removing unused Departures`, "fHelpers", "deleteUnusedDepartures", "DeleteStates", {json: ChannelsJSON});
		}
	}
/**
	* Sets boolean State
	* @param {Number} iDepTT Number of Departure Timetable from configuration
	* @param {Number} iDepartures Number of Departures in Departure Timetable
	*/
Sets boolean State
@param {Number} iDepTT Number of Departure Timetable from configuration
@param {Number} iDepartures Number of Departures in Departure Timetable
Sets boolean State @param { Number } iDepTT Number of Departure Timetable from configuration @param { Number } iDepartures Number of Departures in Departure Timetable
async deleteUnusedDepartures(iDepTT, iDepartures){
		let StatesJSON;
		const SectionRegEx = `${this.Fahrplan.name}\\.${this.Fahrplan.instance}\\.DepartureTimetable${iDepTT.toString()}\\.(\\d*)\\..*$`;
		try{
			const States = await this.Fahrplan.getStatesAsync(`DepartureTimetable${iDepTT.toString()}.*`);
			StatesJSON = JSON.stringify(States);
			this.ReportingInfo("Debug", "Departure Timetable", `Delete unused departures for Departure Timetable #${iDepTT} with max Departures #${iDepartures} and regex:${SectionRegEx.toString()}`, "fHelpers", "deleteUnusedDepartures");
			for (const State in States){
				const Searcher = State.toString().match(new RegExp(SectionRegEx));
				if (Searcher !== null){
					if (parseInt(Searcher[1]) >= iDepartures ){
						const CurrentObj = await this.Fahrplan.getObjectAsync(State.toString());
						if (CurrentObj){
							if (this.isUnloaded === false) await this.Fahrplan.delObjectAsync(State.toString());
						} else{
							const CurrentState = await this.Fahrplan.getStateAsync(State.toString());
							if (CurrentState){
								if (this.isUnloaded === false) await this.Fahrplan.deleteStateAsync(State.toString());
							}
						}
					}
				}
			}
		}catch(e){
			this.ReportingError(e, `Exception removing unused Departures`, "fHelpers", "deleteUnusedDepartures", "DeleteStates", {json: StatesJSON});
		}
		let ChannelsJSON;
		try{
			const Channels = await this.Fahrplan.getChannels();
			if (Channels){
				ChannelsJSON = JSON.stringify(Channels);
				for (const Channel of Channels){
					const Searcher = Channel["_id"].toString().match(new RegExp(SectionRegEx));
					if (Searcher !== null){
						if (parseInt(Searcher[1]) >= iDepartures ){
							if (this.isUnloaded === false) this.Fahrplan.delObject(Channel["_id"]);
						}
					}
				}
			}
		}catch(e){
			this.ReportingError(e, `Exception removing unused Departures`, "fHelpers", "deleteUnusedDepartures", "DeleteStates", {json: ChannelsJSON});
		}
	}
async deleteUnusedDepartures ( iDepTT , iDepartures ) { let StatesJSON ; const SectionRegEx = ` ${ this . Fahrplan . name } \\ ${ this . Fahrplan . instance } \\ ${ iDepTT . toString ( ) } \\ \\ \\ ` ; try { const States = await this . Fahrplan . getStatesAsync ( ` ${ iDepTT . toString ( ) } ` ) ; StatesJSON = JSON . stringify ( States ) ; this . ReportingInfo ( "Debug" , "Departure Timetable" , ` ${ iDepTT } ${ iDepartures } ${ SectionRegEx . toString ( ) } ` , "fHelpers" , "deleteUnusedDepartures" ) ; for ( const State in States ) { const Searcher = State . toString ( ) . match ( new RegExp ( SectionRegEx ) ) ; if ( Searcher !== null ) { if ( parseInt ( Searcher [ 1 ] ) >= iDepartures ) { const CurrentObj = await this . Fahrplan . getObjectAsync ( State . toString ( ) ) ; if ( CurrentObj ) { if ( this . isUnloaded === false ) await this . Fahrplan . delObjectAsync ( State . toString ( ) ) ; } else { const CurrentState = await this . Fahrplan . getStateAsync ( State . toString ( ) ) ; if ( CurrentState ) { if ( this . isUnloaded === false ) await this . Fahrplan . deleteStateAsync ( State . toString ( ) ) ; } } } } } } catch ( e ) { this . ReportingError ( e , ` ` , "fHelpers" , "deleteUnusedDepartures" , "DeleteStates" , { json : StatesJSON } ) ; } let ChannelsJSON ; try { const Channels = await this . Fahrplan . getChannels ( ) ; if ( Channels ) { ChannelsJSON = JSON . stringify ( Channels ) ; for ( const Channel of Channels ) { const Searcher = Channel [ "_id" ] . toString ( ) . match ( new RegExp ( SectionRegEx ) ) ; if ( Searcher !== null ) { if ( parseInt ( Searcher [ 1 ] ) >= iDepartures ) { if ( this . isUnloaded === false ) this . Fahrplan . delObject ( Channel [ "_id" ] ) ; } } } } } catch ( e ) { this . ReportingError ( e , ` ` , "fHelpers" , "deleteUnusedDepartures" , "DeleteStates" , { json : ChannelsJSON } ) ; } }
Sets boolean State
 @param {Number} iDepTT Number of Departure Timetable from configuration
 @param {Number} iDepartures Number of Departures in Departure Timetable
Sets boolean State @param { Number } iDepTT Number of Departure Timetable from configuration @param { Number } iDepartures Number of Departures in Departure Timetable
// Verify that associated object exists