Skip to content

Commit

Permalink
PciModule integrated in to analyze os and modules.pcimap.. OS additio…
Browse files Browse the repository at this point in the history
…n almost complete..

git-svn-id: svn+ssh://svn.gna.org/svn/harix/trunk@19 93407c37-4ef6-48a3-b47d-bdf02b9e85ca
  • Loading branch information
alperenkose committed Jul 4, 2010
1 parent ec17122 commit 6286837
Show file tree
Hide file tree
Showing 11 changed files with 425 additions and 68 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
top="$(CURDIR)"/
ede_FILES=Project.ede Makefile

query_pcimap_wt_SOURCES=pcimapQuery.cc main.cc harixApp.cc pcimapResult.cc database.cc home.cc analyzeOS.cc
query_pcimap.wt_OBJ= pcimapQuery.o main.o harixApp.o pcimapResult.o database.o home.o analyzeOS.o
query_pcimap_wt_SOURCES=main.cc harixApp.cc database.cc home.cc lspci_query/pcimapQuery.cc lspci_query/pcimapResult.cc analyze_os/analyzeOS.cc pci_module/os_pci_module.cc pci_module/pci_moduleDB.cc
query_pcimap.wt_OBJ= main.o harixApp.o database.o home.o lspci_query/pcimapQuery.o lspci_query/pcimapResult.o analyze_os/analyzeOS.o pci_module/os_pci_module.o pci_module/pci_moduleDB.o
CXX= g++
CFLAGS= -g -Wall -Weffc++
LIBDIRS= -L/usr/local/lib
Expand All @@ -25,7 +25,7 @@ VERSION=1.0
DISTDIR=$(top)Harix PreAlpha-$(VERSION)
top_builddir =

DEP_FILES=.deps/pcimapQuery.P .deps/main.P .deps/harixApp.P .deps/pcimapResult.P .deps/database.P .deps/home.P .deps/analyzeOS.P .deps/pci_device.P .deps/pcimapQuery.P .deps/harixApp.P .deps/pcimapResult.P .deps/home.P .deps/analyzeOS.P .deps/os_info.P
DEP_FILES=.deps/main.P .deps/harixApp.P .deps/database.P .deps/home.P .deps/pcimapQuery.P .deps/pcimapResult.P .deps/analyzeOS.P .deps/os_pci_module.P .deps/pci_moduleDB.P .deps/pci_device.P .deps/harixApp.P .deps/home.P .deps/os_info.P .deps/pcimapQuery.P .deps/pcimapResult.P .deps/analyzeOS.P

all: query_pcimap.wt

Expand Down
2 changes: 1 addition & 1 deletion Project.ede
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
(ede-proj-target-makefile-program "query_pcimap.wt"
:name "query_pcimap.wt"
:path ""
:source '("main.cc" "harixApp.cc" "database.cc" "home.cc" "lspci_query/pcimapQuery.cc" "lspci_query/pcimapResult.cc" "analyze_os/analyzeOS.cc")
:source '("main.cc" "harixApp.cc" "database.cc" "home.cc" "lspci_query/pcimapQuery.cc" "lspci_query/pcimapResult.cc" "analyze_os/analyzeOS.cc" "pci_module/os_pci_module.cc" "pci_module/pci_moduleDB.cc")
:auxsource '("pci_device.hpp" "harixApp.hpp" "home.hpp" "os_info.hpp" "lspci_query/pcimapQuery.hpp" "lspci_query/pcimapResult.hpp" "analyze_os/analyzeOS.hpp")
)
)
Expand Down
5 changes: 2 additions & 3 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---- UPDATE "PCIMAP MODULES" TO MAKE UPDATE ON DATABASE!!! NOT JUST CREATE..
---- PAY ATTENTION ON EXISTING OS OR RELEASE, SO JUST UPDATING THE APPROPRIATE PARTS..

-- 'Loading Indicator'la os analyze sirasinda beklet!! hicbir yere basilmasin!! widget example..

- Start from the startup screen, first draw a design what it might look like..
Follow the notebook..
Expand All @@ -10,4 +10,3 @@ Follow the notebook..

