Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing input data #27

Open
Aecttann opened this issue Mar 25, 2020 · 1 comment
Open

Changing input data #27

Aecttann opened this issue Mar 25, 2020 · 1 comment

Comments

@Aecttann
Copy link

How should I change MockDataService class for my own data, which are going in a strong order? What steps I need to do? Now there are random values from Lists.
I was trying to change some loops, for example:

        for (int i=0 ; i < availableChannelLogos.size(); i++) {
            EPGChannel epgChannel = new EPGChannel(availableChannelLogos.get(i),
                    "Channel " + (i+1), Integer.toString(i));

            result.put(epgChannel, createEvents(epgChannel, nowMillis));
        }

and

//        while (currentTime <= epgEnd) {
            for(int i = 0; currentTime <= epgEnd; i++){
                long eventEnd = getEventEnd(currentTime);
                EPGEvent epgEvent = new EPGEvent(currentTime, eventEnd, availableEventTitles.get(i));
                result.add(epgEvent);
                currentTime = eventEnd;
            }
//            long eventEnd = getEventEnd(currentTime);
//            EPGEvent epgEvent = new EPGEvent(currentTime, eventEnd, availableEventTitles.get(randomBetween(0, 6)));
//            result.add(epgEvent);
//            currentTime = eventEnd;
//        }

but I didn't think that I'm on the right way.

And with this method I even have no ideas how to change it for me:

    private static long getEventEnd(long eventStartMillis) {
        long length = availableEventLength.get(randomBetween(0,5));
        return eventStartMillis + length;
    }
@devnullpointer
Copy link

The MockDataService is simply a service that generates a map of channels and epgevents for the channel. All you need to do is call your own service or data gathering mechanism, build the Map<Channel, EPGEvent> and then pass it to the epg object.

final Map<Channel, EPGEvent> epgData = myService.getMyData();
epg.setEPGData(epgData);
epg.recalculateAndRedraw(false);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants