Esempio n. 1
0
void VSDownloadMissing::onBannerComplete(MCFCore::Misc::DownloadProvider &info)
{
	if (isStopped())
		return;

	UserCore::Misc::GuiDownloadProvider gdp(MCFCore::Misc::DownloadProvider::ADD, &info);
	onNewProviderEvent(gdp);
}
Esempio n. 2
0
void VSDownloadMissing::onNewProvider(MCFCore::Misc::DP_s& dp)
{
	if (isStopped())
		return;

	if (!dp.provider)
		return;

	if (dp.action == MCFCore::Misc::DownloadProvider::ADD)
	{
		UserCore::User* pUser = dynamic_cast<UserCore::User*>(getUserCore());

		if (pUser)
			pUser->getBDManager()->downloadBanner(this, dp.provider);
	}
	else if (dp.action == MCFCore::Misc::DownloadProvider::REMOVE)
	{
		UserCore::Misc::GuiDownloadProvider gdp(MCFCore::Misc::DownloadProvider::REMOVE, dp.provider);
		onNewProviderEvent(gdp);
	}
}
Esempio n. 3
0
void firms::write_log(string model_name)
{
	for (map<int, firm>::iterator i = _firms.begin(); i != _firms.end(); ++i)
	{
		(i->second).write_log(model_name, i->first);
		//_log.setfirmaction(i->first, (i->second).getaction());
	}	
	ofstream fout;
	ostringstream fn;
	fn<<model_name<<"_average_price.txt";
	fout.open(fn.str(), ios_base::app);
	fout<<average_price()<<" ";;
	fout.close();
	fn.str("");
	fn<<model_name<<"_average_salary.txt";
	fout.open(fn.str(), ios_base::app);
	fout<<average_salary()<<" ";
	fout.close();
	fn.str("");
	fn<<model_name<<"_gdp.txt";
	fout.open(fn.str(), ios_base::app);
	fout<<gdp()<<" ";
	fout.close();
	fn.str("");
	fn<<model_name<<"_consumption.txt";
	fout.open(fn.str(), ios_base::app);
	fout<<consumption()<<" ";
	fout.close();
	fn.str("");
	fn<<model_name<<"_production.txt";
	fout.open(fn.str(), ios_base::app);
	fout<<production()<<" ";
	fout.close();
	fn.str("");
	fn<<model_name<<"_firm_number.txt";
	fout.open(fn.str(), ios_base::app);
	fout<<firm_number()<<" ";
	fout.close();
	fn.str("");
}