Save select train value in database and use it

Ticket:	#6300
Use user selected train as the initial value
Merge remote-tracking branch 'origin/master' into freebsd10