本文整理汇总了C++中Run函数的典型用法代码示例。如果您正苦于以下问题:C++ Run函数的具体用法?C++ Run怎么用?C++ Run使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Run函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Run
void AsyncRaceAnalyzerComm::RunFlashConfig(void){
Run(ACTION_FLASH_CONFIG);
}
示例3: main
int main(int argc, char** argv)
{
#if _WIN32
char current_path[MAX_PATH + 1];
GetDirectoryName(current_path, argv[0]);
SetCurrentDirectoryA(current_path);
#endif
std::vector<SampleInfo> samples =
{
INFO(Basic_Empty, "Altseedの基本", "空のウィンドウを表示するサンプル。"),
//INFO(Basic_FullScreen, "フルスクリーンモード", "アプリケーションをフルスクリーンで起動するサンプル。"),
INFO(TextureObject2D_Basic, "画像の表示", "画像を表示する基本的なサンプルです。"),
INFO(TextureObject2D_Turn, "画像の上下反転", "画像の上下を反転して描画するサンプルです。"),
INFO(TextureObject2D_Src, "画像の切り抜き", "画像の一部を切り出して描画するサンプルです。"),
INFO(TextureObject2D_Transform, "画像の変形", "画像を回転させたり、拡大縮小して描画するサンプルです。"),
INFO(Mouse_Position, "マウス座標の取得", "マウスの座標を取得し、その位置を表示するサンプルです。"),
INFO(Mouse_Click, "マウスのクリック検知", "マウスの左クリックを検知するサンプルです。"),
INFO(Mouse_State, "マウスボタンの状態", "マウスの中ボタンの状態を調べ、状態を表示するサンプルです。"),
INFO(Mouse_Wheel, "マウスホイール", "マウスホイールの回転の度合いを調べ、表示するサンプルです。"),
INFO(Keyboard_Basic, "キーボード入力の基本", "Zキーを押しているかどうかを調べ、結果を表示するサンプルです。"),
INFO(Keyboard_SingularKey, "キーボードの入力状態", "キーボードのキー入力状態を詳しく調べ、状態を表示するサンプルです。"),
INFO(Keyboard_PuralKeys, "複数のキーの入力状態", "キーボードの複数のキーの入力状態を調べ、表示するサンプルです。"),
INFO(Joystick_Basic, "ジョイスティックのボタン入力", "ジョイスティックのボタンの入力状態を調べ、表示するサンプルです。"),
INFO(Joystick_Axis, "アナログスティック入力", "ジョイスティックのアナログスティックの入力状態を調べ、表示するサンプルです。"),
INFO(Joystick_GamePad, "ゲームパッド入力", "一部のゲームパッドの入力状態を調べ、表示するサンプルです。"),
INFO(Sound_SE, "効果音の再生", "効果音(Sound Effect)を再生するサンプルです。"),
INFO(Sound_BGM, "BGMの再生", "BGMを再生するサンプルです。"),
INFO(Sound_Loop, "BGMのループ再生", "BGMをループ再生するサンプルです。"),
INFO(TextObject2D_Basic, "文字列の描画", "文字列を描画するサンプルです。"),
INFO(TextObject2D_DynamicFont, "フォントの動的生成", "フォントをプログラム実行中にに準備して、そのフォントで文字列を描画するサンプルです。"),
INFO(TextObject2D_Rotate, "文字列の回転", "文字列を回転させて描画するサンプルです。"),
INFO(TextObject2D_Filtered, "回転した文字列の滑らかな描画", "文字列の回転をしたときにギザギザが発生するのを防ぐ機能を使ったサンプルです。"),
INFO(TextObject2D_Centering, "文字列の中央揃え", "文字列を中央揃えで描画するサンプルです。"),
INFO(CameraObject2D_Basic, "カメラの基本", "カメラを用いて描画空間の一部を切り取って描画するサンプルです。"),
INFO(CameraObject2D_Magnify, "カメラによる拡大描画", "カメラを用いて描画空間の一部を虫眼鏡のように拡大して描画するサンプルです。"),
INFO(CameraObject2D_Group, "", ""),
INFO(CameraObject2D_Texture, "", ""),
INFO(EffectObject2D_Basic, "", ""),
INFO(GeometryObject2D_CircleShape, "", ""),
INFO(GeometryObject2D_ArcShape, "", ""),
INFO(GeometryObject2D_RectangleShape, "", ""),
INFO(GeometryObject2D_PolygonShape, "", ""),
INFO(GeometryObject2D_PolygonShape_Textured, "", ""),
INFO(Object2DComponent_Custom, "", ""),
INFO(Collision2D_Basic, "", ""),
INFO(Collision2D_Geometries, "", ""),
INFO(File_PackFile, "", ""),
INFO(File_RootDirectory, "", ""),
INFO(File_StaticFile, "", ""),
INFO(File_StreamFile, "", ""),
INFO(SceneAndLayer_Basic, "", ""),
INFO(SceneAndLayer_CustomLayer, "", ""),
INFO(SceneAndLayer_CustomScene, "", ""),
INFO(Transition_Fade, "フェードイン・フェードアウト", "画像を回転させたり、拡大縮小して描画するサンプルです。"),
INFO(Dispose_Object2D, "", ""),
INFO(Dispose_Layer2D, "", ""),
INFO(PostEffect_GrayScale, "", ""),
INFO(PostEffect_Sepia, "", ""),
INFO(PostEffect_GaussianBlur, "", ""),
INFO(PostEffect_LightBloom, "", ""),
INFO(EngineMisc_ShowFps, "", ""),
INFO(Texture_Basic, "", ""),
INFO(Texture_Edit, "", ""),
INFO(Log_Basic, "ログ出力", "ログファイルにログを出力するサンプルです。"),
INFO(Log_OutputLevel, "ログの出力レベルの指定", "ログファイルにログを出力するサンプルです。\n出力レベルを指定し、低レベルのログを無視します。"),
INFO(Log_Table, "表組みされたログ出力", "ログファイルに表組みで表現されたログを出力するサンプルです。"),
INFO(MediaPlayer_Basic, "", ""),
};
auto browser = SampleBrowser(samples);
browser.Run();
return 0;
}
示例4: Run
void FPcamera::Update(double dt, float heightOffset)
{
if(myKeys['w'])
{
if(myKeys['z'])
{
if (!m_bJumping)
{
Run(dt, heightOffset);
}
else
{
Walk(dt, heightOffset);
}
myKeys['z'] = false;
}
else
{
Walk(dt, heightOffset);
}
myKeys['w'] = false;
}
if(myKeys['s'])
{
if(myKeys['z'])
{
Run(-dt, heightOffset);
myKeys['z'] = false;
}
else
{
Walk(-dt, heightOffset);
}
myKeys['s'] = false;
}
if(myKeys['a'])
{
Strafe(-dt, heightOffset);
myKeys['a'] = false;
}
if(myKeys['d'])
{
Strafe(dt, heightOffset);
myKeys['d'] = false;
}
if(myKeys['q'])
{
moveUp(dt, 5.f);
myKeys['q'] = false;
}
if(myKeys['e'])
{
moveDown(dt, 5.f);
myKeys['e'] = false;
}
if(myKeys[32])
{
Jump(dt);
myKeys[32] = false;
}
if(myKeys['c'])
{
m_bCrouching = true;
Crouch(dt, heightOffset);
myKeys['c'] = false;
}
else
{
m_bCrouching = false;
Crouch(-dt, heightOffset);
}
if(m_bRecoil)
{
static float timer = 0.f;
lookUp(dt, 20.f);
timer += (float)dt;
if (timer >= 0.1f)
{
m_bRecoil = false;
timer = 0.f;
}
}
else if (!m_bRecoil && recoil > 0.f)
{
lookDown(dt, 20.f);
}
UpdateJump(dt, heightOffset);
//.........这里部分代码省略.........
示例5: TcpServerTest
void TcpServerTest()
{
Run();
}
示例6: create
std::unique_ptr<Layout> create(RenderBlockFlow& flow)
{
RenderText& textRenderer = toRenderText(*flow.firstChild());
ASSERT(!textRenderer.firstTextBox());
const RenderStyle& style = flow.style();
const unsigned textLength = textRenderer.textLength();
ETextAlign textAlign = style.textAlign();
float wordTrailingSpaceWidth = style.font().width(TextRun(&space, 1));
LazyLineBreakIterator lineBreakIterator(textRenderer.text(), style.locale());
int nextBreakable = -1;
Layout::RunVector runs;
unsigned lineCount = 0;
unsigned lineEndOffset = 0;
while (lineEndOffset < textLength) {
lineEndOffset = skipWhitespaces(textRenderer, lineEndOffset, textLength);
unsigned lineStartOffset = lineEndOffset;
unsigned wordEndOffset = lineEndOffset;
LineWidth lineWidth(flow, false, DoNotIndentText);
Vector<Run, 4> lineRuns;
lineRuns.uncheckedAppend(Run(lineStartOffset, 0));
while (wordEndOffset < textLength) {
ASSERT(!isWhitespace(textRenderer.characterAt(wordEndOffset)));
bool previousWasSpaceBetweenWords = wordEndOffset > lineStartOffset && isWhitespace(textRenderer.characterAt(wordEndOffset - 1));
unsigned wordStartOffset = previousWasSpaceBetweenWords ? wordEndOffset - 1 : wordEndOffset;
++wordEndOffset;
while (wordEndOffset < textLength) {
if (wordEndOffset > lineStartOffset && isBreakable(lineBreakIterator, wordEndOffset, nextBreakable, false))
break;
++wordEndOffset;
}
unsigned wordLength = wordEndOffset - wordStartOffset;
bool includeEndSpace = wordEndOffset < textLength && textRenderer.characterAt(wordEndOffset) == ' ';
float wordWidth;
if (includeEndSpace)
wordWidth = textWidth(textRenderer, wordStartOffset, wordLength + 1, lineWidth.committedWidth(), style) - wordTrailingSpaceWidth;
else
wordWidth = textWidth(textRenderer, wordStartOffset, wordLength, lineWidth.committedWidth(), style);
lineWidth.addUncommittedWidth(wordWidth);
// Move to the next line if the current one is full and we have something on it.
if (!lineWidth.fitsOnLine() && lineWidth.committedWidth())
break;
if (wordStartOffset > lineEndOffset) {
// There were more than one consecutive whitespace.
ASSERT(previousWasSpaceBetweenWords);
// Include space to the end of the previous run.
lineRuns.last().textLength++;
lineRuns.last().right += wordTrailingSpaceWidth;
// Start a new run on the same line.
lineRuns.append(Run(wordStartOffset + 1, lineRuns.last().right));
}
lineWidth.commit();
lineRuns.last().right = lineWidth.committedWidth();
lineRuns.last().textLength = wordEndOffset - lineRuns.last().textOffset;
lineEndOffset = wordEndOffset;
wordEndOffset = skipWhitespaces(textRenderer, wordEndOffset, textLength);
if (!lineWidth.fitsOnLine()) {
// The first run on the line overflows.
ASSERT(lineRuns.size() == 1);
break;
}
}
if (lineStartOffset == lineEndOffset)
continue;
adjustRunOffsets(lineRuns, textAlign, lineWidth.committedWidth(), lineWidth.availableWidth());
for (unsigned i = 0; i < lineRuns.size(); ++i)
runs.append(lineRuns[i]);
runs.last().isEndOfLine = true;
++lineCount;
}
textRenderer.clearNeedsLayout();
return Layout::create(runs, lineCount);
}
示例7: TEST_F
TEST_F(EntityFixture, PlayerTest) {
GetInput().assignKey(sf::Keyboard::W, Input::Up);
GetInput().assignKey(sf::Keyboard::A, Input::Left);
GetInput().assignKey(sf::Keyboard::S, Input::Down);
GetInput().assignKey(sf::Keyboard::D, Input::Right);
GetInput().assignMouseButton(sf::Mouse::Left, Input::Shoot);
GetInput().setMouseLock(true);
GetWindow().setMouseCursorVisible(false);
dot.setFillColor(sf::Color::Red);
// Add behaviors
playerUpdater = da::BehaviorPtr(new PlayerUpdater(GetView(), GetInput()));
GetManager().addBehavior(playerUpdater);
GetManager().addBehavior(velocitiesUpdater);
GetManager().addBehavior(walker);
GetManager().addBehavior(poseUpdater);
GetManager().addBehavior(xformHistorian);
// Add spatial
GetRenderer().registerSpatial<SpriteSpatial>();
// Create entity
entity = GetManager().create();
entity->addAttribute(new da::Transform);
entity->addAttribute(new da::Depth);
da::TexturePtr texture = GetContent().load<sf::Texture>("mans.png");
entity->addAttribute(new Sprite(texture));
entity->addAttribute(new TransformHistory);
entity->addAttribute(new Collider);
entity->addAttribute(new Velocities);
Poses *poses = new Poses;
Pose pose(6);
for (unsigned int j = 0; j < DirectionCount; j++) {
for (unsigned int i = 0; i < pose.getFrameCount(); i++) {
Pose::Frame frame = {
sf::IntRect(i * 16, j * 24, 16, 24),
sf::Vector2f(8, 20)
};
pose.setFrame((CardinalDirection)j, i, frame);
}
}
poses->addPose("walk", pose);
poses->isLoop = true;
poses->timePerFrame = sf::seconds(0.25f);
poses->setPose("walk", 0);
entity->addAttribute(poses);
Player *player = new Player;
player->walkSpeed = 100.f;
player->viewDistance = 40.f;
entity->addAttribute(player);
GetManager().refresh(entity);
Run(update, emptyHandler, draw);
}
示例8: main
void main(void)
#endif
{
Init();
Run();
}
示例9: MainWndProc
MRESULT _System MainWndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
{
switch (msg)
{
case WM_INITDLG:
InitDlg( hwnd);
break;
case WM_COMMAND:
if ((USHORT)mp1 == IDC_OK)
Run( hwnd);
else
if ((USHORT)mp1 == IDC_CLEAR)
ClearDlg( hwnd);
break;
case WM_CONTROL:
if (SHORT2FROMMP( mp1) != CBN_LBSELECT)
break;
switch (SHORT1FROMMP( mp1))
{
case IDC_PROCTYPE:
SwitchTypeLists( hwnd, (HWND)mp2);
break;
case IDC_ARG1TYPE:
case IDC_ARG2TYPE:
case IDC_ARG3TYPE:
case IDC_ARG4TYPE:
case IDC_ARG5TYPE:
case IDC_ARG6TYPE:
SetXDS( hwnd, (HWND)mp2, SHORT1FROMMP( mp1));
break;
}
break;
case WM_CHAR:
// defeat default button action
if (((CHARMSG(&msg)->fs & (USHORT)KC_VIRTUALKEY) &&
CHARMSG(&msg)->vkey == VK_ENTER) ||
((CHARMSG(&msg)->fs & (USHORT)KC_CHAR) &&
CHARMSG(&msg)->chr == '\r'))
break;
return (WinDefDlgProc( hwnd, msg, mp1, mp2));
case WM_CLOSE:
WinPostMsg( hwnd, WM_QUIT, NULL, NULL);
break;
case WM_DESTROY:
if (RwsClientTerminate())
printf( "\r\nRwsClientTerminate failed\r\n");
return (WinDefDlgProc( hwnd, msg, mp1, mp2));
default:
return (WinDefDlgProc( hwnd, msg, mp1, mp2));
} //end switch (msg)
return (0);
}
示例10: QMainWindow
BefungeMainWindow::BefungeMainWindow(QWidget *parent) :
QMainWindow(parent)
{
interpreter = new BefungeInterpreter(this);
setCentralWidget(new QFrame(this));
QHBoxLayout *layout_central = new QHBoxLayout();
QVBoxLayout *layout_main = new QVBoxLayout();
QVBoxLayout *layout_buttons = new QVBoxLayout();
centralWidget()->setLayout(layout_central);
QGridLayout *layout_befunge_editor = new QGridLayout();
QHBoxLayout *layout_input_output = new QHBoxLayout();
QHBoxLayout *layout_aux_widgets = new QHBoxLayout();
QVBoxLayout *layout_input = new QVBoxLayout();
QVBoxLayout *layout_output = new QVBoxLayout();
QVBoxLayout *layout_stack = new QVBoxLayout();
QVBoxLayout *layout_help = new QVBoxLayout();
befunge_editor = new QTextEdit(this);
befunge_editor->setFont(QFont("Verdana", 12));
befunge_editor->ensureCursorVisible();
befunge_editor->setLineWrapMode(QTextEdit::NoWrap);
befunge_editor->setMinimumHeight(400);
layout_befunge_editor->addWidget(befunge_editor);
befunge_input = new QTextEdit(this);
befunge_input->setFont(QFont("Verdana", 12));
befunge_input->ensureCursorVisible();
befunge_input->setLineWrapMode(QTextEdit::NoWrap);
layout_input->addWidget(new QLabel("Input", this));
layout_input->addWidget(befunge_input);
befunge_output = new QTextEdit(this);
befunge_output->setFont(QFont("Verdana", 12));
befunge_output->ensureCursorVisible();
befunge_output->setLineWrapMode(QTextEdit::NoWrap);
befunge_output->setReadOnly(true);
layout_output->addWidget(new QLabel("Output", this));
layout_output->addWidget(befunge_output);
stack_view = new QTableView(this);
layout_stack->addWidget(new QLabel("Stack", this));
layout_stack->addWidget(stack_view);
befunge_help = new QTextEdit(this);
befunge_help->setFont(QFont("Verdana", 12));
befunge_help->setMinimumWidth(550);
befunge_help->setHtml(QString("<table border=\"1\"> <tr> <th>COMMAND</th> <th>INITIAL STACK (bot->top)</th> <th>RESULT STACK</th> </tr>") %
QString("<tr> <td>+ (add)</td> <td>'value1' 'value2'</td> <td>'value1 + value2'</td> </tr>") %
QString("<tr> <td>- (subtract)</td> <td>'value1' 'value2'</td> <td>'value1 - value2'</td> </tr>") %
QString("<tr> <td>* (multiply)</td> <td>'value1' 'value2'</td> <td>'value1 * value2'</td> </tr>") %
QString("<tr> <td>/ (divide)</td> <td>'value1' 'value2'</td> <td>'value1 / value2' (nb. integer)</td> </tr>") %
QString("<tr> <td>% (modulo)</td> <td>'value1' 'value2'</td> <td>'value1 mod value2'</td> </tr>") %
QString("<tr> <td>! (not)</td> <td>'value'</td> <td>'0' if value non-zero, '1' otherwise</td> </tr>") %
QString("<tr> <td>` (greater)</td> <td>'value1' 'value2'</td> <td>'1' if value1 > value2, '0' otherwise</td> </tr>") %
QString("<tr> <td>> (right)</td> <td> </td> <td>PC -> right</td> </tr>") %
QString("<tr> <td>< (left)</td> <td> </td> <td>PC -> left</td> </tr>") %
QString("<tr> <td>^ (up)</td> <td> </td> <td>PC -> up</td> </tr>") %
QString("<tr> <td>v (down)</td> <td> </td> <td>PC -> down</td> </tr>") %
QString("<tr> <td>? (random)</td> <td> </td> <td>PC -> random direction</td> </tr>") %
QString("<tr> <td>_ (horizontal if)</td> <td>'boolean value'</td> <td>PC -> left if 'value', else PC -> right</td> </tr>") %
QString("<tr> <td>| (vertical if)</td> <td>'boolean value'</td> <td>PC -> up if 'value', else PC -> down</td> </tr>") %
QString("<tr> <td>\" (stringmode)</td> <td> </td> <td>toggles 'stringmode'</td> </tr>") %
QString("<tr> <td>: (dup)</td> <td>'value'</td> <td>'value' 'value'</td> </tr>") %
QString("<tr> <td>\\ (swap)</td> <td>'value1' 'value2'</td> <td>'value2' 'value1'</td> </tr>") %
QString("<tr> <td>$ (pop)</td> <td>'value'</td> <td>just pops 'value'</td> </tr>") %
QString("<tr> <td>. (pop)</td> <td>'value'</td> <td>pops 'value' and outputs as integer</td> </tr>") %
QString("<tr> <td>, (pop)</td> <td>'value'</td> <td>pops 'value' and outputs as ASCII</td> </tr>") %
QString("<tr> <td># (bridge)</td> <td> </td> <td>PC jumps over next cell</td> </tr>") %
QString("<tr> <td>g (get)</td> <td>'x' 'y'</td> <td>'value at (x, y)'</td> </tr>") %
QString("<tr> <td>p (put)</td> <td>'value' 'x' 'y'</td> <td>puts 'value' at (x, y)</td> </tr>") %
QString("<tr> <td>& (input value)</td> <td> </td> <td>value user entered</td> </tr>") %
QString("<tr> <td>~ (input char)</td> <td> </td> <td>character user entered</td> </tr>") %
QString("<tr> <td>@ (end)</td> <td> </td> <td>ends program</td> </tr> </table>"));
befunge_help->setReadOnly(true);
layout_help->addWidget(new QLabel("Befunge command summary", this));
layout_help->addWidget(befunge_help);
btn_run = new QPushButton("Run", this);
btn_step = new QPushButton("Step", this);
btn_stop = new QPushButton("Stop", this);
btn_exit = new QPushButton("Exit", this);
layout_buttons->addWidget(btn_run);
layout_buttons->addSpacing(5);
layout_buttons->addWidget(btn_step);
layout_buttons->addSpacing(5);
layout_buttons->addWidget(btn_stop);
layout_buttons->addStretch();
layout_buttons->addWidget(btn_exit);
layout_aux_widgets->addItem(layout_stack);
layout_aux_widgets->addItem(layout_help);
layout_input_output->addItem(layout_input);
//.........这里部分代码省略.........
示例11: AddChild
PrefWindow::PrefWindow():BWindow(BRect(100,100,600,450),
Language.get("PREFS"), B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS|B_NOT_RESIZABLE|B_NOT_ZOOMABLE)
{
AddChild(new PrefView(Bounds()));
Run();
}
示例12: Run
helper::CThreadPool &helper::CThreadPool::RunMultiAndFinish(size_t cnt, tThreadFunc threadfunc)
{
for(size_t i=0; i!=cnt; ++i)
Run(threadfunc, true);
return *this;
}
示例13: ioRead16
// Called at software interrupt time
void
AppleUSBUHCI::HandleInterrupt(void)
{
UInt16 status;
UInt32 intrStatus;
bool needReset = false;
status = ioRead16(kUHCI_STS);
USBTrace_Start( kUSBTUHCIInterrupts, kTPUHCIInterruptsHandleInterrupt, (uintptr_t)this, 0, 0, 0);
if (_hostControllerProcessInterrupt & kUHCI_STS_HCPE)
{
_hostControllerProcessInterrupt = 0;
USBLog(1, "AppleUSBUHCI[%p]::HandleInterrupt - Host controller process error", this);
USBTrace( kUSBTUHCIInterrupts, kTPUHCIInterruptsHandleInterrupt, (uintptr_t)this, 0, 0, 1 );
needReset = true;
}
if (_hostSystemErrorInterrupt & kUHCI_STS_HSE)
{
_hostSystemErrorInterrupt = 0;
USBLog(1, "AppleUSBUHCI[%p]::HandleInterrupt - Host controller system error(CMD:%p STS:%p INTR:%p PORTSC1:%p PORTSC2:%p FRBASEADDR:%p ConfigCMD:%p)", this,(void*)ioRead16(kUHCI_CMD), (void*)ioRead16(kUHCI_STS), (void*)ioRead16(kUHCI_INTR), (void*)ioRead16(kUHCI_PORTSC1), (void*)ioRead16(kUHCI_PORTSC2), (void*)ioRead32(kUHCI_FRBASEADDR), (void*)_device->configRead16(kIOPCIConfigCommand));
USBTrace( kUSBTUHCIInterrupts, kTPUHCIInterruptsHandleInterrupt, (uintptr_t)this, ioRead16(kUHCI_CMD), 0, 2 );
USBTrace( kUSBTUHCIInterrupts, kTPUHCIInterruptsHandleInterrupt, ioRead16(kUHCI_STS), ioRead16(kUHCI_INTR), ioRead16(kUHCI_PORTSC1), 3 );
USBTrace( kUSBTUHCIInterrupts, kTPUHCIInterruptsHandleInterrupt, ioRead16(kUHCI_PORTSC2), ioRead32(kUHCI_FRBASEADDR), _device->configRead16(kIOPCIConfigCommand), 4 );
needReset = true;
}
if (_resumeDetectInterrupt & kUHCI_STS_RD)
{
_resumeDetectInterrupt = 0;
USBLog(2, "AppleUSBUHCI[%p]::HandleInterrupt - Host controller resume detected - calling EnsureUsability", this);
USBTrace( kUSBTUHCIInterrupts, kTPUHCIInterruptsHandleInterrupt, (uintptr_t)this, 0, 0, 6);
EnsureUsability();
}
if (_usbErrorInterrupt & kUHCI_STS_EI)
{
_usbErrorInterrupt = 0;
USBTrace( kUSBTUHCIInterrupts, kTPUHCIInterruptsHandleInterrupt, (uintptr_t)this, 0, 0, 7);
USBLog(6, "AppleUSBUHCI[%p]::HandleInterrupt - Host controller error interrupt", this);
}
if (_usbCompletionInterrupt & kUHCI_STS_INT)
{
_usbCompletionInterrupt = 0;
// USBTrace( kUSBTUHCIInterrupts, kTPUHCIInterruptsHandleInterrupt, (uintptr_t)this, 0, 0, 8);
// updates hardware interrupt time from shadow vars that are se in the real irq handler
UpdateFrameNumberWithTime();
USBLog(7, "AppleUSBUHCI[%p]::HandleInterrupt - Normal interrupt", this);
if (_consumerCount != _producerCount)
{
USBLog(7, "AppleUSBUHCI[%p]::HandleInterrupt - Isoch was handled", this);
}
}
// this code probably doesn't work
if (needReset)
{
IOSleep(1000);
USBLog(1, "AppleUSBUHCI[%p]::HandleInterrupt - Resetting controller due to errors detected at interrupt time (0x%x)", this, status);
USBTrace( kUSBTUHCIInterrupts, kTPUHCIInterruptsHandleInterrupt, (uintptr_t)this, status, needReset, 5 );
Reset(true);
Run(true);
}
if (_myPowerState == kUSBPowerStateOn)
{
USBTrace( kUSBTUHCIInterrupts, kTPUHCIInterruptsHandleInterrupt, (uintptr_t)this, status, 0, 9);
ProcessCompletedTransactions();
// Check for root hub status change
RHCheckStatus();
}
else
{
USBLog(2, "AppleUSBUHCI[%p]::HandleInterrupt - deferring further processing until we are running again", this);
USBTrace( kUSBTUHCIInterrupts, kTPUHCIInterruptsHandleInterrupt, (uintptr_t)this, 0, 0, 10);
}
USBTrace_End( kUSBTUHCIInterrupts, kTPUHCIInterruptsHandleInterrupt, (uintptr_t)this, 0, 0, 0);
}
示例14: RunPreFunctions
void FGTurbine::Calculate(void)
{
double thrust;
RunPreFunctions();
ThrottlePos = in.ThrottlePos[EngineNumber];
if (ThrottlePos > 1.0) {
AugmentCmd = ThrottlePos - 1.0;
ThrottlePos -= AugmentCmd;
} else {
AugmentCmd = 0.0;
}
// When trimming is finished check if user wants engine OFF or RUNNING
if ((phase == tpTrim) && (in.TotalDeltaT > 0)) {
if (Running && !Starved) {
phase = tpRun;
N1_factor = MaxN1 - IdleN1;
N2_factor = MaxN2 - IdleN2;
N2 = IdleN2 + ThrottlePos * N2_factor;
N1 = IdleN1 + ThrottlePos * N1_factor;
OilTemp_degK = 366.0;
Cutoff = false;
} else {
phase = tpOff;
Cutoff = true;
EGT_degC = in.TAT_c;
}
}
if (!Running && Cutoff && Starter) {
if (phase == tpOff) phase = tpSpinUp;
}
// start
if ((Starter == true) || (in.qbar > 30.0)) {
if (!Running && !Cutoff && (N2 > 15.0)) phase = tpStart;
}
if (Cutoff && (phase != tpSpinUp)) phase = tpOff;
if (in.TotalDeltaT == 0) phase = tpTrim;
if (Starved) phase = tpOff;
if (Stalled) phase = tpStall;
if (Seized) phase = tpSeize;
switch (phase) {
case tpOff: thrust = Off(); break;
case tpRun: thrust = Run(); break;
case tpSpinUp: thrust = SpinUp(); break;
case tpStart: thrust = Start(); break;
case tpStall: thrust = Stall(); break;
case tpSeize: thrust = Seize(); break;
case tpTrim: thrust = Trim(); break;
default: thrust = Off();
}
Thruster->Calculate(thrust); // allow thruster to modify thrust (i.e. reversing)
RunPostFunctions();
}
示例15: _tWinMain
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
{
g_RunningUnderWine = running_under_wine();
#ifdef PPA_INCLUDE_CHECK_UPDATE
if (_tcsstr(lpstrCmdLine, _T(PEERS_OPTION_NO_UPDATE)) == NULL) {
string updatePath = Text::fromT(AutoUpdate::getUpdateTargetPath());
//TODO нужно еще exists(wstring), чтобы строку не преобразовывать
if (File::exists(updatePath) && File::getSize(updatePath) > 0) {
if (AutoUpdate::execute()) {
return AutoUpdate::EXIT_TO_UPDATE;
}
}
}
//TODO else вывести сообщение если архив обновления еще есть.
#endif
#ifndef _DEBUG
SingleInstance dcapp(_T("{DOMODC-AEE8350A-B49A-4753-AB4B-E55479A48351}"));
#else
SingleInstance dcapp(_T("{DOMODC-AEE8350A-B49A-4753-AB4B-E55479A48350}"));
#endif
// !SMT!-UI displaying abort message will disable generating exceptioninfo.txt
signal(SIGABRT, AbortSignalHandler);
#ifndef SMT_CUSTOM
_set_abort_behavior(0, _WRITE_ABORT_MSG);
#endif
bool multipleInstances = false;
bool magnet = false;
bool delay = false;
#ifdef _DEBUG
g_DisableSplash = true;
#endif
if(_tcsstr(lpstrCmdLine, _T("/nologo"))!=NULL || _tcsstr(lpstrCmdLine, _T("/startup"))!=NULL) {
g_DisableSplash = true;
nCmdShow = SW_SHOWMINIMIZED;
}
if(_tcsstr(lpstrCmdLine, _T("/wine"))!=NULL)
g_RunningUnderWine = true;
if(_tcsstr(lpstrCmdLine, _T("/q"))!=NULL)
multipleInstances = true;
if(_tcsstr(lpstrCmdLine, _T("/magnet"))!=NULL)
magnet = true;
if(_tcsstr(lpstrCmdLine, _T("/c")) != NULL) {
multipleInstances = true;
delay = true;
}
if(dcapp.IsAnotherInstanceRunning()) {
// Allow for more than one instance...
bool multiple = false;
if (multipleInstances == false && magnet == false) {
if (::MessageBox(NULL, _T(APPNAME) _T(" уже запущена, или еще не закончила операцию закрытия...\nВы уверены, что хотите загрузить еще одну копию программы?"),
_T(APPNAME) _T(" ") _T(VERSIONSTRING), MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2 | MB_TOPMOST) == IDYES) {
multiple = true;
}
} else {
multiple = true;
}
if(delay == true) {
Thread::sleep(2500); // let's put this one out for a break
}
if(multiple == false || magnet == true) {
HWND hOther = NULL;
EnumWindows(searchOtherInstance, (LPARAM)&hOther);
if (hOther != NULL) {
// pop up
::SetForegroundWindow(hOther);
//if (IsIconic(hOther)) {
// ::ShowWindow(hOther, SW_RESTORE); // !SMT!-f - disable, it unlocks password-protected instance
//}
sendCmdLine(hOther, lpstrCmdLine);
}
return FALSE;
}
}
srand((unsigned) time(NULL));
// For SHBrowseForFolder, UPnP
HRESULT hRes = ::CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
// before next function call
Util::initialize();
#ifdef _DEBUG
InitSymInfo(Text::toT(Util::getDataPath()).c_str());
#endif
LPTOP_LEVEL_EXCEPTION_FILTER pOldSEHFilter = NULL;
pOldSEHFilter = SetUnhandledExceptionFilter(&DCUnhandledExceptionFilter);
WSADATA wsaData;
WSAStartup(MAKEWORD(2, 2), &wsaData);
AtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES | ICC_LISTVIEW_CLASSES | ICC_TREEVIEW_CLASSES | ICC_PROGRESS_CLASS | ICC_STANDARD_CLASSES |
ICC_TAB_CLASSES | ICC_UPDOWN_CLASS | ICC_USEREX_CLASSES); // add flags to support other controls
hRes = _Module.Init(NULL, hInstance);
ATLASSERT(SUCCEEDED(hRes));
//.........这里部分代码省略.........