void CTypingHistoryAggregator::AddSubsetRequirementsForDate(CHTString sDateFilter)
{
   // TODO: figure out some way to support the week grouping option
   if (sDateFilter == "All")
      return;

   if (sDateFilter == "Today")
   {
      m_SubsetForLastBuild.SetSubsetRequirement("year", EValueComparison_Equal, GetCurrentYear());
      m_SubsetForLastBuild.SetSubsetRequirement("month", EValueComparison_Equal, GetCurrentMonth());
      m_SubsetForLastBuild.SetSubsetRequirement("day", EValueComparison_Equal, GetCurrentDay());
   }

   if (sDateFilter == "This Week" || sDateFilter == "Last Week")
   {
      int iWeek = sDateFilter == "This Week" ? GetCurrentWeek() : GetCurrentWeek()-1;

      m_SubsetForLastBuild.SetSubsetRequirement("year", EValueComparison_Equal, GetCurrentYear());
      m_SubsetForLastBuild.SetSubsetRequirement("week", EValueComparison_Equal, iWeek);
   }

   if (sDateFilter == "This Month")
   {
      m_SubsetForLastBuild.SetSubsetRequirement("year", EValueComparison_Equal, GetCurrentYear());
      m_SubsetForLastBuild.SetSubsetRequirement("month", EValueComparison_Equal, GetCurrentMonth());
   }
}
//获取每个变电站发生的告警次数
std::vector<ALARM_STATISTICS> GetAlarmStatisticsInfo()
{
	int nYear = GetCurrentYear();
	std::vector<ALARM_STATISTICS> vecAlarmStatistics;
	CString str;
	str.Format("select count(*),d.station_name,d.rvu_id,d.station_id from "
		"(select a.rvu_id as rvu_id,b.station_id as station_id,c.station_name_videoplant as station_name from ass_alarm_%d a  "
		"LEFT JOIN ass_rvu b on a.rvu_id=b.rvu_id  "
		"LEFT JOIN ob_d5000_station c on b.station_id=c.station_id) as d GROUP BY d.station_id ", nYear);

	int re = mysql_query(g_mySqlData,str);
	if (re!=0){
		TRACE0("execute sql failed.");
	}

	MYSQL_RES	*res;
	MYSQL_ROW	row;
	res = mysql_store_result(g_mySqlData);
	while (row = mysql_fetch_row(res)){
		ALARM_STATISTICS tAlarmStatistics;
		tAlarmStatistics.nAlarmCount = atoi(row[0]);
		tAlarmStatistics.nStationId = atoi(row[3]);
		sprintf_s(tAlarmStatistics.szStationName, 64, row[1]);
		vecAlarmStatistics.push_back(tAlarmStatistics);
	}
	mysql_free_result(res) ;

	return vecAlarmStatistics;
}
//根据告警ID更新该条告警为已完成
bool UpdateAlarmInfoToCompleted(int nAlarmID, int nAlarmStatus)
{
	int nYear = GetCurrentYear();
	CString strCurrentTime = GetCurrentProcessAlarmTime();
	CString str;
	str.Format("UPDATE ass_alarm_%d set process_status=%d,process_time='%s',process_person='%s' where id=%d", 
		nYear, nAlarmStatus, strCurrentTime, g_userpower.username, nAlarmID);

	if (mysql_query(g_mySqlData, str))
	{
		return false;
	}
}
std::vector<_T_ASS_SUBSYSTEM_ALARM_COUNT> GetSubSystemAlarmCount(CString strCondition)
{
	std::vector<_T_ASS_SUBSYSTEM_ALARM_COUNT> vecSubSystemAlarmCount;

	int nYear = GetCurrentYear();
	CString str;
	str.Format("select station_name, "
		" MAX(CASE sub_system WHEN 2 THEN alarm_count ELSE 0 END) as '门禁告警次数', "
		" MAX(CASE sub_system WHEN 4 THEN alarm_count ELSE 0 END) as '安防告警次数', "
		" MAX(CASE sub_system WHEN 6 THEN alarm_count ELSE 0 END) as '消防告警次数' "
		" from(select e.station_name_videoplant as station_name,c.f_parent_id as sub_system,count(*) as alarm_count from ass_alarm_%d as a  "
		" left join ass_rvu_sm as b on a.dev_id=b.id "
		" left join ass_rvu_sm_device_type as c on b.device_type=c.f_device_type_num "
		" left join ass_rvu as d on a.rvu_id=d.rvu_id "
		" LEFT JOIN ob_d5000_station e on d.station_id=e.station_id "
		" %s "
		" GROUP BY c.f_parent_id,e.station_name_videoplant) as AA  GROUP BY station_name ", nYear, strCondition);

	int re = mysql_query(g_mySqlData,str);
	if (re!=0){
		TRACE0("execute sql failed.");
	}

	MYSQL_RES	*res;
	MYSQL_ROW	row;
	res = mysql_store_result(g_mySqlData);
	while (row = mysql_fetch_row(res)){
		_T_ASS_SUBSYSTEM_ALARM_COUNT tAssSubSystemAlarm;
		sprintf_s(tAssSubSystemAlarm.szStationName, 64, row[0]);
		tAssSubSystemAlarm.nDoorCount = atoi(row[1]);
		tAssSubSystemAlarm.nAnFangCount = atoi(row[2]);
		tAssSubSystemAlarm.nFireCount = atoi(row[3]);

		vecSubSystemAlarmCount.push_back(tAssSubSystemAlarm);
	}

	mysql_free_result(res) ;

	return vecSubSystemAlarmCount;
}
//根据变电站和告警类型,获取未处理告警信息
std::vector<ACS_ALARM_INFO> GetAlarmInfoByStationId(CString strCondition)
{
	std::vector<ACS_ALARM_INFO> vecAlarmInfo;

	int nYear = GetCurrentYear();
	CString str;
	str.Format("select a.id,c.station_name_videoplant,e.`name`,f.f_device_type_name,a.start_time,a.alarm_level,a.process_status from ass_alarm_%d as a "
		" left join ass_rvu as b on a.rvu_id=b.rvu_id "
		" left join ob_d5000_station as c on b.station_id=c.station_id "
		" left join ass_rvu_sm as e on a.dev_id=e.id "
		" left join ass_rvu_sm_device_type as f on e.device_type=f.f_device_type_num "
	" where %s  ", nYear, strCondition);

	int re = mysql_query(g_mySqlData,str);
	if (re!=0){
		TRACE0("execute sql failed.");
	}

	MYSQL_RES	*res;
	MYSQL_ROW	row;
	res = mysql_store_result(g_mySqlData);
	while (row = mysql_fetch_row(res)){
		ACS_ALARM_INFO tAlarmInfo;
		tAlarmInfo.nId = atoi(row[0]);
		sprintf_s(tAlarmInfo.szStationName, 32, row[1]);
		sprintf_s(tAlarmInfo.szDevName, 32, row[2]);
		sprintf_s(tAlarmInfo.szAlarmTypeName, 32, row[3]);
		sprintf_s(tAlarmInfo.szAlarmStartTime, 32, row[4]);
		tAlarmInfo.nPriorLevel = atoi(row[5]);

		vecAlarmInfo.push_back(tAlarmInfo);
	}

	mysql_free_result(res) ;

	return vecAlarmInfo;
}
Beispiel #6
0
/**
 *  Konstruktor von @p iwOptionsWindow.
 *
 *  @author OLiver
 */