- DATABASE
** Classes and Devices sections in database needs update procedure!!!!!
* if OS is know but pcimap needs updating? Put update procedure for pcimape!
40 changes: 23 additions & 17 deletions analyze_os/analyzeOS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ AnalyzeOsWidget::AnalyzeOsWidget( WContainerWidget* parent ) : WContainerWidget(
layoutAnalyze_->elementAt(4,0)->addWidget( bUpload_ = new WPushButton("Upload") );

// Upload when the button is clicked.
// bUpload_->clicked().connect(SLOT(uploadOs_, Wt::WFileUpload::upload));
// bUpload_->clicked().connect(SLOT(uploadPcimap_, Wt::WFileUpload::upload));
bUpload_->clicked().connect(this, &AnalyzeOsWidget::bUpload_Click);

// React to a succesfull upload.
Expand All @@ -53,15 +51,6 @@ AnalyzeOsWidget::AnalyzeOsWidget( WContainerWidget* parent ) : WContainerWidget(
WTable* layoutResult;
panelAnalyzeResult_->setCentralWidget( layoutResult = new WTable() );

// layoutResult->elementAt(0,0)->addWidget( new WText("Detected Operating System" ) );
// layoutResult->elementAt(1,0)->addWidget( new WText("OS Name:" ) );
// layoutResult->elementAt(1,1)->addWidget( editOs_ = new WLineEdit() );
// layoutResult->elementAt(2,0)->addWidget( new WText("Release:" ) );
// layoutResult->elementAt(2,1)->addWidget( editRel_ = new WLineEdit() );
// layoutResult->elementAt(3,0)->addWidget( new WText("Kernel :" ) );
// layoutResult->elementAt(3,1)->addWidget( editKer_ = new WLineEdit() );
// layoutResult->elementAt(4,0)->addWidget( new WText("Arch. :" ) );
// layoutResult->elementAt(4,1)->addWidget( editArch_ = new WLineEdit() );

layoutResult->elementAt(0,0)->addWidget( groupDetectedOs_ = new WGroupBox("Detected Operating System") );
WTable* layoutDetectedOs;
Expand All @@ -76,6 +65,7 @@ AnalyzeOsWidget::AnalyzeOsWidget( WContainerWidget* parent ) : WContainerWidget(
layoutDetectedOs->elementAt(3,1)->addWidget( editArch_ = new WLineEdit() );
layoutDetectedOs->elementAt(4,0)->addWidget( bCheckOs_ = new WPushButton("Check Record") );
bCheckOs_->clicked().connect(this, &AnalyzeOsWidget::bCheckOs_Click);
// @TODO: ADD EDIT BUTTON TO MANUALY CHANGE OS INFO

layoutResult->columnAt(1)->setWidth( WLength(50) );

Expand All @@ -86,6 +76,9 @@ AnalyzeOsWidget::AnalyzeOsWidget( WContainerWidget* parent ) : WContainerWidget(
layoutCheckResult_->elementAt(1,1)->addWidget( bOsCancel_ = new WPushButton("Cancel / Edit") );
layoutCheckResult_->hide();

bOsAddUpdate_->clicked().connect(this, &AnalyzeOsWidget::bOsAddUpdate_Click);
bOsCancel_->clicked().connect(this, &AnalyzeOsWidget::bOsCancel_Click);

addWidget(new WBreak());

addWidget( bGoHome_ = new WPushButton("Go Home"));
Expand All @@ -96,14 +89,11 @@ AnalyzeOsWidget::AnalyzeOsWidget( WContainerWidget* parent ) : WContainerWidget(
AnalyzeOsWidget* AnalyzeOsWidget::Instance( WContainerWidget* parent)
{
if( parent == 0 ){
// wApp->log("debug") << "parent is 0!"; // @test
if ( !instance_ ){
// wApp->log("debug") << "no instance return NULL!!"; // @test
return NULL;
}
}
else{
// wApp->log("debug") << "received parent!"; // @test
if( !instance_ ){
instance_ = new AnalyzeOsWidget(parent);
// wApp->log("debug") << "Object initiated!!"; // @test
Expand Down Expand Up @@ -184,18 +174,31 @@ void AnalyzeOsWidget::bCheckOs_Click()
osKernelId=queryOsKernelId(osDist_->getDistro(),osDist_->getRelease(),osDist_->getKernel(),osDist_->getArch());
if( osKernelId != ""){
// OS Found!
// show ukernelid!!!!
txtOsResult_->setText("Operating System Already in Database!");
bOsAddUpdate_->setText("Update Pcimap!");
layoutCheckResult_->show();
}
else{
// Os not found..
txtOsResult_->setText("Add Operating System to Database");
txtOsResult_->setText("Operating System NOT Found! <br /> Add Operating System to Database");
bOsAddUpdate_->setText("Add OS!");
layoutCheckResult_->show();
}
// editArch_->setText(osKernelId); // @test
}

void os_pci_module( OsInfo osInfo, std::string pcimapFile ); // external os_pci_module.cc

void AnalyzeOsWidget::bOsAddUpdate_Click()
{
os_pci_module( *osDist_, pcimap_file_ );
bOsCancel_Click(); // @test
// @TODO: put a popup here, informing addition of OS or pcimap update..
}

void AnalyzeOsWidget::bOsCancel_Click()
{
layoutCheckResult_->hide();
groupDetectedOs_->enable();
}

void AnalyzeOsWidget::bGoHome_Click()
Expand Down Expand Up @@ -224,4 +227,7 @@ void AnalyzeOsWidget::resetAll()

panelAnalyze_->show();
panelAnalyzeResult_->hide();

layoutCheckResult_->hide();
groupDetectedOs_->enable();
}
2 changes: 2 additions & 0 deletions analyze_os/analyzeOS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class AnalyzeOsWidget : public Wt::WContainerWidget

Wt::WText* txtOsResult_;
Wt::WPushButton *bOsAddUpdate_, *bOsCancel_;
void bOsAddUpdate_Click();
void bOsCancel_Click();

Wt::WFileUpload* uploadOs_, *uploadPcimap_;
Wt::WPushButton* bUpload_;
Expand Down
Loading

0 comments on commit 6286837

Please sign in to comment.