Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
|
projets:infini:info-reseau:accueil [2015/10/06 23:35] resonance créée |
projets:infini:info-reseau:accueil [2016/05/24 12:36] (Version actuelle) resonance [Principe de fonctionnement] |
||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ====== Informatique et réseau ====== | ====== Informatique et réseau ====== | ||
| + | |||
| + | |||
| + | * Référant(s) : ... | ||
| + | * Classe(s) : ... | ||
| + | |||
| + | |||
| + | ===== Principe de fonctionnement ===== | ||
| + | |||
| + | {{: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | |||
| + | ===== Messages ===== | ||
| + | |||
| + | ==== Ordinateur > ENG ==== | ||
| + | <code cpp> | ||
| + | "id on speed pan tilt reserved" | ||
| + | id : " | ||
| + | on : caractère 30 pour on, 31 pour off | ||
| + | speed : | ||
| + | pan : | ||
| + | tilt : | ||
| + | reserved : on ajoute un caractère pour un besoin futur | ||
| + | </ | ||
| + | |||
| + | ==== ENG > Ordinateur ==== | ||
| + | <code cpp> | ||
| + | "id tension inclinaison vitesseDeRotation choc reserved" | ||
| + | id : " | ||
| + | tension : | ||
| + | inclinaison : | ||
| + | vitesseDeRotation : | ||
| + | choc : caractère 30 si un choc, 31 si aucun | ||
| + | reserved : on ajoute un caractère pour un besoin futur | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ===== Comportements ===== | ||
| + | {{: | ||
| + | ===== Code Web ===== | ||
| + | |||
| + | ====mars 2016 (stéphane)==== | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | ++++ Code Processing | | ||
| + | <code java> | ||
| + | import java.util.regex.Matcher; | ||
| + | import java.util.regex.Pattern; | ||
| + | |||
| + | StringList tweetsAff = new StringList(); | ||
| + | int yAffDebut = 14; | ||
| + | |||
| + | void setup() { | ||
| + | size(800, 600); | ||
| + | PFont f = createFont(" | ||
| + | textFont(f); | ||
| + | textAlign (LEFT, LEFT); | ||
| + | textSize(12); | ||
| + | fill(0); | ||
| + | nouveauxTweets(); | ||
| + | String[] aEnregistrer = new String[tweetsAff.size()]; | ||
| + | for (int i = 0; i< | ||
| + | aEnregistrer[i] = tweetsAff.get(i); | ||
| + | } | ||
| + | saveStrings(" | ||
| + | } | ||
| + | |||
| + | void draw() { | ||
| + | background(255); | ||
| + | for (int i = 0; i< | ||
| + | text(tweetsAff.get(i), | ||
| + | } | ||
| + | } | ||
| + | |||
| + | void nouveauxTweets() { | ||
| + | tweetsAff = new StringList(); | ||
| + | String [] sourceTweet = {" | ||
| + | for (int s = 0; s < sourceTweet.length; | ||
| + | String lines[] = loadStrings(" | ||
| + | String html = join(lines, " | ||
| + | String[][] mLigne = matchAll(html, | ||
| + | for (int i = 0; i< | ||
| + | String texte = mLigne[i][1].replaceAll(" | ||
| + | texte = remplaceHtml(texte); | ||
| + | texte = finTweet(texte); | ||
| + | print(texte); | ||
| + | tweetsAff.append(texte); | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | String remplaceHtml(String texte) { | ||
| + | String[] charHtml = {"&# | ||
| + | String[] remplace = {"'", | ||
| + | for (int i=0; i< | ||
| + | String REGEX = charHtml[i]; | ||
| + | String REPLACE = remplace[i]; | ||
| + | Pattern p = Pattern.compile(REGEX); | ||
| + | Matcher m = p.matcher(texte); | ||
| + | texte = m.replaceAll(REPLACE); | ||
| + | } | ||
| + | return texte; | ||
| + | } | ||
| + | |||
| + | String finTweet(String texte) { | ||
| + | String[] baliseFin = {" | ||
| + | for (int i = 0; i< baliseFin.length; | ||
| + | int pFin = texte.indexOf(baliseFin[i]); | ||
| + | if (pFin > 0) { | ||
| + | texte = texte.substring(0, | ||
| + | } | ||
| + | } | ||
| + | return texte; | ||
| + | } | ||
| + | |||
| + | void keyPressed() { | ||
| + | if (key == CODED) { | ||
| + | if (keyCode == UP) { | ||
| + | yAffDebut +=5; | ||
| + | } | ||
| + | if (keyCode == DOWN) { | ||
| + | yAffDebut -=5; | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | ++++ | ||
| + | |||
| + | ===== Rendu Vidéo ===== | ||
| + | {{: | ||
| + | |||
| + | |||
| + | ==== Ip vidéo 08/04/16 ==== | ||
| + | Récupérer la vidéo du téléphone (application IPWebcam) avec OpenFrameworks : {{: | ||
| + | Télécharger [[https:// | ||
| + | |||
| + | <WRAP group> | ||
| + | <WRAP half column> | ||
| + | <code cpp> | ||
| + | #pragma once | ||
| + | |||
| + | #include " | ||
| + | |||
| + | #include " | ||
| + | #include < | ||
| + | #include < | ||
| + | #include < | ||
| + | |||
| + | class ofApp : public ofBaseApp{ | ||
| + | |||
| + | public: | ||
| + | void setup(); | ||
| + | void update(); | ||
| + | void draw(); | ||
| + | |||
| + | void keyPressed(int key); | ||
| + | void keyReleased(int key); | ||
| + | void mouseMoved(int x, int y ); | ||
| + | void mouseDragged(int x, int y, int button); | ||
| + | void mousePressed(int x, int y, int button); | ||
| + | void mouseReleased(int x, int y, int button); | ||
| + | void mouseEntered(int x, int y); | ||
| + | void mouseExited(int x, int y); | ||
| + | void windowResized(int w, int h); | ||
| + | void dragEvent(ofDragInfo dragInfo); | ||
| + | void gotMessage(ofMessage msg); | ||
| + | |||
| + | cv:: | ||
| + | cv::Mat mat; | ||
| + | ofImage img; | ||
| + | }; | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | <WRAP half column> | ||
| + | <code cpp> | ||
| + | #include " | ||
| + | |||
| + | void ofApp:: | ||
| + | // IP Address | ||
| + | // You must add the " | ||
| + | // because OpenCv returns errors as it does not find the format ... | ||
| + | // See : http:// | ||
| + | vcap.open(" | ||
| + | img.allocate(640, | ||
| + | } | ||
| + | |||
| + | void ofApp:: | ||
| + | vcap.read(mat); | ||
| + | ofxCv:: | ||
| + | img.update(); | ||
| + | } | ||
| + | |||
| + | void ofApp:: | ||
| + | img.draw(0, | ||
| + | } | ||
| + | .... | ||
| + | .... | ||
| + | .... | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||