Beispiel #1
0
void toggleSplashScreen(void){
    clearLCD();
    
    /* Draws a sprite saved in the backpack. x and y sets the upper left corner, 
	 n is the number of the stored sprite, n sets the mode (same modes ad text).
	 sprite 0 is the sparkfun logo, other uploaded sprites will be deleted if power is removed.
	 Example: lcd.drawSprite(10,10,0,7); // Draws the sparkfun logo
	 */
	HOSTLCD.print(0x7C,BYTE);
	HOSTLCD.print(0x0B,BYTE);
	HOSTLCD.print(0x00,BYTE);
	HOSTLCD.print(0x00,BYTE);
	HOSTLCD.print(0x01,BYTE);
	HOSTLCD.print(0x07,BYTE); // override mode
    
    // go to position 1, 7
    goToLine(7);
    HOSTLCD.print("Session ID: " + SessionID);
    
    // go to position 1, 8
    // print Version ID
    goToLine(8);
    HOSTLCD.print("Version ID: " + VersionID);
    
    // print the sprite, the version ID and the session ID
    // Also print the authors and the company name
    
}
Beispiel #2
0
void showCredits(void){
    clearLCD();
    // go to position 1, 1
    // print 'Credits:'
    goToLine(1);
    LCDprint("Credits: ");
    
    goToLine(2);
    LCDprint("-Francis Papienau");
    
    goToLine(3);
    LCDprint("-Thai Nguyen");
}
Beispiel #3
0
void viewBatteryLevels(void){
  char Buffer[11];
  PString printable_string(Buffer, sizeof(Buffer));  
  clearLCD();
    
    // display only battery voltage
    goToLine(2);
    LCDprint("Battery Voltages:");
    
    do{
        
        goToLine(3);
        printable_string = "- Board: ";
        printable_string += tempBat;
        printable_string += "V";
        
        LCDprintConst(printable_string);
        
        goToLine(4);
        printable_string = "- ECG: ";
        printable_string += tempECGBat;
        printable_string += "V";
        
        LCDprintConst(printable_string);
        
        if(LEFT_BUTTON_PRESSED){
            break;
        }
        
        #ifdef ConnectedUSB
        // Echo data from the VDIP back to the host if conected to a PC
        processVdipBuffer();
        #endif
        
        // test buttons
        test_buttons();
        
        sendSensorValues();
        
        #ifdef EnableLogging
        FillUSBBuffers();
        
        if(BuffersFull == 1){
            printUSBBUffer();  
        }   
        #endif
        
    }while(1);
}
Beispiel #4
0
void QHexEdit::goToObject(IScaObject *object)
{
    QString newPath = object->getFile().absoluteFilePath();
    if (newPath != getCurrentPath() && !newPath.isEmpty())
    {
        loadFromFile(newPath);
    }
    IScaObject::IScaObjectType type = object->getType();
    switch (type)
    {

    case IScaObject::FILE:
        {
            break;
        }
    case IScaObject::DIRECTORY:
        {
            break;
        }
    case IScaObject::TEXTBLOCK:
        {
            IScaObjectTextBlock *obj = static_cast<IScaObjectTextBlock *>(object);
            goToTextBlock(obj);
            break;
        }
    case IScaObject::BINARYBLOCK:
        {
            IScaObjectBinaryBlock *obj = static_cast<IScaObjectBinaryBlock *>(object);
            goToBinaryBlock(obj);
            break;
        }
    case IScaObject::LINE:
        {
            IScaObjectLine *obj = static_cast<IScaObjectLine *>(object);
            goToLine(obj);
            break;
        }
    case IScaObject::IDENTIFIER:
        {
            IScaObjectIdentifier *obj = static_cast<IScaObjectIdentifier *>(object);
            goToIdentifier(obj);
            break;
        }
    case IScaObject::SYMBOL:
        {
            IScaObjectSymbol *obj = static_cast<IScaObjectSymbol *>(object);
            goToSymbol(obj);
            break;
        }
    case IScaObject::LINK:
        {
            break;
        }
    default:
        {
            qDebug() << "[ObjectTextViewer]: unknown type to go to.";
            break;
        }
    }
}
Beispiel #5
0
void MdiChild::goToSearchResult(int line, int index, QString term)
{
    this->setFocus();
    this->setSelection(line, index, line, index+term.length());
    if(! selectedText().compare(term) == 0)
        goToLine(line);
}
Beispiel #6
0
void initMenusThroughMenus(void){
    clearLCD();
    goToLine(1);
    // install the menus in memory
    LCDprint("Menus init(); OK");
    delay(100);
}
Beispiel #7
0
void toggleDEBUGSplashScreen(void){
    clearLCD();
    // go to position 1, 4
    // print 'DEBUG MODE'
    goToLine(4);    
    HOSTLCD.print("DEBUG MODE ENABLED");
}
Beispiel #8
0
void openNewFiles(void){

  // open new files to store values in. Using the EEPROM
  // to print the titles of the files, and the folders

  // make dir;
  // ‘MKD’<sp><name><cr>

  HOSTUSB.print("MKD ");
  HOSTUSB.print(SessionFolder);
  HOSTUSB.print(SessionID);
  HOSTUSB.print(13, BYTE);
  delay(100);

  HOSTUSB.print("CD ");
  HOSTUSB.print(SessionFolder);
  HOSTUSB.print(SessionID);
  HOSTUSB.print(13, BYTE);
  delay(100);

  // command for USB FTDI: OTW<sp>NAME<cr>
  // Creating files

  HOSTUSB.print("OPW TempData");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".CSV");
  HOSTUSB.print(13, BYTE);
  delay(100);

  HOSTUSB.print("OPW Vitals");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".CSV");
  HOSTUSB.print(13, BYTE);
  delay(100);

  HOSTUSB.print("OPW Others");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".CSV");
  HOSTUSB.print(13, BYTE);
  delay(100);

  HOSTUSB.print("OPW System");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".txt");
  HOSTUSB.print(13, BYTE);
  delay(100);

  HOSTUSB.print("OPW Acknowledge");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".txt");
  HOSTUSB.print(13, BYTE);
  delay(100);

  // sending through USB the new File System
  goToLine(1);
  LCDprint("New files opened");
  delay(1000);

}
Beispiel #9
0
int askforUSB(void){
    int continueFlag = 0, choice = 0;
    
    clearLCD();
    
    // print the prompt
    goToLine(1);
    LCDprint("***************");
    
    goToLine(2);
    LCDprint("Record?");
    
    goToLine(3);
    LCDprint("-> YES  [Left]");
    
    goToLine(4);
    LCDprint("-> NO   [Right]");
    
    goToLine(5);
    LCDprint("***************");
    
    //resetting the buttons to up position
    reset_buttons();
    
    do{
        // if left is pushed
        if(LEFT_BUTTON_PRESSED){ 
            // Yes record
            choice = 1;
            continueFlag = 1;
            // if the right is pushed
        }else if(RIGHT_BUTTON_PRESSED){
            // no do not record
            choice = 0;
            continueFlag = 1;
            // if the middle is pushed
        }
        //do while an input is noticed
    }while(continueFlag == 0);
    
    // reset the buttons again
    reset_buttons();
    
    // return the choice
    return choice;
}
Beispiel #10
0
void deleteFiles(void){

  // delete the specific files written in the root directory

  // command for FTDI : DLF<sp>NAME<cr>
  // deleting files

  HOSTUSB.print("DLF TempData");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".CSV");
  HOSTUSB.print(13, BYTE);
  delay(100);

  HOSTUSB.print("DLF Vitals");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".CSV");
  HOSTUSB.print(13, BYTE);
  delay(100);

  HOSTUSB.print("DLF Others");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".CSV");
  HOSTUSB.print(13, BYTE);
  delay(100);

  HOSTUSB.print("DLF System");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".txt");
  HOSTUSB.print(13, BYTE);
  delay(100);

  HOSTUSB.print("DLF Acknowledge");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".txt");
  HOSTUSB.print(13, BYTE);
  delay(100);

  // go back to root
  HOSTUSB.print("CD ..");
  HOSTUSB.print(13, BYTE);
  delay(100);

  // delete dir
  HOSTUSB.print("DLD "+SessionFolder);
  HOSTUSB.print(13, BYTE);
  delay(100);

  // sending through USB the new File System
  goToLine(1);
  LCDprint("Files/Dir Deleted");
  delay(1000);

}
Beispiel #11
0
void viewBatteryLevels(void){
    clearLCD();

    // display only battery voltage
    goToLine(2);
    LCDprint("Battery Voltages:");
    
    do{
        
        goToLine(3);
        LCDprint("- Board: " + tempBat +"V");
        
        goToLine(4);
        LCDprint("- ECG: " + tempECGBat +"V");
        
        if(LEFT_BUTTON_PRESSED){
            break;
        }
        
        #ifdef ConnectedUSB
        // Echo data from the VDIP back to the host if conected to a PC
        processVdipBuffer();
        #endif
        
        // test buttons
        test_buttons();
        
        sendSensorValues();
        
        #ifdef EnableLogging
        FillUSBBuffers();
        
        if(BuffersFull == 1){
            writeUSBBUffer();  
        }   
        #endif
        
    }while(1);
}
Beispiel #12
0
int askforOutput(void){
    int continueFlag = 0, choice = 0;
    
    clearLCD(); 
    
    // print the prompt
    goToLine(1);
    LCDprintln("***************");
    
    goToLine(2);
    LCDprintln("What output?");
    
    goToLine(3);
    LCDprintln("-> Xbee [Left]");
    
    goToLine(4);
    LCDprintln("-> USB  [Right]");
    
    goToLine(5);
    LCDprintln("-> N/A  [Center]");
    
    goToLine(6);
    LCDprintln("***************");
    
    //resetting the buttons to up position
    reset_buttons();
    
    do{
        // if left is pushed
        if(LEFT_BUTTON_PRESSED){ 
            // XBEE is the choice
            choice = 1;
            continueFlag = 1;
        // if the right is pushed
        }else if(RIGHT_BUTTON_PRESSED){
            // USB Connection is the choice
            choice = 2;
            continueFlag = 1;
        // if the middle is pushed
        }else if(MIDDLE_BUTTON_PRESSED){
            // No output is the choice
            choice = 3;
            continueFlag = 1;
        }
        //do while an input is noticed
    }while(continueFlag == 0);
    
    // reset the buttons again
    reset_buttons();
    
    // return the choice
    return choice;
}
Beispiel #13
0
void closeAllFiles(void){

  // Close all files for writting

  // command for USB FTDI: CLF<sp>NAME<cr>

  HOSTUSB.print("CLF TempData");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".CSV");
  HOSTUSB.print(13, BYTE);
  delay(100);

  HOSTUSB.print("CLF Vitals");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".CSV");
  HOSTUSB.print(13, BYTE);
  delay(100);

  HOSTUSB.print("CLF Others");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".CSV");
  HOSTUSB.print(13, BYTE);
  delay(100);

  HOSTUSB.print("CLF System");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".txt");
  HOSTUSB.print(13, BYTE);
  delay(100);

  HOSTUSB.print("CLF Acknowledge");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".txt");
  HOSTUSB.print(13, BYTE);
  delay(100);

  goToLine(1);
  LCDprint("Files Closed");
  delay(1000);
}
Beispiel #14
0
SourceViewer::SourceViewer(QWebEngineFrame* frame, const QString &selectedHtml)
    : QWidget(0)
    , m_frame(frame)
    , m_selectedHtml(selectedHtml)
{
    setAttribute(Qt::WA_DeleteOnClose);
    setWindowTitle(tr("Source of ") + QzTools::frameUrl(frame).toString());
    m_layout = new QBoxLayout(QBoxLayout::TopToBottom, this);
    m_sourceEdit = new PlainEditWithLines(this);
    m_sourceEdit->setObjectName("sourceviewer-textedit");
    m_sourceEdit->setReadOnly(true);
    m_sourceEdit->setUndoRedoEnabled(false);

    m_statusBar = new QStatusBar(this);
    m_statusBar->showMessage(QzTools::frameUrl(frame).toString());

    QMenuBar* menuBar = new QMenuBar(this);
    m_layout->addWidget(m_sourceEdit);
    m_layout->addWidget(m_statusBar);
    m_layout->setContentsMargins(0, 0, 0, 0);
    m_layout->setSpacing(0);
    m_layout->setMenuBar(menuBar);

    QFont font;
    font.setFamily("Tahoma");
    font.setFixedPitch(true);
    font.setPointSize(10);

    m_sourceEdit->setFont(font);
    new HtmlHighlighter(m_sourceEdit->document());

    resize(650, 600);
    QzTools::centerWidgetToParent(this, frame->page()->view());

    QMenu* menuFile = new QMenu(tr("File"));
    menuFile->addAction(tr("Load in page"), this, SLOT(loadInPage()));
    menuFile->addAction(QIcon::fromTheme("document-save"), tr("Save as..."), this, SLOT(save()))->setShortcut(QKeySequence("Ctrl+S"));
    menuFile->addSeparator();
    menuFile->addAction(QIcon::fromTheme("window-close"), tr("Close"), this, SLOT(close()))->setShortcut(QKeySequence("Ctrl+W"));
    menuBar->addMenu(menuFile);

    QMenu* menuEdit = new QMenu(tr("Edit"));
    m_actionUndo = menuEdit->addAction(QIcon::fromTheme("edit-undo"), tr("Undo"), m_sourceEdit, SLOT(undo()));
    m_actionRedo = menuEdit->addAction(QIcon::fromTheme("edit-redo"), tr("Redo"), m_sourceEdit, SLOT(redo()));
    menuEdit->addSeparator();
    m_actionCut = menuEdit->addAction(QIcon::fromTheme("edit-cut"), tr("Cut"), m_sourceEdit, SLOT(cut()));
    m_actionCopy = menuEdit->addAction(QIcon::fromTheme("edit-copy"), tr("Copy"), m_sourceEdit, SLOT(copy()));
    m_actionPaste = menuEdit->addAction(QIcon::fromTheme("edit-paste"), tr("Paste"), m_sourceEdit, SLOT(paste()));
    menuEdit->addSeparator();
    menuEdit->addAction(QIcon::fromTheme("edit-select-all"), tr("Select All"), m_sourceEdit, SLOT(selectAll()))->setShortcut(QKeySequence("Ctrl+A"));
    menuEdit->addAction(QIcon::fromTheme("edit-find"), tr("Find"), this, SLOT(findText()))->setShortcut(QKeySequence("Ctrl+F"));
    menuEdit->addSeparator();
    menuEdit->addAction(QIcon::fromTheme("go-jump"), tr("Go to Line..."), this, SLOT(goToLine()))->setShortcut(QKeySequence("Ctrl+L"));
    menuBar->addMenu(menuEdit);

    m_actionUndo->setShortcut(QKeySequence("Ctrl+Z"));
    m_actionRedo->setShortcut(QKeySequence("Ctrl+Shift+Z"));
    m_actionCut->setShortcut(QKeySequence("Ctrl+X"));
    m_actionCopy->setShortcut(QKeySequence("Ctrl+C"));
    m_actionPaste->setShortcut(QKeySequence("Ctrl+V"));

    QMenu* menuView = new QMenu(tr("View"));
    menuView->addAction(QIcon::fromTheme(QSL("view-refresh")), tr("Reload"), this, SLOT(reload()))->setShortcut(QKeySequence("F5"));
    menuView->addSeparator();
    menuView->addAction(tr("Editable"), this, SLOT(setTextEditable()))->setCheckable(true);
    menuView->addAction(tr("Word Wrap"), this, SLOT(setTextWordWrap()))->setCheckable(true);
    menuView->actions().at(3)->setChecked(true);
    menuBar->addMenu(menuView);

    connect(m_sourceEdit, SIGNAL(copyAvailable(bool)), this, SLOT(copyAvailable(bool)));
    connect(m_sourceEdit, SIGNAL(redoAvailable(bool)), this, SLOT(redoAvailable(bool)));
    connect(m_sourceEdit, SIGNAL(undoAvailable(bool)), this, SLOT(undoAvailable(bool)));
    connect(menuEdit, SIGNAL(aboutToShow()), this, SLOT(pasteAvailable()));

    QTimer::singleShot(0, this, SLOT(loadSource()));
}
Beispiel #15
0
void printACK_Sys_files(void){

  // ========== Print ACK FILE =============

  // print an acknoledgment that the system is OK
  // and running with no issues.

  // OPEN ACK FILE
  HOSTUSB.print("OPW Acknowledge.txt");
  HOSTUSB.print(13, BYTE);
  delay(100);

  // SEND print COMMAND
  HOSTUSB.print("WRF ");

  // SEND THE LENGTH OF THE STRING
  StartTime = millis();

  HOSTUSB.print(ACK.length());
  HOSTUSB.print(13, BYTE);
  delay(100);

  // SEND DATA
  HOSTUSB.print(ACK);
  HOSTUSB.print(13, BYTE);
  delay(100);

  // CLOSE FILE
  HOSTUSB.print("CLF Acknowledge.txt");
  HOSTUSB.print(13, BYTE);
  delay(100);

  // ========== Print SYSTEM INFO File =============

  // Print the system file with:
  //  -> Fimware Ver.
  //  -> Drive Info
  //  -> Drive Info Extended
  //  -> Free Mem.
  //  -> Current DIR

  HOSTUSB.print("OPW System.txt");
  HOSTUSB.print(13, BYTE);
  delay(100);

  // ========== frimware version =============

  //get
  HOSTUSB.print("FWV");
  HOSTUSB.print(13, BYTE);

  String buffer, printString;
  while(HOSTUSB.available() > 0){
    buffer = buffer + HOSTUSB.read();
  }

  printString = "This is the system file. It is used to allow for\n"
    "Debugging perposes. It shows the follwing:\n"
    "\t-> firmware version: "+ buffer + "\n\n";

  HOSTUSB.print("WRF ");
  HOSTUSB.print(printString.length());
  HOSTUSB.print(13, BYTE);

  // print
  HOSTUSB.print(printString);
  HOSTUSB.print(13, BYTE);
  delay(100);

  // ========== free space =============

  //get
  HOSTUSB.print("FSE");
  HOSTUSB.print(13, BYTE);

  buffer = NULL;
  printString =NULL;

  while(HOSTUSB.available() > 0){
    buffer = buffer + HOSTUSB.read();
  }

  printString = "\t-> free space on USB: " + buffer + "\n\n";

  HOSTUSB.print("WRF ");
  HOSTUSB.print(printString.length());
  HOSTUSB.print(13, BYTE);

  // print
  HOSTUSB.print(printString);
  HOSTUSB.print(13, BYTE);
  delay(100);

  // ========== current directory =============

  // get
  HOSTUSB.print("DIR");
  HOSTUSB.print(13, BYTE);

  buffer = NULL;
  printString =NULL;

  while(HOSTUSB.available() > 0){
    buffer = buffer + HOSTUSB.read();
  }

  printString = "\t-> Current Directory: " + buffer + "\n\n";

  HOSTUSB.print("WRF ");
  HOSTUSB.print(printString.length());
  HOSTUSB.print(13, BYTE);

  // print
  HOSTUSB.print(printString);
  HOSTUSB.print(13, BYTE);
  delay(100);

  // ========== device information =============

  //get
  HOSTUSB.print("IDDE");
  HOSTUSB.print(13, BYTE);

  buffer = NULL;
  printString =NULL;

  while(HOSTUSB.available() > 0){
    buffer = buffer + HOSTUSB.read();
  }

  printString = "\t-> Additionnal Info: \n" + buffer + "\n\n" +
    "*********************************************\n" +
    "This file is for debugging purposes only and\n" +
    "should not be taken as the end all of all.\n" +
    "*********************************************\n" +
    "This process took approximetly: " + millis() + "\n";

  HOSTUSB.print("WRF ");
  HOSTUSB.print(printString.length());
  HOSTUSB.print(13, BYTE);

  // print
  HOSTUSB.print(printString);
  HOSTUSB.print(13, BYTE);
  delay(100);

  // LCD ACK of printing done!
  goToLine(1);
  LCDprint("System/ACK printed!!!");
  delay(1000);

}
Beispiel #16
0
void printHeaders(void){

  // print the headers for the CSV files

  // 1. open the file, 
  // 2. send the print command
  // 3. send the length 
  // 4. send data to be written
  // 5. close the file

  // ========== Temperature File =============

  //1.
  HOSTUSB.print("OPW TempData");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".CSV");
  HOSTUSB.print(13, BYTE);
  delay(100);

  //2.
  HOSTUSB.print("WRF ");

  //3.
  HOSTUSB.print(TempHeader.length());
  HOSTUSB.print(13, BYTE);

  //4.
  HOSTUSB.print(TempHeader);
  HOSTUSB.print(13, BYTE);

  //6.
  HOSTUSB.print("CLF TempData");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".CSV");
  HOSTUSB.print(13, BYTE);
  delay(100);

  // ========== Vital Signs File =============

  //1.
  HOSTUSB.print("OPW Vitals");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".CSV");
  HOSTUSB.print(13, BYTE);
  delay(100);

  //2.
  HOSTUSB.print("WRF ");

  //3.
  HOSTUSB.print(VitalsHeader.length());
  HOSTUSB.print(13, BYTE);

  //4.
  HOSTUSB.print(VitalsHeader);
  HOSTUSB.print(13, BYTE);

  //5.
  HOSTUSB.print("CLF Vitals");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".CSV");
  HOSTUSB.print(13, BYTE);
  delay(100);

  // ========== Other Parameters File =============

  //1.
  HOSTUSB.print("OPW Others");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".CSV");
  HOSTUSB.print(13, BYTE);
  delay(100);

  //2.
  HOSTUSB.print("WRF ");

  //3.
  HOSTUSB.print(OthersHeader.length());
  HOSTUSB.print(13, BYTE);

  //4.
  HOSTUSB.print(OthersHeader);
  HOSTUSB.print(13, BYTE);

  //5.
  HOSTUSB.print("CLF Others");
  HOSTUSB.print(SessionID);
  HOSTUSB.print(".CSV");
  HOSTUSB.print(13, BYTE);
  delay(100);

  goToLine(1);
  LCDprint("Headers Printed!");
  delay(1000);

}
Beispiel #17
0
vi_rc GoToLineNoRelCurs( linenum lineno )
{
    return( goToLine( lineno, false ) );
}
Beispiel #18
0
vi_rc GoToLineRelCurs( linenum lineno )
{
    return( goToLine( lineno, true ) );
}
Beispiel #19
0
void processTerminalCommands(void){
    clearLCD();
   
    // if the user decided to Store info
    // to the USB drive.
    
    #ifdef StoreUSB
    // Check the logging flag,
    // if the logging flag is 1
    if(LoggingState && !ON){
        LoggingState = 0;
        
        //Stop Logging
        closeAllFiles();
        
        //Print to LCD
        goToLine(1);
        LCDprint("Stop logging");
    }
    
    // if the logging flag is 0
    if(!LoggingState && ON){
        LoggingState = 1;
        
        //Start Logging
        openNewFiles();
        
        //Print to LCD
        goToLine(1);
        LCDprint("Start logging");
    } 
    #endif
    
    #ifdef USB
    
    if(HOSTXbee.available() > 0){
        
        char readChar = HOSTXbee.read();
        
        // Options from Terminal:
        //  1 -> start Logging
        //  2 -> stop Logging
        //  3 -> silent Mode
        //       lights off but logging ON
        //  4 -> display files
        //  5 -> delete files
        //  6 -> directory listing
        //  7 -> suspend the VDIP
        //  8 -> set the VDIP to ASCII mode
        //  else -> Error in the input,
        //  Not a recognized input
        
        if(readChar == '1'){
            
            // Start Logging to USB
            goToLine(1);
            LCDprint("Started Logging");
            LoggingState = 1;
            ON = 1;
            
            openNewFiles();
            goToLine(2);
            LCDprint(">");
            
        }else if(readChar == '2'){
            
            // Stop Logging to USB
            goToLine(1);
            LCDprint("Stopped Logging");
            LoggingState = 0;
            ON = 0;
            
            closeAllFiles();
            
            goToLine(2);
            LCDprint(">");
            
        }else if(readChar == '3'){
            
            // Put in silent mode
            goToLine(1);
            LCDprint("Silent mode");
            turnOffBacklight();
            
            goToLine(2);
            LCDprint(">");
            
        }else if(readChar == '4'){
            
            goToLine(1);
            // Print File System
            LCDprint("Files are written to:");
           
            goToLine(2);
            LCDprint("~\\");        
            
            goToLine(3);
            LCDprint("TempData.CSV");
            
            goToLine(4);
            LCDprint("Vitals.CSV");
            
            goToLine(5);
            LCDprint("Others.CSV");
            
            goToLine(6);
            LCDprint("System.txt");
            
            goToLine(7);
            LCDprint("Acknowledge.txt");
            
            goToLine(8);
            LCDprint(">");
            
        }else if(readChar == '5'){
            
            // Delete files
            goToLine(1);
            LCDprint("Deleting files");
            deleteFiles();
            
            goToLine(2);
            LCDprint(">");
            
        }else if(readChar == '6'){
            
            // Show the directory
            goToLine(1);
            LCDprint("DIR:");
            
            goToLine(2);
            readLineFromVDIP();
            
            goToLine(3);
            LCDprint(">");

        }else if(readChar == '7'){
            
            // Suspend the VDIP
            goToLine(1);
            LCDprint("Suspending:");
            putInSuspendMode();
            
            goToLine(2);
            LCDprint(">");            
            
        }else if(readChar == '8'){

            // Set ASCII mode
            setToASCIIMode();
            
            goToLine(1);
            LCDprint("[OK]");
            
            goToLine(2);
            LCDprint("> ");
            
        }else{
            
            // Print Help Menu
            goToLine(1);
            LCDprint("Unrecognised command '");
            LCDprintChar(readChar);
            LCDprint("'");
            
            delay(1000);
            
            goToLine(1);
            LCDprint("1 - Start logging");
            
            goToLine(2);
            LCDprint("2 - Stop logging");
            
            goToLine(3);
            LCDprint("3 - Silent Mode");
            
            goToLine(4);
            LCDprint("4 - Display Logfiles");
            
            goToLine(5);
            LCDprint("5 - Delete Logfiles");
            
            goToLine(6);
            LCDprint("6 - Directory listing");
            
            goToLine(7);
            LCDprint("7 - Suspend VDIP");
            
            goToLine(8);
            LCDprint("8 - Set to ASCII mode");
            
            delay(1000);
            
            goToLine(1);
            LCDprint("> ");
        }
    }
    #else
    
    // Can't print to Serial since we are using the
    // XBee layer, and we can only send AT Commands.
    // Unless the XBee is in API mode we cannot send
    // Serial Commands directly to the Board...
    
    clearLCD();
    
    goToLine(1);
    LCDprint("***ERROR***");
    #endif
}
Beispiel #20
0
void AppEditMenu::setupMenu(QMenu *editMenu, QToolBar *toolbar)
{
    toolbar->addSeparator();

    editUndoAction=editMenu->addAction(IconUtil::getIcon("undo"), tr("&Undo"), this, SLOT(undo()), QKeySequence(QKeySequence::Undo));
    editUndoAction->setStatusTip(tr("Undo last edit action"));
    toolbar->addAction(editUndoAction);
    editRedoAction=editMenu->addAction(IconUtil::getIcon("redo"), tr("&Redo"), this, SLOT(redo()), QKeySequence(QKeySequence::Redo));
    editRedoAction->setStatusTip(tr("Redo last undone edit action"));
    toolbar->addAction(editRedoAction);

    editMenu->addSeparator();
    toolbar->addSeparator();

    editCutAction=editMenu->addAction(IconUtil::getIcon("editcut"), tr("Cu&t"), this, SLOT(cut()), QKeySequence(QKeySequence::Cut));
    editCutAction->setStatusTip(tr("Cut"));
    toolbar->addAction(editCutAction);
    editCopyAction=editMenu->addAction(IconUtil::getIcon("editcopy"), tr("&Copy"), this, SLOT(copy()), QKeySequence(QKeySequence::Copy));
    editCopyAction->setStatusTip(tr("Copy"));
    toolbar->addAction(editCopyAction);
    //editCopyAsAction=editMenu->addAction(IconUtil::getIcon("editcopy"), tr("Copy as"));
    //editCopyAsAction->setMenu(createCopyAsMenu(editMenu));
    editPasteAction=editMenu->addAction(IconUtil::getIcon("editpaste"), tr("&Paste"), this, SLOT(paste()), QKeySequence(QKeySequence::Paste));
    editPasteAction->setStatusTip(tr("Paste"));
    toolbar->addAction(editPasteAction);

    editMenu->addSeparator();

    editSelectAllAction=editMenu->addAction(IconUtil::getIcon("editselectall"), tr("Select &All"), this, SLOT(selectAll()), QKeySequence(QKeySequence::SelectAll));
    editSelectAllAction->setStatusTip(tr("Select All"));

    editMenu->addSeparator();
    toolbar->addSeparator();

    editAdvancedAction = editMenu->addAction(tr("Advanced"));
    createEditAdvancedMenu(toolbar);
    editAdvancedAction->setMenu(editAdvancedMenu);

    editMenu->addSeparator();

    editDescribeAction=editMenu->addAction(tr("Describe object"), this, SLOT(describeObject()), QKeySequence("F4"));

    editResolveAction=editMenu->addAction(tr("Object Menu"));
    createEditResolveMenu();
    editResolveAction->setMenu(editResolveMenu);

    editMenu->addSeparator();
    //toolbar->addSeparator();

    editIncreaseFontSize=editMenu->addAction(tr("Increase font size"), this, SLOT(increaseFont()), QKeySequence(QKeySequence::ZoomIn));
    editIncreaseFontSize->setStatusTip(tr("Increase font size"));

    editDecreaseFontSize=editMenu->addAction(tr("Decrease font size"), this, SLOT(decreaseFont()), QKeySequence(QKeySequence::ZoomOut));
    editDecreaseFontSize->setStatusTip(tr("Decrease font size"));

    editResetFontSize=editMenu->addAction(tr("Reset font size"), this, SLOT(resetFont()), QKeySequence(tr("Ctrl+0", "Edit|Reset font size")));
    editResetFontSize->setStatusTip(tr("Reset font size"));

    editMenu->addSeparator();
    toolbar->addSeparator();

    editFindAction=editMenu->addAction(IconUtil::getIcon("find"), tr("&Find..."), this, SLOT(showSearchWidget()), QKeySequence("Ctrl+F"));
    editFindAction->setStatusTip(tr("Find text"));
    toolbar->addAction(editFindAction);
    editFindPreviousAction=editMenu->addAction(IconUtil::getIcon("find_prev"), tr("Find p&revious"), this, SLOT(findPrevious()), QKeySequence("Shift+F3"));
    editFindPreviousAction->setStatusTip(tr("Find previous occurence of current search text"));
    toolbar->addAction(editFindPreviousAction);
    editFindNextAction=editMenu->addAction(IconUtil::getIcon("find_next"), tr("Find &next"), this, SLOT(findNext()), QKeySequence("F3"));
    editFindNextAction->setStatusTip(tr("Find next occurence of current search text"));
    toolbar->addAction(editFindNextAction);

    editMenu->addSeparator();

    editGoToLineAction=editMenu->addAction(IconUtil::getIcon("goto_line"), tr("&Go to line..."), this, SLOT(goToLine()), QKeySequence("Ctrl+G"));
    editGoToLineAction->setStatusTip(tr("Go to line"));


    connect(editResolveMenu, SIGNAL(aboutToShow()), this, SLOT(populateResolveMenu()));
}
Beispiel #21
0
void showSystemCom(void){
    
    clearLCD();
    
    // Show the Comms On the system that are activated
    goToLine(2);
    LCDprint("Comms Init():");
    
    do{
        
        // display special characters for:
        // -> Xbee 'X'
        // -> PC 'P'
        // -> Debug 'D'
        // -> Storage 'S'
        // case statement
        
        switch (Connection) {
            case 'X':
                goToLine(3);
                LCDprint("-> XBee");
                break;
            case 'P':
                goToLine(3);
                LCDprint("-> PC-USB");
                break;
                
            default:
                goToLine(3);
                LCDprint("          ");
                break;
        }
        switch (Store) {
            case 'S':
                goToLine(4);
                LCDprint("-> Recording to USB");
                break;
            default:
                goToLine(4);
                LCDprint("-> Not Recording");
                break;
        } 
        
        if(LEFT_BUTTON_PRESSED){
            break;
        }
        
        #ifdef ConnectedUSB
        // Echo data from the VDIP back to the host if conected to a PC
        processVdipBuffer();
        #endif
        
        // test buttons
        test_buttons();
        
        sendSensorValues();
        
        #ifdef EnableLogging
        FillUSBBuffers();
        
        if(BuffersFull == 1){
            printUSBBUffer();  
        }   
        #endif
        
    }while(1);
    
}