iwOptionsWindow::iwOptionsWindow(dskGameInterface* gameDesktop)
    : IngameWindow(CGI_OPTIONSWINDOW, 0xFFFF, 0xFFFF, 300, 515, _("Game menu"), LOADER.GetImageN("resource", 41))
{
    this->gameDesktop = gameDesktop;

    // Der Soldat oben
    AddImage(1, 150, 36, LOADER.GetImageN("io", 30));

    // Versionszeile
    AddVarText(2, 150, 76, _("Return To The Roots v%s-%s"), COLOR_YELLOW, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_BOTTOM, NormalFont, 2, GetWindowVersion(), GetWindowRevisionShort());
    // Copyright
    AddVarText(3, 150, 96, _("© 2005 - %s Settlers Freaks"), COLOR_YELLOW, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_BOTTOM, NormalFont, 1, GetCurrentYear());

    // "Tastaturbelegung"
    AddImageButton(4, 35, 120, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 79));
    AddText(5, 85, 140, _("Keyboard layout"), COLOR_YELLOW, 0 | glArchivItem_Font::DF_BOTTOM, NormalFont);

    // "'Lies mich'-Datei laden"
    AddImageButton(6, 35, 160, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 79));
    AddText(7, 85, 180, _("Load 'ReadMe' file"), COLOR_YELLOW, 0 | glArchivItem_Font::DF_BOTTOM, NormalFont);

    // "Spiel laden!"
    AddImageButton( 8, 35, 210, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 48));
    AddText(9, 85, 230, _("Load game!"), COLOR_YELLOW, 0 | glArchivItem_Font::DF_BOTTOM, NormalFont);

    // "Spiel speichern!"
    AddImageButton(10, 35, 250, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 47));
    AddText(11, 85, 270, _("Save game!"), COLOR_YELLOW, 0 | glArchivItem_Font::DF_BOTTOM, NormalFont);

    // Geräusche an/aus
    AddImageButton(12, 35, 300, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 114 + !SETTINGS.sound.effekte));

    // Musik an/aus
    AddImageButton(13, 35, 340, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 116 + !SETTINGS.sound.musik));

    // Geräuschlautstärke
    AddProgress(14, 100, 306, 160, 22, TC_GREEN2, 139, 138, 10)
    ->SetPosition(SETTINGS.sound.effekte_volume * 10 / 255);

    // Musiklautstärke
    AddProgress(15, 100, 346, 160, 22, TC_GREEN2, 139, 138, 10)
    ->SetPosition(SETTINGS.sound.musik_volume * 10 / 255);

    //// Music Player
    AddTextButton(16, 100, 380, 160, 22, TC_GREEN2, _("Music player"), NormalFont);

    // Advanced Options
    AddTextButton(18, 67, 412, 168, 24, TC_GREEN2, _("Advanced"), NormalFont);

    // "Spiel aufgeben"
    AddTextButton(17, 67, 443, 168, 24, TC_RED1, _("Surrender"), NormalFont);
    // "Spiel beenden"
    AddTextButton(0, 67, 474, 168, 24, TC_RED1, _("End game"), NormalFont);

}
Beispiel #7
0
/**
 *  Konstruktor von @p dskLobby.
 *
 *  @author FloSoft
 *  @author Devil
 */
