예제 #1
0
// Simplified version for public release
bool CCCHLogicalChannel::processPages()
{
	while (NewPagingEntry *npe1 = gPagingQ.mPageQ.readNoBlock()) {
		LOG(DEBUG)<<LOGVAR(npe1);
		if (npe1->mGprsClient) {	// Is it a GPRS page?
			// Add 51 to the frame time because the message because the MS may be on the other 51-multiframe.
			Time future(mCcchNextWriteTime + 52);
			if (! sendGprsCcchMessage(npe1,future)) {
				delete npe1;	// In the incredibly unlikely event that the above failed, just give up.
				continue;
			}
		} else {
			const L3MobileIdentity& id1 = npe1->getMobileId();
			ChannelType type1 = npe1->getGsmChanType();
			L3PagingRequestType1 page1(id1,type1);
			L2LogicalChannelBase::l2sendm(page1,L3_UNIT_DATA);
		}
		if (++npe1->mSendCount < 2) {	// Send each page twice.
			gPagingQ.mPageQ.write_front(npe1);	// Put it back for resend in the next multiframe.
		} else {
			delete npe1;
		}
		return true;
	}
	return false;	// CCCH unused.
}
예제 #2
0
파일: hello.cpp 프로젝트: xushiwei/winx
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
	CHelloPage page1(_T("This is page1"));
	page1.DoModal(NULL, _T("PropertySheet"), _T("SinglePage"));

	CHelloPage page2(_T("This is page2"));
	winx::PropertySheetT<2> sheet(_T("PropertySheet"));
	sheet.AddPage(page1.Create(_T("Page1")));
	sheet.AddPage(page2.Create(_T("Page2")));
	sheet.DoModal();
	return 0;
}
예제 #3
0
wmMenuWidget::wmMenuWidget( QWidget *parent, const char *name )
    : QWidget( parent, name ){

  QPopupMenu *file = new QPopupMenu;
  CHECK_PTR( file );
  file->insertItem( "Run",  this, SLOT(run()) );
  file->insertItem( "Restart",  this, SLOT(restart()) );
  file->insertItem( "Exit",  kapp , SLOT(quit()) );

  view = new QPopupMenu;
  CHECK_PTR( view );
  view->insertItem( "Page 1",  this, SLOT(page1()) );
  view->insertItem( "Page 2",  this, SLOT(page2()) );
  view->insertItem( "Page 3",  this, SLOT(page3()) );
  view->insertItem( "Page 4",  this, SLOT(page4()) );

  QPopupMenu *help = new QPopupMenu;
  CHECK_PTR( help );
  help->insertItem( "KWM Help",  this, SLOT(kwmhelp()) );
  help->insertSeparator();
  help->insertItem( "About",  this, SLOT(about()) );

  windows = new QPopupMenu;
  CHECK_PTR( help );

  QPopupMenu *options = new QPopupMenu;
  CHECK_PTR( help );
  int checkT = options->insertItem( "Transparent Move",  this, SLOT(transpMove()) );
  options->setItemChecked(checkT,TRUE);
  int checkO = options->insertItem( "Opaque Move",  this, SLOT(opaqueMove()) );
  options->insertItem( "Titlebar",  this, SLOT(changeTitlebar()) );
//  options->insertSeparator();
//  int enableSO = options->insertItem( "Save Options", kapp, SLOT(saveOptions()) );
//  options->setItemEnabled( enableSO, FALSE);  

  menu = new QMenuBar( this );
  CHECK_PTR( menu );
  menu->insertItem( "File", file );
  menu->insertItem( "View", view );
  menu->insertItem( "Windows", windows );
  menu->insertItem( "Options", options );
  menu->insertSeparator();
  menu->insertItem( "Help", help );
  menu->setGeometry( 0, 0, 300, 22);

  setGeometry(0,0,308,28);

}  /* end wmMenuWidget::wmMenuWidget */
예제 #4
0
Control::Control(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Control)
{
    ui->setupUi(this);
    setWindowTitle("GSM管理界面");
    out = new Dataout(0,"0",this);
    in = new DataIn();
    ui->stackedWidget->setCurrentIndex(0);
    ui->stackedWidget_2->setCurrentIndex(0);
    QRegExp regExp("0?[.][0-9]+$");
    ui->lineEdit->setValidator(new QRegExpValidator(regExp,this));
    initTime();
    addBTSname();
    addCellID();
    connect(ui->confirm,SIGNAL(clicked()),this,SLOT(data_in()));
    connect(ui->confirm_2,SIGNAL(clicked()),this,SLOT(data_out()));
    connect(ui->pushButton,SIGNAL(clicked()),this,SLOT(page1()));
    connect(ui->pushButton_2,SIGNAL(clicked()),this,SLOT(page2()));
    connect(ui->confirm_3,SIGNAL(clicked()),this,SLOT(queryBTS()));
    connect(ui->pushButton_3,SIGNAL(clicked()),this,SLOT(page3()));
    connect(ui->pushButton_4,SIGNAL(clicked()),this,SLOT(page4()));
    connect(ui->confirm_4,SIGNAL(clicked()),this,SLOT(queryCell()));
    connect(ui->pushButton_6,SIGNAL(clicked()),this,SLOT(bulkInsert()));
    connect(ui->pushButton_5,SIGNAL(clicked()),this,SLOT(page5()));
    connect(ui->pushButton_9,SIGNAL(clicked()),this,SLOT(reCalculateDatas()));
    connect(ui->pushButton_7,SIGNAL(clicked()),this,SLOT(page6()));
    connect(ui->pushButton_11,SIGNAL(clicked()),this,SLOT(printNeighbor()));
    connect(ui->pushButton_8,SIGNAL(clicked()),this,SLOT(page7()));
    connect(ui->pushButton_10,SIGNAL(clicked()),this,SLOT(findNeighbor()));
    connect(ui->pushButton_12,SIGNAL(clicked()),this,SLOT(findCellInfo()));


    connect(ui->pushButton_13,SIGNAL(clicked()),this,SLOT(page13()));
    connect(ui->pushButton_14,SIGNAL(clicked()),this,SLOT(page14()));
    connect(ui->pushButton_15,SIGNAL(clicked()),this,SLOT(page15()));
    connect(ui->pushButton_16,SIGNAL(clicked()),this,SLOT(page16()));
    connect(ui->pushButton_17,SIGNAL(clicked()),this,SLOT(page17()));
    connect(ui->pushButton_18,SIGNAL(clicked()),this,SLOT(page18()));

    connect(ui->pushButton_22,SIGNAL(clicked()),this,SLOT(action22()));
    connect(ui->pushButton_23,SIGNAL(clicked()),this,SLOT(action23()));
}
예제 #5
0
int main(void)
{
    uint8_t page = 100;
    system_init();
    dog_Init(0);

    for(;;)
    {

        dog_StartPage();
        do
        {
            switch(page) {
            case 100:
                page_intro();
                break;
            case 0:
                page0();
                break;
            case 1:
                page1();
                break;
            case 2:
                page2();
                break;
            case 3:
                page3();
                break;
            case 4:
                page4();
                break;
            case 5:
                page5();
                break;
            }
        } while( dog_NextPage() );
        dog_Delay(1500);
        page++;
        if ( page >= 6 )
            page = 0;
    }
}
예제 #6
0
VideoGeneralSettings::VideoGeneralSettings()
{
    ConfigPage::PageList pages;

    VConfigPage page1(pages, false);
    page1->addChild(VideoStartupDirectory());
    page1->addChild(TrailerDirectory());
    page1->addChild(VideoArtworkDirectory());
    page1->addChild(VideoScreenshotDirectory());
    page1->addChild(VideoBannerDirectory());
    page1->addChild(VideoFanartDirectory());

    VConfigPage page2(pages, false);
    page2->addChild(SetOnInsertDVD());
    page2->addChild(SetDVDDriveSpeed());
    page2->addChild(VideoTreeRemember());

    // page 3
    VerticalConfigurationGroup *pctrl =
            new VerticalConfigurationGroup(true, false);
    pctrl->setLabel(QObject::tr("Parental Control Settings"));
    pctrl->addChild(VideoDefaultParentalLevel());
    pctrl->addChild(VideoAdminPassword());
    pctrl->addChild(VideoAdminPasswordThree());
    pctrl->addChild(VideoAdminPasswordTwo());
    pctrl->addChild(VideoAggressivePC());
    VConfigPage page3(pages, false);
    page3->addChild(pctrl);

    VConfigPage page4(pages, false);
    page4->addChild(new RatingsToPL());

    int page_num = 1;
    for (ConfigPage::PageList::const_iterator p = pages.begin();
         p != pages.end(); ++p, ++page_num)
    {
        (*p)->setLabel(QObject::tr("General Settings (%1/%2)").arg(page_num)
                       .arg(pages.size()));
        addChild(*p);
    }
}
예제 #7
0
void TestWol()
{
	{
		LVStreamRef stream = LVOpenFileStream("woltest.wol", LVOM_WRITE);
		if (!stream)
			return;
		LVArray<lUInt32> m(10, 0xbad);
		m.clear();
		WOLWriter wol(stream.get());
		wol.addTitle(
			lString8("book title"),
			lString8("subj."),
			lString8("John Smith"),
			lString8("adapter"),
			lString8("translator"),
			lString8("publisher"),
			lString8("2006-11-01"),
			lString8("This is introduction."),
			lString8("ISBN")
		);
		LVGrayDrawBuf cover(600, 800);
		cover.FillRect(20, 20, 50, 50, 1);
		cover.FillRect(40, 70, 120, 190, 2);
		cover.FillRect(60, 80, 150, 290, 3);
		LVGrayDrawBuf page1(600, 800, 2);
		page1.FillRect(0, 0, 150, 150, 1);
		page1.FillRect(70, 70, 140, 140, 2);
		page1.FillRect(130, 130, 180, 180, 3);
		page1.FillRect(400, 400, 550, 750, 1);
		page1.FillRect(420, 420, 530, 730, 2);
		page1.FillRect(440, 440, 510, 710, 3);
		LVGrayDrawBuf page2(600, 800, 2);
		page2.FillRect(120, 20, 150, 50, 1);
		page2.FillRect(140, 70, 220, 190, 2);
		page2.FillRect(160, 80, 250, 290, 3);
		LVGrayDrawBuf page3(600, 800, 2);
		page3.FillRect(120, 120, 30, 20, 1);
		page3.FillRect(10, 10, 120, 120, 2);
		page3.FillRect(300, 300, 300, 700, 3);
		page3.FillRect(400, 400, 550, 750, 1);
		page3.FillRect(420, 420, 530, 730, 2);
		page3.FillRect(440, 440, 510, 710, 3);
		wol.addCoverImage(cover);
		wol.addImage(page1);
		wol.addImage(page2);
		wol.addImage(page3);
		SaveBitmapToFile("page1.bmp", &page1);
		SaveBitmapToFile("page2.bmp", &page2);
		SaveBitmapToFile("page3.bmp", &page3);
	}

	{
		//LVStream * stream = LVOpenFileStream("Biblia.wol", LVOM_READ);
		LVStreamRef stream = LVOpenFileStream("woltest.wol", LVOM_READ);
		//LVStream * stream = LVOpenFileStream("info2.wol", LVOM_READ);
		if (!stream)
			return;
		WOLReader rd(stream.get());
		if (!rd.readHeader())
			return;
		LVStreamRef cover = LVOpenFileStream("cover2.bin", LVOM_WRITE);
		LVStreamRef log = LVOpenFileStream("woltest.log", LVOM_WRITE);
		LVArray<lUInt8> * rdcover = rd.getBookCover();
		LVGrayDrawBuf * rdimg1 = rd.getImage(0);
		*cover << *rdcover;
		//int imgsz = (rdimg1->GetWidth()*2+7)/8*rdimg1->GetHeight();
		//LVArray<lUInt8> imgbuf(imgsz, 0);
		//memcpy(imgbuf.ptr(), rdimg1->GetScanLine(0), imgsz );
		if (rdimg1)
			SaveBitmapToFile( "test.bmp", rdimg1 );
		//*img << imgbuf;
		*log << rd.getBookTitle();
		*log << "\r\nimages found: " << lString8::itoa(rd.getImageCount());
		delete rdimg1;
	}
}