<commit_before>#include "CenterLinesScreen.h"

CenterLinesScreen::CenterLinesScreen(std::list<CLine> &lines, std::list<CLine> &ticks, std::list<CenterLinesScreen *> &screens)
	:lines(lines), ticks(ticks), screens(screens)
{
	auto hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &pD2DFactory);
	hr = pD2DFactory->CreateDCRenderTarget(&rt_properties, &render_target);
	D2D1_COLOR_F clcolor;
	clcolor.r = float(180) / float(255);
	clcolor.g = float(180) / float(255);
	clcolor.b = float(180) / float(255);
	clcolor.a = 1;
	render_target->CreateSolidColorBrush(clcolor, &pBlackBrush);
}

void CenterLinesScreen::OnAsrContentLoaded(bool loaded)
{
	if (!loaded)
		mode = Plugin_Mode::airport;
	else
	{
		auto str = GetDataFromAsr("Active");
		if (str == nullptr)
			mode = Plugin_Mode::airport;
		else
		{
			if (!strcmp("0", str))
				mode = Plugin_Mode::off;
			else if (!strcmp("1", str))
				mode = Plugin_Mode::runway;
			else if (!strcmp("2", str))
				mode = Plugin_Mode::airport;
			else if (!strcmp("3", str))
				mode = Plugin_Mode::on;
		}
	}
	RefreshMapContent();
}

void CenterLinesScreen::OnAsrContentToBeClosed()
{
	screens.remove(this);
	delete this;
}

void CenterLinesScreen::OnRefresh(HDC hDC, int phase)
{
	if (phase == EuroScopePlugIn::REFRESH_PHASE_BACK_BITMAP)
	{
		if (!initialized)<commit_msg>Default mode back to off<commit_after>#include "CenterLinesScreen.h"

CenterLinesScreen::CenterLinesScreen(std::list<CLine> &lines, std::list<CLine> &ticks, std::list<CenterLinesScreen *> &screens)
	:lines(lines), ticks(ticks), screens(screens)
{
	auto hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &pD2DFactory);
	hr = pD2DFactory->CreateDCRenderTarget(&rt_properties, &render_target);
	D2D1_COLOR_F clcolor;
	clcolor.r = float(180) / float(255);
	clcolor.g = float(180) / float(255);
	clcolor.b = float(180) / float(255);
	clcolor.a = 1;
	render_target->CreateSolidColorBrush(clcolor, &pBlackBrush);
}

void CenterLinesScreen::OnAsrContentLoaded(bool loaded)
{
	if (loaded)
	{
		auto str = GetDataFromAsr("Active");
		if (str == nullptr)
			mode = Plugin_Mode::off;
		else
		{
			if (!strcmp("0", str))
				mode = Plugin_Mode::off;
			else if (!strcmp("1", str))
				mode = Plugin_Mode::runway;
			else if (!strcmp("2", str))
				mode = Plugin_Mode::airport;
			else if (!strcmp("3", str))
				mode = Plugin_Mode::on;
		}
	}
	RefreshMapContent();
}

void CenterLinesScreen::OnAsrContentToBeClosed()
{
	screens.remove(this);
	delete this;
}

void CenterLinesScreen::OnRefresh(HDC hDC, int phase)
{
	if (phase == EuroScopePlugIn::REFRESH_PHASE_BACK_BITMAP)
	{
		if (!initialized)
{'fraction_non_alphanumeric': 0.15040183696900114, 'fraction_numerical': 0.023727516264829697, 'mean_word_length': 5.668367346938775, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4493900', 'n_tokens_mistral': 1088, 'n_tokens_neox': 988, 'n_words': 178}