public PageSymmSpan(MainWindow _mainWindow) { InitializeComponent(); mMainWindow = _mainWindow; mLayoutInstruction = new LayoutInstruction(ref mBaseCanvas); mTestGroupScheme = new int[] { 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8 }; mPracGroupScheme = new int[] { 2, 2 }; interFilename = "inter_" + mMainWindow.mDemography.GenBriefString() + ".txt"; posFilename = "pos_" + mMainWindow.mDemography.GenBriefString() + ".txt"; pracPosFilename = "prac_pos_" + mMainWindow.mDemography.GenBriefString() + ".txt"; pracSymmFilename = "prac_symm_" + mMainWindow.mDemography.GenBriefString() + ".txt"; LoaderSymmSpan loader = new LoaderSymmSpan("SYMM\\sourceIndex.txt", "SYMM\\fixedItems.txt", "SYMM\\locationExe.txt", "SYMM\\fixedSymmExeBaseline.txt"); List <TrailSS_ST> rList = loader.GetResourceList(); if (!mbFixedItems) { RandomSelector testRanSel = new RandomSelector(rList, mTestGroupScheme); mTest = testRanSel.Get(); RandomSelector pracRanSel = new RandomSelector(rList, mPracGroupScheme); mPrac = pracRanSel.Get(); } else { mTest = loader.GetFixedItemGroups(mTestGroupScheme); mPrac = loader.GetFixedComprehExe(mPracGroupScheme); mPracLocation = loader.GetFixedLocationExe(); mPractiseSymm = loader.GetFixedSymmExe(); } mGroupsAnswer = new List <AnswerSSST>(); mStatus = StatusSS.main_title;//test could be from here mTimer = new FEITTimer(); mTimer.Start(); mRecorder = new RecorderSymSpan(this); /*if (!mMainWindow.mDB.TableExists(Names.SYMSPAN_POS_TABLENAME)) * { * mMainWindow.mDB.CreateSymSpanPosTable(mTestGroup.Length); * } * * if (!mMainWindow.mDB.TableExists(Names.SYMSPAN_SYMM_TABLENAME)) * { * mMainWindow.mDB.CreateSymSpanSymmTable(trails.Count); * }*/ }
//Timer mIKnowBtnShower; public void showSymmPage() { Mouse.OverrideCursor = Cursors.Hand; mPage.ClearAll(); //control component System.Windows.Controls.Image img_ctrl = new System.Windows.Controls.Image(); //uri resource loading Uri uriimage = new Uri(LoaderSymmSpan.GetBaseFolder() + "SYMM\\" + mContent[mGrpAt].Trails[mItemAt].FileName); //image BitmapImage img = new BitmapImage(uriimage); //set to control img_ctrl.Source = img; img_ctrl.Width = 600; img_ctrl.Height = 450; mPage.mBaseCanvas.Children.Add(img_ctrl); Canvas.SetTop(img_ctrl, FEITStandard.PAGE_BEG_Y + (FEITStandard.PAGE_HEIGHT - img_ctrl.Height) / 2); Canvas.SetLeft(img_ctrl, FEITStandard.PAGE_BEG_X + (FEITStandard.PAGE_WIDTH - img_ctrl.Width) / 2); mfRoute = showDualDeterPage; if (!mPractise) { arrangeAutoIKnowAndAutoFlipperInSymmPage(); } else { if (mGrpAt == 0) { CompBtnNextPage btn = new CompBtnNextPage("看好了"); btn.Add2Page(mPage.mBaseCanvas, FEITStandard.PAGE_BEG_Y + 450); btn.mfOnAction = nextStep; } else { arrangeAutoIKnowAndAutoFlipperInSymmPage(); } } //record mPage.mRecorder.symmOnTime.Add(mPage.mTimer.GetElapsedTime()); }
private void putPicAtCanvas(string picname) { System.Windows.Controls.Image img_ctrl = new System.Windows.Controls.Image(); //uri resource loading Uri uriimage = new Uri(LoaderSymmSpan.GetBaseFolder() + "SYMM\\" + picname); //image BitmapImage img = new BitmapImage(uriimage); //set to control img_ctrl.Source = img; img_ctrl.Width = 600; img_ctrl.Height = 450; mPage.mBaseCanvas.Children.Add(img_ctrl); Canvas.SetTop(img_ctrl, FEITStandard.PAGE_BEG_Y + (FEITStandard.PAGE_HEIGHT - img_ctrl.Height) / 2); Canvas.SetLeft(img_ctrl, FEITStandard.PAGE_BEG_X + (FEITStandard.PAGE_WIDTH - img_ctrl.Width) / 2); }