|
|
|
|
@ -17,6 +17,7 @@ import net.pokeranalytics.android.model.comparison.Comparator |
|
|
|
|
import net.pokeranalytics.android.model.filter.QueryCondition |
|
|
|
|
import net.pokeranalytics.android.ui.fragment.components.SessionObserverFragment |
|
|
|
|
import net.pokeranalytics.android.ui.view.CalendarTabs |
|
|
|
|
import timber.log.Timber |
|
|
|
|
import java.util.* |
|
|
|
|
import kotlin.coroutines.CoroutineContext |
|
|
|
|
|
|
|
|
|
@ -46,6 +47,8 @@ class CalendarFragment : SessionObserverFragment(), CoroutineScope { |
|
|
|
|
super.onViewCreated(view, savedInstanceState) |
|
|
|
|
initData() |
|
|
|
|
initUI() |
|
|
|
|
|
|
|
|
|
launchStatComputation() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -56,6 +59,7 @@ class CalendarFragment : SessionObserverFragment(), CoroutineScope { |
|
|
|
|
*/ |
|
|
|
|
private fun initData() { |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
val comparator = Comparator.MONTH // returns all months |
|
|
|
|
|
|
|
|
|
val conditions = comparator.queryConditions |
|
|
|
|
@ -66,8 +70,7 @@ class CalendarFragment : SessionObserverFragment(), CoroutineScope { |
|
|
|
|
Calculator.computeStatsWithComparators(realm, conditions = listOf(it), options = Calculator.Options()) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -86,8 +89,6 @@ class CalendarFragment : SessionObserverFragment(), CoroutineScope { |
|
|
|
|
|
|
|
|
|
val realm = getRealm() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GlobalScope.launch(coroutineContext) { |
|
|
|
|
|
|
|
|
|
var r = Report() |
|
|
|
|
@ -96,12 +97,20 @@ class CalendarFragment : SessionObserverFragment(), CoroutineScope { |
|
|
|
|
|
|
|
|
|
val realm = Realm.getDefaultInstance() |
|
|
|
|
|
|
|
|
|
Timber.d("Get report for: $it") |
|
|
|
|
|
|
|
|
|
val report = Calculator.computeStatsWithComparators(realm, conditions = listOf(it), options = Calculator.Options()) |
|
|
|
|
report.results.firstOrNull()?.let { |
|
|
|
|
|
|
|
|
|
Timber.d("Report: $report / Results: ${report.results.size}") |
|
|
|
|
|
|
|
|
|
report.results.firstOrNull()?.let { |
|
|
|
|
|
|
|
|
|
val isEmpty = it.isEmpty |
|
|
|
|
val statValue = it.computedStat(Stat.NETRESULT)?.value |
|
|
|
|
|
|
|
|
|
Timber.d("isEmpty: $isEmpty") |
|
|
|
|
Timber.d("statValue: $statValue") |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// r = createSessionGroupsAndStartCompute(realm) |
|
|
|
|
|