dskLobby::dskLobby() : Desktop(LOADER.GetImageN("setup013", 0)), serverinfo(NULL), servercreate(NULL)
{
    // Version
    AddVarText(0, 0, 600, _("Return To The Roots - v%s-%s"), COLOR_YELLOW, 0 | glArchivItem_Font::DF_BOTTOM, NormalFont, 2, GetWindowVersion(), GetWindowRevisionShort());
    // URL
    AddText(1, 400, 600, _("http://www.siedler25.org"), COLOR_GREEN, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_BOTTOM, NormalFont);
    // Copyright
    AddVarText(2, 800, 600, _("© 2005 - %s Settlers Freaks"), COLOR_YELLOW, glArchivItem_Font::DF_RIGHT | glArchivItem_Font::DF_BOTTOM, NormalFont, 1, GetCurrentYear());

    // "Zurück"
    AddTextButton(3, 530, 530, 250, 22, TC_RED1, _("Back"), NormalFont);
    // "Verbinden"
    AddTextButton(4, 530, 470, 250, 22, TC_GREEN2, _("Connect"), NormalFont);
    // "Internet Ranking"
    AddTextButton(5, 530, 500, 250, 22, TC_GREEN2, _("Internet Ranking"), NormalFont);
    // "Server hinzufügen"
    AddTextButton(6, 530, 440, 250, 22, TC_GREEN2, _("Add Server"), NormalFont);

    // Gameserver-Tabelle - "ID", "Server", "Karte", "Spieler", "Version", "Ping"
    AddTable(10, 20, 20, 500, 262, TC_GREY, NormalFont, 6, _("ID"), 0, ctrlTable::SRT_NUMBER, _("Server"), 300, ctrlTable::SRT_STRING, _("Map"), 300, ctrlTable::SRT_STRING, _("Player"), 200, ctrlTable::SRT_NUMBER, _("Version"), 100, ctrlTable::SRT_STRING, _("Ping"), 100, ctrlTable::SRT_NUMBER);
    // Spieler-Tabelle - "Name", "Punkte", "Version"
    AddTable(11, 530, 20, 250, 410, TC_GREY, NormalFont, 3, _("Name"), 500, ctrlTable::SRT_STRING, _("Points"), 250, ctrlTable::SRT_STRING, _("Version"), 250, ctrlTable::SRT_STRING);

    // Chatfenster
    AddChatCtrl(20, 20, 290, 500, 238, TC_GREY, NormalFont);
    // Chatfenster-Edit
    AddEdit(21, 20, 530, 500, 22, TC_GREY, NormalFont);

    AddTimer(30, 5000);

    UpdateServerList(true);
    UpdatePlayerList(true);

    LOBBYCLIENT.SetInterface(this);
    LOBBYCLIENT.SendServerListRequest();
    LOBBYCLIENT.SendPlayerListRequest();

    GAMECLIENT.SetInterface(this);
}
dskMainMenu::dskMainMenu() : Desktop(LOADER.GetImageN("menu", 0))
{
    // Version
    AddVarText(0, 0, 600, _("Return To The Roots - v%s-%s"), COLOR_YELLOW, 0 | glArchivItem_Font::DF_BOTTOM, NormalFont, 2, GetWindowVersion(), GetWindowRevisionShort());
    // URL
    AddText(1, 400, 600, _("http://www.siedler25.org"), COLOR_GREEN, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_BOTTOM, NormalFont);
    // Copyright
    AddVarText(2, 800, 600, _("© 2005 - %s Settlers Freaks"), COLOR_YELLOW, glArchivItem_Font::DF_RIGHT | glArchivItem_Font::DF_BOTTOM, NormalFont, 1, GetCurrentYear());

    // "Einzelspieler"
    AddTextButton(4, 115, 180, 220, 22, TC_GREEN2, _("Singleplayer"), NormalFont);
    // "Mehrspieler"
    AddTextButton(5, 115, 210, 220, 22, TC_GREEN2, _("Multiplayer"), NormalFont);
    // "Optionen"
    AddTextButton(6, 115, 250, 220, 22, TC_GREEN2, _("Options"), NormalFont);
    // "Intro"
    AddTextButton(7, 115, 280, 220, 22, TC_GREEN2, _("Intro"), NormalFont);
    // "ReadMe"
    AddTextButton(10, 115, 310, 220, 22, TC_GREEN2, _("Readme"), NormalFont);
    // "Credits"
    AddTextButton(8, 115, 340, 220, 22, TC_GREEN2, _("Credits"), NormalFont);
    // "Programm verlassen"
    AddTextButton(9, 115, 390, 220, 22, TC_RED1, _("Quit program"), NormalFont);

    AddImage(11, 20, 20, LOADER.GetImageN("logo", 0));

    if (SETTINGS.global.submit_debug_data == 0)
    {
        AddTimer(20, 250);
    }

    /*AddText(20, 50, 450, _("Font Test"), COLOR_YELLOW, glArchivItem_Font::DF_LEFT, SmallFont);
    AddText(21, 50, 470, _("Font Test"), COLOR_YELLOW, glArchivItem_Font::DF_LEFT, NormalFont);
    AddText(22, 50, 490, _("Font Test"), COLOR_YELLOW, glArchivItem_Font::DF_LEFT, LargeFont);*/
    //  !\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz\\_ABCDEFGHIJKLMNOPQRSTUVWXYZÇüéâäàåçêëèïîì©ÄÅôöòûùÖÜáíóúñ
}
Beispiel #9
0
/**
 *  Konstruktor von @p dskSinglePlayer.
 *
 *  @author OLiver
 *  @author FloSoft
 */
