Ejemplo n.º 1
0
void FeaturesStatistics::SaveToFile()
{
	GML::Utils::File	f;

	if (f.Create(ResultFile.GetText())==false)
	{
		notif->Error("[%s] -> Unable to create file : %s",ObjectName,ResultFile.GetText());
		return;
	}
	UInt32					tr;
	GML::Utils::GString		str,line;

	if (CreateHeaders(str)==false)
	{
		notif->Error("[%s] -> Unable to create table headers !",ObjectName);
		return;
	}
	line.Set("");
	while (line.Len()<str.Len())
		line.AddChar('-');
	str.Add("\n");
	line.Add("\n");
	if (f.Write(str.GetText(),str.Len())==false)
	{
		notif->Error("[%s] -> Unable to write to file : %s",ObjectName,ResultFile.GetText());
		return;
	}
	if (f.Write(line.GetText(),str.Len())==false)
	{
		notif->Error("[%s] -> Unable to write to file : %s",ObjectName,ResultFile.GetText());
		return;
	}

	for (tr=0;tr<con->GetFeatureCount();tr++)
	{
		if (!Validate(&Feats[ComputedData[tr].Index]))
			continue;
		if (CreateRecordInfo(ComputedData[tr],str)==false)
		{
			notif->Error("[%s] -> Unable to create record line !",ObjectName);
			return;
		}
		str.Add("\n");
		if (f.Write(str.GetText(),str.Len())==false)
		{
			notif->Error("[%s] -> Unable to write to file : %s",ObjectName,ResultFile.GetText());
			return;
		}		
	}
	if (f.Write(line.GetText(),str.Len())==false)
	{
		notif->Error("[%s] -> Unable to write to file : %s",ObjectName,ResultFile.GetText());
		return;
	}
	f.Close();
	notif->Info("[%s] -> %s table saved !",ObjectName,ResultFile.GetText());
}
Ejemplo n.º 2
0
void FeaturesStatistics::PrintStats()
{
	UInt32					tr;
	GML::Utils::GString		str,line;

	if (CreateHeaders(str)==false)
	{
		notif->Error("[%s] -> Unable to create table headers !",ObjectName);
		return;
	}
	line.Set("");
	while (line.Len()<str.Len())
		line.AddChar('-');
	if (notif->SuportsObjects())
	{
		str.Insert("Insert:",0);
		notif->SendDataToObject("FeatTable",str.GetText());
	} else {
		notif->Info(str.GetText());
		notif->Info(line.GetText());
	}
	for (tr=0;tr<con->GetFeatureCount();tr++)
	{
		if (!Validate(&Feats[ComputedData[tr].Index]))
			continue;
		if (CreateRecordInfo(ComputedData[tr],str)==false)
		{
			notif->Error("[%s] -> Unable to create record line !",ObjectName);
			return;
		}
		if (notif->SuportsObjects())
		{
			str.Insert("Insert:",0);
			notif->SendDataToObject("FeatTable",str.GetText());
		} else {
			notif->Info(str.GetText());
		}
	}
	if (notif->SuportsObjects()==false)
		notif->Info(line.GetText());
}
Ejemplo n.º 3
0
CViewTasks::CViewTasks(wxNotebook* pNotebook, BSLHOST hHost) :
     CViewBase(pNotebook, ID_TASK_WORKVIEW, DEFAULT_TASK_FLAGS, ID_LIST_WORKVIEW, DEFAULT_LIST_FLAGS)
{
    //
    // Store host handle for future use
    //
    m_hHost = hHost;

    // Initialize List View
    CreateTasks();
    CreateHeaders();

    // Initialize Column Sorting Mechinism
    m_bSortUpdatedColumns.resize(COLUMN_STATUS + 1);

    // Restore State
    RestoreState();

    // Give time for all the controls to figure out their layout and render
    // properly.
    wxCommandEvent evt(wxEVT_VIEWTASKS_INIT);
    AddPendingEvent(evt);
}