Exemple #1
0
void TGo4EventInfo::WorkWithEvent(const char* itemname)
{
   EventLbl->setText(itemname);

   bool ismbs = QString(itemname).contains(defMbsEventName);

   MbsPrintBox->setEnabled(ismbs);
   TString mbsitem = Browser()->FindItemInAnalysis(defMbsEventName);
   MbsButton->setEnabled(!ismbs && (mbsitem.Length()>0));
   setFocus();
}
Exemple #2
0
void TGo4TreeViewer::ProcessDropEvent(QGo4LineEdit* edt, bool caninit)
{
   QString value = edt->text();

   TGo4BrowserProxy* br = Browser();
   if (br==0) return;

   if (fxTreeName.length()==0) {
      if (!caninit) {
          StatusMessage("First drop something on X, Y or Z field");
          edt->setText("");
          return;
      }

      TString treename;
      if (!br->DefineTreeName(value.toLatin1().constData(), treename)) {
          StatusMessage(QString("Invalid tree ") + value);
          edt->setText("");
          return;
      }
      fxTreeName = treename.Data();
      setToolTip(QString("Selected tree: ") + fxTreeName);

      TreeDrawBtn->setEnabled(true);
      AddLink(treename.Data(), "Tree");
   }

   TString leafname;
   if (!br->DefineLeafName(value.toLatin1().constData(), fxTreeName.toLatin1().constData(), leafname)) {
      edt->setText("");
      StatusMessage(QString("Invalid leaf name ") + value);
      return;
   }
   // count number of [ and replace by []
   // this means, by default accumulate over all members
   TObjArray* it=leafname.Tokenize("[");
   leafname=((TObjString *)it->First())->GetName();
   for(Int_t i=1;i<it->GetEntriesFast();i++) leafname.Append("[]");
   edt->setText(leafname.Data());
   edt->setFocus();
   it->Delete();
}
Exemple #3
0
void TGo4EventInfo::RefreshClicked()
{
   RemoveAllLinks();

   if (EventLbl->text().length()==0) return;
   QString evname = EventLbl->text();
   bool isremote = RemoteButton->isChecked();
   bool istree = TreeButton->isChecked();

   TGo4Slot* tgtslot = 0;
   if (!isremote)
     tgtslot = AddSlot("Event");

   TGo4BrowserProxy* br = Browser();
   if (br==0) return;

   TString objname;
   TGo4ServerProxy* an = br->DefineAnalysisObject(evname.toLatin1().constData(), objname);
   if (an!=0) an->RequestEventStatus(objname.Data(), istree, tgtslot);
}
Exemple #4
0
void TGo4TreeViewer::TreeDrawBtn_clicked()
{
   if (fxTreeName.isEmpty()) {
      StatusMessage("No tree specified");
      return;
   }

   if(XFieldEdt->text().isEmpty()) {
      StatusMessage("Treedraw without x coordinate expression");
      return;
   }

   TGo4BrowserProxy* br = Browser();
   if (br==0) return;

   QApplication::setOverrideCursor(Qt::WaitCursor);

   TString createdh;

   br->PerformTreeDraw(fxTreeName.toLatin1().constData(),
                       XFieldEdt->text().toLatin1().constData(),
                       YFieldEdt->text().toLatin1().constData(),
                       ZFieldEdt->text().toLatin1().constData(),
                       CutEdt->text().toLatin1().constData(),
                       HistNameEdt->text().toLatin1().constData(),
                       createdh);

    if (createdh.Length()>0) {
       HistNameEdt->setText(createdh.Data());
       DrawItem(createdh.Data());
    } else {
        if (WhereItemDrawn(HistNameEdt->text().toLatin1().constData())==0)
           DrawItem(HistNameEdt->text());
        else
           br->RequestBrowserObject(HistNameEdt->text().toLatin1().constData());
    }

   QApplication::restoreOverrideCursor();
}
Exemple #5
0
/** Browser Menu
        Display:         PAL/NTSC
        Emulated System: PAL/NTSC
        Center Screen
        Configure Save Path: (browse to path)
        Configure Elf Path: (browse to path)
        Exit to Elf Path
        Exit to PS2Browser
**/
int Browser_Menu(void)
{
    char *temp;
    char cnfpath[2048];
    int i,selection = 0;
    oldselect = -1;
    int option_changed = 0;

    int menu_x1 = gsGlobal->Width*0.25;
    int menu_y1 = gsGlobal->Height*0.15;
    int menu_x2 = gsGlobal->Width*0.75;
    int menu_y2 = gsGlobal->Height*0.85+FONT_HEIGHT;
    int text_line = menu_y1 + 4;

    char options[12][39] = {
        { "Display: " },
        { "Interlacing: " },
        { "Emulated System: " },
        { "Center Screen" },
        { "Configure Save Path: " },
        { "" },
        { "Configure ELF Path:  " },
        { "" },
        { "Save FCEUltra.cnf"},
        { "Power Off" },
        { "Exit to ELF" },
        { "Exit Options Menu" }
    };

    //fill lines with values
    for(i=0;i<12;i++) {
        switch(i) {
            case 0:
                if(!Settings.display) {
                    sprintf(options[i],"%s%s",options[i],"NTSC");
                }
                else {
                    sprintf(options[i],"%s%s",options[i],"PAL");
                }
                break;
            case 1:
                if(Settings.interlace) {
                    sprintf(options[i],"%s%s",options[i],"On");
                }
                else {
                    sprintf(options[i],"%s%s",options[i],"Off");
                }
                break;
            case 2:
                if(!Settings.emulation) {
                    sprintf(options[i],"%s%s",options[i],"NTSC");
                }
                else {
                    sprintf(options[i],"%s%s",options[i],"PAL");
                }
                break;
            case 5:
                strzncpy(options[5],Settings.savepath,38);
                break;
            case 7:
                strzncpy(options[7],Settings.elfpath,38);
                break;
        }
    }



    while(1) {
        selected = 0; //clear selected flag
        selection += menu_input(0,0);

        if(selection > 11) { selection = 0; }
        if(selection < 0) { selection = 11; }
        if(selection == 5 && oldselect == 4) { selection++; } //5 is savepath
        if(selection == 5 && oldselect == 6) { selection--; }
        if(selection == 7 && oldselect == 6) { selection++; } //7 is elfpath
        if(selection == 7 && oldselect == 8) { selection--; }


        if((oldselect != selection) || option_changed) {

            gsKit_clear(gsGlobal,GS_SETREG_RGBAQ(0x00,0x00,0x00,0x80,0x00));

            menu_primitive("Options", &MENU_TEX, menu_x1, menu_y1, menu_x2, menu_y2);

            for(i=0;i<12;i++) {
                if(selection == i) {
                    //font_print(gsGlobal, menu_x1+10.0f, text_line + i*FONT_HEIGHT, 2, DarkYellowFont, options[i]);
                    printXY(options[i],menu_x1+10,text_line+i*FONT_HEIGHT, 4, FCEUSkin.highlight, 1, 0);
                }
                else {
                    //font_print(gsGlobal, menu_x1+10.0f, text_line + i*FONT_HEIGHT, 2, WhiteFont, options[i]);
                    printXY(options[i],menu_x1+10,text_line + i*FONT_HEIGHT, 4, FCEUSkin.textcolor, 1, 0);
                }
            }

            DrawScreen(gsGlobal);

            if(power_off)
                option_changed = 1;
                power_off--;
                if(!power_off) {
                    strcpy(cnfpath,"xyz:/imaginary/hypothetical/doesn't.exist");
                    FILE *File;
                    File = fopen(cnfpath,"r");
                    if(File != NULL)
                        fclose(File);
                }
        }

        oldselect = selection;
        option_changed = 0;

        if(selected) {
            if(selected == 2) {
                selection = 11;
            }
            i = selection;
            switch(i) {
                case 0: //Display PAL/NTSC
                    Settings.display ^= 1;
                    if(Settings.display) {
                        gsGlobal->Mode = GS_MODE_PAL;
                        gsGlobal->Height = 512;
                        defaulty = 72;
                        temp = strstr(options[i],"NTSC");
                        *temp = 0;
                        strcat(options[i],"PAL");
                    }
                    else {
                        gsGlobal->Mode = GS_MODE_NTSC;
                        gsGlobal->Height = 448;
                        defaulty = 50;
                        temp = strstr(options[i],"PAL");
                        *temp = 0;
                        strcat(options[i],"NTSC");
                    }
					gsGlobal->Width = 640;
					gsGlobal->Field = GS_FIELD;
					if (gsGlobal->Interlace == GS_NONINTERLACED) {
						gsGlobal->Height = gsGlobal->Height/2;
						gsGlobal->StartY = gsGlobal->StartY/2 -1 ;
					}

                    gsGlobal->StartY = gsGlobal->StartY + Settings.offset_y;
                    //if(Settings.interlace && (gsGlobal->Mode == GS_MODE_NTSC))
                        //gsGlobal->StartY = gsGlobal->StartY + 22;
                    //else
                        //gsGlobal->StartY = gsGlobal->StartY + 11;
                    //normalize_screen();
					gsKit_init_screen(gsGlobal);	/* Apply settings. */
					gsKit_mode_switch(gsGlobal, GS_ONESHOT);

                    menu_x1 = gsGlobal->Width*0.25;
                    menu_y1 = gsGlobal->Height*0.15;
                    menu_x2 = gsGlobal->Width*0.75;
                    menu_y2 = gsGlobal->Height*0.85+FONT_HEIGHT;
					text_line = menu_y1 + 4;
					    
                    option_changed = 1;
                    //SetGsCrt(gsGlobal->Interlace,gsGlobal->Mode,gsGlobal->Field);
                    break;
                case 1: //Interlacing Off/On
                    Settings.interlace ^= 1;
                    if (gsGlobal->Mode == GS_MODE_PAL)
						gsGlobal->Height = 512;
					else
						gsGlobal->Height = 448;
                    if(Settings.interlace) {
                        gsGlobal->Interlace = GS_INTERLACED;
                        //gsGlobal->StartY = (gsGlobal->StartY-1)*2;
                        temp = strstr(options[i],"Off");
                        *temp = 0;
                        strcat(options[i],"On");
                    }
                    else {
                        gsGlobal->Interlace = GS_NONINTERLACED;
                        gsGlobal->StartY = gsGlobal->StartY/2 + 1;
						gsGlobal->Height = gsGlobal->Height/2;
                        temp = strstr(options[i],"On");
                        *temp = 0;
                        strcat(options[i],"Off");
                    }
					gsGlobal->Width = 640;
					gsGlobal->Field = GS_FIELD;
                    //normalize_screen();
					gsKit_init_screen(gsGlobal);	/* Apply settings. */
					gsKit_mode_switch(gsGlobal, GS_ONESHOT);
					
                    menu_x1 = gsGlobal->Width*0.25;
                    menu_y1 = gsGlobal->Height*0.15;
                    menu_x2 = gsGlobal->Width*0.75;
                    menu_y2 = gsGlobal->Height*0.85+FONT_HEIGHT;
					text_line = menu_y1 + 4;
                    option_changed = 1;
                    //SetGsCrt(gsGlobal->Interlace,gsGlobal->Mode,gsGlobal->Field);
                    break;
                case 2: //Emulated System
                    Settings.emulation ^= 1;
                    if(Settings.emulation) {
                        temp = strstr(options[i],"NTSC");
                        *temp = 0;
                        strcat(options[i],"PAL");
                    }
                    else {
                        temp = strstr(options[i],"PAL");
                        *temp = 0;
                        strcat(options[i],"NTSC");
                    }
                    FCEUI_SetVidSystem(Settings.emulation);
                    option_changed = 1;
                    break;
                case 3: //Center Screen
                    while(menu_input(0,2) != 2) {}
                    i = 0x10000;
                    while(i--) asm("nop\nnop\nnop\nnop");
                    option_changed = 1;
                    break;
                case 4: //Configure Save Path
                    h = 0; //reset browser
                    selection = 0;
                    oldselect = -1;
                    selected = 0;
                    strcpy(path,"path"); //end reset browser
                    strcpy(Settings.savepath,Browser(0,1));
                    printf("%s",Settings.savepath);
                    strzncpy(options[5],Settings.savepath,38);
                    selected_dir = 0;
                    h = 0;
                    selection = 0;
                    oldselect = -1;
                    strcpy(path,"path");
                    option_changed = 1;
                    selected = 0;
                    break;
                case 6: //Configure ELF Path
                    h = 0;
                    selection = 0;
                    oldselect = -1;
                    selected = 0;
                    strcpy(path,"path");
                    strcpy(Settings.elfpath,Browser(1,2));
                    strzncpy(options[7],Settings.elfpath,38);
                    h = 0;
                    selection = 0;
                    oldselect = -1;
                    strcpy(path,"path");
                    option_changed = 1;
                    selected = 0;
                    break;
                case 8: //Save CNF
                    fioMkdir("mc0:FCEUMM");
                    Save_Global_CNF("mc0:/FCEUMM/FCEUltra.cnf");
                    break;
                case 9: //Power Off
                    poweroffShutdown();
                    if(Settings.display)
                        power_off = 50/4;
                    else
                        power_off = 60/4;
                    option_changed = 1;
                    break;
                case 10: //Exit to ELF
                    return 2;
                case 11: //Exit Options Menu
                    selected = 0;
                    return 1;

            }
        }
    }
}
Exemple #6
0
void TGo4EventInfo::MbsButton_clicked()
{
   TString itemname = Browser()->FindItemInAnalysis(defMbsEventName);
   if (itemname.Length()>0)
     WorkWithEvent(itemname.Data());
}