dskSinglePlayer::dskSinglePlayer(void) : Desktop(LOADER.GetImageN("menu", 0))
{
    // Version
    AddVarText(0, 0, 600, _("Return To The Roots - v%s-%s"), COLOR_YELLOW, 0 | glArchivItem_Font::DF_BOTTOM, NormalFont, 2, GetWindowVersion(), GetWindowRevision());
    // URL
    AddText(1, 400, 600, _("http://www.siedler25.org"), COLOR_GREEN, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_BOTTOM, NormalFont);
    // Copyright
    AddVarText(2, 800, 600, _("\xA9 2005 - %s Settlers Freaks"), COLOR_YELLOW, glArchivItem_Font::DF_RIGHT | glArchivItem_Font::DF_BOTTOM, NormalFont, 1, GetCurrentYear());

    // "Letztes Spiel fortsetzen"
    AddTextButton(3, 115, 180, 220, 22, TC_GREEN2, _("Resume last game"), NormalFont);
    // "Replay abspielen"
    AddTextButton(4, 115, 220, 220, 22, TC_GREEN2, _("Play Replay"), NormalFont);
    // "Kampagne"
    AddTextButton(5, 115, 260, 220, 22, TC_GREEN2, _("Campaign"), NormalFont);
    // "Freies Spiel"
    AddTextButton(6, 115, 290, 220, 22, TC_GREEN2, _("Unlimited Play"), NormalFont);
    // "Spiel laden"
    AddTextButton(7, 115, 320, 220, 22, TC_GREEN2, _("Load game"), NormalFont);
    // "Zurück"
    AddTextButton(8, 115, 360, 220, 22, TC_RED1, _("Back"), NormalFont);

    AddImage(11, 20, 20, LOADER.GetImageN("logo", 0));
}
Beispiel #10
0
dskLAN::dskLAN() : Desktop(LOADER.GetImageN("setup013", 0)), discovery(LAN_DISCOVERY_CFG)
{
    // Version
    AddVarText(0, 0, 600, _("Return To The Roots - v%s-%s"), COLOR_YELLOW, 0 | glArchivItem_Font::DF_BOTTOM, NormalFont, 2, GetWindowVersion(), GetWindowRevisionShort());
    // URL
    AddText(1, 400, 600, _("http://www.siedler25.org"), COLOR_GREEN, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_BOTTOM, NormalFont);
    // Copyright
    AddVarText(2, 800, 600, _("© 2005 - %s Settlers Freaks"), COLOR_YELLOW, glArchivItem_Font::DF_RIGHT | glArchivItem_Font::DF_BOTTOM, NormalFont, 1, GetCurrentYear());

    // "Server hinzufügen"
    AddTextButton(btAddServerId, 530, 250, 250, 22, TC_GREEN2, _("Add Server"), NormalFont);
    // "Verbinden"
    AddTextButton(btConnectId, 530, 280, 250, 22, TC_GREEN2, _("Connect"), NormalFont);
    // "Zurück"
    AddTextButton(btBackId, 530, 530, 250, 22, TC_RED1, _("Back"), NormalFont);

    // Gameserver-Tabelle - "ID", "Server", "Karte", "Spieler", "Version"
    AddTable(tblServerId, 20, 20, 500, 530, TC_GREY, NormalFont, 5, _("ID"), 0, ctrlTable::SRT_NUMBER, _("Server"), 300, ctrlTable::SRT_STRING, _("Map"), 300, ctrlTable::SRT_STRING, _("Player"), 200, ctrlTable::SRT_STRING, _("Version"), 100, ctrlTable::SRT_STRING);

    discovery.Start();

    AddTimer(tmrRefreshServersId, 60000); // Servers broadcast changes, so force a full update only once a minute
    AddTimer(tmrRefreshListId, 2000);
}