-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://catalindumitru@github.com/catalindum…
…itru/Proiect-AI-2012---GUI.git
- Loading branch information
Showing
2 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.IO; | ||
using System.Threading; | ||
|
||
namespace ApelareCelelalteModule | ||
{ | ||
// numele clasei se poate schimba | ||
// asta mi-a venit pe moment | ||
public class ApelareModul | ||
{ | ||
public int ObtineStatus(Stream fisierXML) | ||
{ | ||
// se va cauta in baza de date fisierul | ||
// si se va returna statusul | ||
return 0; | ||
} | ||
|
||
public string ObtineTip(Stream fisierXML) | ||
{ | ||
// se va cauta in baza de date | ||
// si se va returna tipul | ||
return ""; | ||
} | ||
|
||
public Stream ObtineOutputul(Stream fisierXML) | ||
{ | ||
// se cauta in baza de date | ||
return null; | ||
} | ||
|
||
public Stream PrimesteCerere(Stream fisierXML) | ||
{ | ||
int status = ObtineStatus(fisierXML); | ||
if (status == 1) // verificam mai intai daca statusul este ok | ||
// adica, daca s-a terminat parsarea si poate intoarce rezultatul | ||
{ | ||
// se cauta in baza de date output.xml si se intoarce | ||
return ObtineOutputul(fisierXML); | ||
} | ||
// else | ||
string tip = ObtineTip(fisierXML); | ||
|
||
if (tip == "summary") | ||
{ | ||
// se seteaza statusul la 2 (parsing) | ||
ClientThread ct = new ClientThread(fisierXML); | ||
new Thread(new ThreadStart(ct.TrateazaCerere)).Start(); | ||
return null; | ||
} | ||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.IO; | ||
|
||
namespace ApelareCelelalteModule | ||
{ | ||
// Thread-ul in care se va trata cererea | ||
public class ClientThread | ||
{ | ||
private Stream fisierXML; | ||
public ClientThread(Stream fisierXML) | ||
{ | ||
this.fisierXML = fisierXML; | ||
} | ||
public void TrateazaCerere() | ||
{ | ||
// se va trata cererea baza lui fisierXML | ||
} | ||
} | ||
} |