public static float[] learningFactor = { 0.01f };// ,0.001f, 0.1f }; public static void RunTests(INeuralDataSet learningSet, INeuralDataSet testingSet, int inputSize, int testingSize, List <Face> learningFaces, List <Face> testingFaces) { hiddenNeurons_test = initList(); int counter = 0; for (int i = 0; i < iterations.Length; i++) { for (int h = 0; h < hiddenLayers_test.Length; h++) { for (int n = 0; n < hiddenNeurons_test.Count; n++) { if (hiddenNeurons_test[n].Length == hiddenLayers_test[h]) { for (int l = 0; l < learningFactor.Length; l++) { counter++; InputClass configuration = new InputClass(); configuration.hiddenLayers = hiddenLayers_test[h]; configuration.hiddenNeurons = hiddenNeurons_test[n]; configuration.activationFunction = new ActivationSigmoid(); configuration.bias = true; configuration.iterations = iterations[i]; configuration.learningFactor = (double)learningFactor[l]; configuration.momentum = 0.4; Learn(learningSet, testingSet, learningFaces[0].Features.Count, configuration, testingFaces.Count, counter); } } } } } }
public GameClass(bool startFullScreen, Size size, bool enableNetwork) { this.startFullscreen = startFullScreen; this.Size = size; this.networkEnabled = enableNetwork; this.Text = "SpaceWar3D-Step12"; statusMessageTimer = Constants.StatusMessageDisplayTime; drawingFont = new GraphicsFont( "Verdana", System.Drawing.FontStyle.Regular); input = new InputClass(this); mouseInput = new MouseInput(this); this.MouseMove +=new MouseEventHandler(GameClass_MouseMove); this.Cursor = Cursors.NoMove2D; camera = new Camera(); soundHandler = new SoundHandler(this); if (networkEnabled) { peer = new PlayClass(this); if (peer.IsHost) { hullColor = HullColors.Red; } } }
public InputObject DefineObject(string name, string className, object[] initArgs) { // first, try to find this class className = className.ToLower(); InputClass c = GetClass(className); if (c == null) { throw new Exception("Class '" + className + "' not found when constructing object '" + name + "'."); } name = name.ToLower(); InputObject o = c.PrintObject(name); if (name != "anon") { Objects[name] = o; } // if it has an initializer, run it now if (o.Implementation.Funcs.TryGetValue("f:init", out Exline init)) { init.Execute(initArgs); } return(o); }
//public override ResultClass Mz_CancelRegister(InputClass inputClass)//string serialNO) //{ // ResultClass resultClass = new ResultClass(); // try // { // resultDic.Clear(); // MI_Register register = JsonHelper.DeserializeJsonToObject<MI_Register>(inputClass.SInput[InputType.MI_Register].ToString()); // MI_MedicalInsurancePayRecord medicalInsurancePayRecord = JsonHelper.DeserializeJsonToObject<MI_MedicalInsurancePayRecord>(inputClass.SInput[InputType.MI_MedicalInsurancePayRecord].ToString()); // MI_MIPayRecordHead mIPayRecordHead = JsonHelper.DeserializeJsonToObject<MI_MIPayRecordHead>(inputClass.SInput[InputType.MI_MIPayRecordHead].ToString()); // List<MI_MIPayRecordDetail> mIPayRecordDetailList = JsonHelper.DeserializeJsonToList<MI_MIPayRecordDetail>(inputClass.SInput[InputType.MI_MIPayRecordDetailList].ToString()); // //更新登记表 // ResultClass regResultClass = hisDao.Mz_SaveRegister(register); // //更新交易表 // MI_MedicalInsurancePayRecord medicalInsurancePayRecordResult = hisDao.Mz_GetPayRecord(1, register.ID.ToString(), 1, 1); // if (medicalInsurancePayRecordResult != null) // { // medicalInsurancePayRecordResult.state = 3; // hisDao.Mz_SavePayRecord(medicalInsurancePayRecordResult); // } // medicalInsurancePayRecord.FeeNO = medicalInsurancePayRecordResult.FeeNO; // if (regResultClass.bSucess) // { // if (hisDao.SaveTradeInfo(medicalInsurancePayRecord, mIPayRecordHead, mIPayRecordDetailList) == null) // { // resultClass.bSucess = false; // resultClass.sRemarks = "更新交易信息失败!"; // } // else // { // //返回数据到前台界面,只需金额 // resultClass.bSucess = true; // } // } // else // { // resultClass.bSucess = false; // resultClass.sRemarks = "更新登记信息失败!"; // } // resultClass.oResult = resultDic; // } // catch (Exception e) // { // resultClass.bSucess = false; // resultClass.sRemarks = e.Message; // } // return resultClass; //} /// <summary> /// 预取消挂号:保存预取消信息 并返回记录ID /// </summary> /// <param name="inputClass"></param> /// <returns></returns> public override ResultClass Mz_CancelRegister(InputClass inputClass)//string serialNO) { ResultClass resultClass = new ResultClass(); try { MI_Register register = JsonHelper.DeserializeJsonToObject <MI_Register>(inputClass.SInput[InputType.MI_Register].ToString()); MI_MedicalInsurancePayRecord medicalInsurancePayRecord = JsonHelper.DeserializeJsonToObject <MI_MedicalInsurancePayRecord>(inputClass.SInput[InputType.MI_MedicalInsurancePayRecord].ToString()); MI_MIPayRecordHead mIPayRecordHead = JsonHelper.DeserializeJsonToObject <MI_MIPayRecordHead>(inputClass.SInput[InputType.MI_MIPayRecordHead].ToString()); List <MI_MIPayRecordDetail> mIPayRecordDetailList = JsonHelper.DeserializeJsonToList <MI_MIPayRecordDetail>(inputClass.SInput[InputType.MI_MIPayRecordDetailList].ToString()); MI_MedicalInsurancePayRecord medicalInsurancePayRecordNew = hisDao.SaveTradeInfo(medicalInsurancePayRecord, mIPayRecordHead, mIPayRecordDetailList); if (medicalInsurancePayRecordNew == null) { resultClass.bSucess = false; resultClass.sRemarks = "更新交易信息失败!"; } else { //返回新数据ID resultClass.bSucess = true; resultClass.oResult = medicalInsurancePayRecordNew.ID; } } catch (Exception e) { resultClass.bSucess = false; resultClass.sRemarks = e.Message; } return(resultClass); }
private async void Ucz_Siec_Click(object sender, RoutedEventArgs e) { BlakWait.Visibility = Visibility.Visible; inputData = new InputClass(); if (learningFaces.Count < 1 || learningFaces == null) { MessageBox.Show("Error ! No data is loaded"); BlakWait.Visibility = Visibility.Collapsed; return; } if (testingFaces.Count < 1 || testingFaces == null) { MessageBox.Show("Error ! No data is loaded"); BlakWait.Visibility = Visibility.Collapsed; return; } if (inputData.ValidateInput(TBLayers.Text, TBNeuronsInLayer.Text, ActivationFunction, TBIteracje.Text, TBWspUczenia.Text, TBWspBezwladnosci.Text) == false) { BlakWait.Visibility = Visibility.Collapsed; return; } else { LEnumber.Content = "---"; TEnumber.Content = "---"; Tnumber.Content = "---"; await PerformCalculation(); LEnumber.Content = inputData.learningError.ToString(); TEnumber.Content = inputData.testingError.ToString(); Tnumber.Content = inputData.timeElapsed.ToString(); } BlakWait.Visibility = Visibility.Collapsed; }
public void PerformFinalTest(List <List <Face> > faces) { var stopwatch = new Stopwatch(); stopwatch.Start(); var date = DateTime.Now.ToString("yyyy-dd-M-HH-mm-ss"); var networkLearningInput = NetworkHelper.CreateNetworkInputDataSet(faces, 12, 5, DataSetType.Learning, 12); var networkLearningOutput = NetworkHelper.CreateNetworkOutputDataSet(faces, 12, 5, DataSetType.Learning, 15); var networkValidationInput = NetworkHelper.CreateNetworkInputDataSet(faces, 12, 5, DataSetType.Validation, 12); var networkValidationOutput = NetworkHelper.CreateNetworkOutputDataSet(faces, 12, 5, DataSetType.Validation, 15); var networkTestingInput = NetworkHelper.CreateNetworkInputDataSet(faces, 12, 5, DataSetType.Testing, 12); var networkTestingOutput = NetworkHelper.CreateNetworkOutputDataSet(faces, 12, 5, DataSetType.Testing, 15); var learningSet = NetworkHelper.NormaliseDataSet(networkLearningInput, networkLearningOutput); var validationSet = NetworkHelper.NormaliseDataSet(networkValidationInput, networkValidationOutput); var testingSet = NetworkHelper.NormaliseDataSet(networkTestingInput, networkTestingOutput); foreach (double learningRate in new double[] { 0.001, 0.003 }) { Parallel.ForEach(seeds, (x) => { var inputDataCopy = new InputClass(learningRate, id.Momentum, id.HiddenLayers, id.HiddenNeurons, id.Bias, id.PeopleCount, id.ActivationFunction, id.IterationsCount); NetworkHelper.LearnNetwork(learningSet, testingSet, faces[0][0].features.Count, 15, inputDataCopy, validationSet, x); Task.Factory.StartNew(() => XmlFileWriter.WriteDataToFile("FinalTest" + date + ".xml", inputDataCopy.LearningError, inputDataCopy.ValidationError, inputDataCopy.TestingError, inputDataCopy.ElapsedTime, inputDataCopy.IterationsCount, inputDataCopy.LearningFactor, inputDataCopy.Momentum, inputDataCopy.HiddenLayers, inputDataCopy.HiddenNeurons, inputDataCopy.Bias, stopwatch.Elapsed, null, x) ); }); } }
/// <summary> /// 取消登记 /// </summary> /// <param name="inputClass"></param> /// <returns></returns> public ResultClass Mz_CancelRegister(InputClass inputClass) { ResultClass resultClass = new ResultClass(); try { Action <ClientRequestData> requestAction = ((ClientRequestData request) => { request.AddData(inputClass); }); ServiceResponseData retdataMember = InvokeWcfService("MIService.Service", "MIMzController", "Mz_CancelRegister", requestAction); resultClass.bSucess = retdataMember.GetData <bool>(0); resultClass.sRemarks = retdataMember.GetData <string>(1); if (resultClass.bSucess) { int newRecordId = retdataMember.GetData <int>(2); resultClass.oResult = newRecordId; } } catch (Exception e) { resultClass.bSucess = false; resultClass.sRemarks = e.Message; } return(resultClass); }
public override ResultClass MZ_GetPersonInfo(InputClass inputClass) { sDll = new SiInterfaceDll(); string sCardNo = inputClass.SInput.ContainsKey(InputType.CardNo) ? inputClass.SInput[InputType.CardNo].ToString() : ""; return(ybInterfaceDao.Mz_GetPersonInfo(sDll, sCardNo)); }
public void ManualObjectTest() { InputContext context = new InputContext(); Exline e1 = new Exline("v:hp := 100; f:damage := {v:hp -= a:0};"); context.CompileLine(e1); e1.Execute(new object[] { 0.0 }); InputClass testClass = new InputClass("test", context); InputObject testObj = testClass.PrintObject("a"); // see that obj has its own var and func implementations and scoping works Exline e2 = new Exline("f:damage(15)"); testObj.Implementation.CompileLine(e2); Assert.AreEqual(new InputVar("v:hp", 85.0), e2.Execute(new object[] { 0.0 })); Assert.AreEqual(new InputVar("v:hp", 70.0), e2.Execute(new object[] { 0.0 })); // but also see that the original class is unaffected by the lines we just executed Exline e3 = new Exline("f:damage(15)"); testClass.Definition.CompileLine(e3); Assert.AreEqual(new InputVar("v:hp", 85.0), e3.Execute(new object[] { 0.0 })); }
//public override ResultClass MZ_RegisterRollBack(InputClass inputClass) //{ // ResultClass resultClass = new ResultClass(); // string serialNO = inputClass.SInput.ContainsKey(InputType.SerialNO) ? inputClass.SInput[InputType.SerialNO].ToString() : ""; // int registerId = inputClass.SInput.ContainsKey(InputType.RegisterId) ? Convert.ToInt32(inputClass.SInput[InputType.RegisterId]) : -1; // try // { // MI_Register register = hisDao.Mz_Getregister(registerId, serialNO); // if (register == null) // { // resultClass.bSucess = false; // resultClass.sRemarks = "获取登记信息失败!"; // AddLog("获取HIS登记信息失败!", Color.Red); // } // else // { // //取消医保登记并返回结果 // resultClass = ybInterfaceDao.Mz_CancelRegister(sDll, register.SocialCreateNum); // DivideResult.root root = (DivideResult.root)resultClass.oResult; // //解析返回数据,并保存退费记录 // MI_MedicalInsurancePayRecord medicalInsurancePayRecord = ResultToPayRecord(root.output); // MI_MIPayRecordHead mIPayRecordHead = ResultToPayRecordHead(root.output); // List<MI_MIPayRecordDetail> mIPayRecordDetailList = ResultToPayRecordDetail(root.output); // register.ValidFlag = 2; // medicalInsurancePayRecord.state = 2; // medicalInsurancePayRecord.RegId = register.ID; // medicalInsurancePayRecord.TradeType = 1; // InputClass input = new InputClass(); // Dictionary<InputType, object> dicStr = new Dictionary<InputType, object>(); // dicStr.Add(InputType.MI_Register, JsonHelper.SerializeObject(register)); // dicStr.Add(InputType.MI_MedicalInsurancePayRecord, JsonHelper.SerializeObject(medicalInsurancePayRecord)); // dicStr.Add(InputType.MI_MIPayRecordHead, JsonHelper.SerializeObject(mIPayRecordHead)); // dicStr.Add(InputType.MI_MIPayRecordDetailList, JsonHelper.SerializeObject(mIPayRecordDetailList)); // input.SInput = dicStr; // resultClass = hisDao.Mz_CancelRegister(input); // } // } // catch (Exception e) // { // resultClass.bSucess = false; // resultClass.sRemarks = e.Message; // AddLog("回滚登记报错:" + e.Message, Color.Red); // } // return resultClass; //} public override ResultClass MZ_UpdateRegister(InputClass inputClass) { ResultClass resultClass = new ResultClass(); try { int registerId = inputClass.SInput.ContainsKey(InputType.RegisterId) ? Tools.ToInt32(inputClass.SInput[InputType.RegisterId].ToString(), 0) : -1; string serialNO = inputClass.SInput.ContainsKey(InputType.SerialNO) ? inputClass.SInput[InputType.SerialNO].ToString() : ""; InputClass input = new InputClass(); Dictionary <InputType, object> dicStr = new Dictionary <InputType, object>(); dicStr.Add(InputType.RegisterId, registerId); dicStr.Add(InputType.SerialNO, serialNO); input.SInput = dicStr; resultClass = hisDao.MZ_UpdateRegister(input); } catch (Exception e) { resultClass.bSucess = false; resultClass.sRemarks = "更新中间表报错:" + e.ToString(); AddLog("更新中间表报错:" + e.Message, Color.Red); return(resultClass); } return(resultClass); }
public override ResultClass MZ_Charge(InputClass inputClass) { ResultClass resultClass = new ResultClass(); try { int tradeRecordId = inputClass.SInput.ContainsKey(InputType.TradeRecordId) ? Tools.ToInt32(inputClass.SInput[InputType.TradeRecordId].ToString(), 0) : 0; string fph = inputClass.SInput.ContainsKey(InputType.InvoiceNo) ? inputClass.SInput[InputType.InvoiceNo].ToString() : ""; //医保登记并返回结果 resultClass = ybInterfaceDao.MZ_Charge(sDll); decimal personcount = Tools.ToDecimal(resultClass.oResult.ToString(), 0); AddLog("医保结算解析完成,开始保存", Color.Blue); inputClass.SInput.Add(InputType.Money, personcount.ToString()); //解析返回结果到类,保存 resultClass = hisDao.MZ_Charge(inputClass); } catch (Exception e) { resultClass.bSucess = false; resultClass.sRemarks = e.Message; AddLog("医保结算失败,报错:" + e.Message, Color.Red); } return(resultClass); }
private async void Ucz_Siec_Click(object sender, RoutedEventArgs e) { BlakWait.Visibility = Visibility.Visible; inputData = new InputClass(); if (Faces.Count < 1 || Faces == null) { MessageBox.Show("Error ! No data is loaded"); BlakWait.Visibility = Visibility.Collapsed; return; } if (inputData.ValidateInput(TBLayers.Text, TBNeuronsInLayer.Text, ActivationFunction, CBObciazenie.SelectedIndex, TBIteracje.Text, TBWspUczenia.Text, TBWspBezwladnosci.Text, peopleNumber) == false) { BlakWait.Visibility = Visibility.Collapsed; return; } else { lblLearningError.Content = "..."; lblTestingError.Content = "..."; lblPeopleCount.Content = "..."; lblTimeElapsed.Content = "..."; lblValidationError.Content = "..."; lblIterationsCount.Content = "..."; await PerformCalculation(); lblLearningError.Content = inputData.LearningError; lblTestingError.Content = inputData.TestingError; lblPeopleCount.Content = inputData.PeopleCount; lblTimeElapsed.Content = inputData.ElapsedTime.ToString(); lblValidationError.Content = inputData.ValidationError; lblIterationsCount.Content = inputData.IterationsCount; } BlakWait.Visibility = Visibility.Collapsed; }
void MyFunc(InputClass input, out OutputClass output) { output = new OutputClass(); output.n = input.n; System.Threading.Thread.Sleep(10000); //return true; }
public override ResultClass Mz_UpdateTradeRecord(InputClass inputClass) { ResultClass resultClass = new ResultClass(); string sTradeNo = inputClass.SInput.ContainsKey(InputType.TradeNo) ? inputClass.SInput[InputType.TradeNo].ToString(): "0"; bool bFlag = inputClass.SInput.ContainsKey(InputType.bFlag) ? (bool)inputClass.SInput[InputType.bFlag] : false; try { //更新交易信息 //解析返回结果到类,保存 MI_MedicalInsurancePayRecord medicalInsurancePayRecord = hisDao.Mz_GetPayRecord(3, sTradeNo, 1, 0); if (bFlag) { medicalInsurancePayRecord.state = 1; } else { medicalInsurancePayRecord.state = 4; } hisDao.Mz_SavePayRecord(medicalInsurancePayRecord); resultClass.bSucess = true; } catch (Exception e) { resultClass.bSucess = false; resultClass.sRemarks = "更新交易记录报错:" + e.Message; } return(resultClass); }
public void ArgumentsInput_Argument_NumberOfGroups_IsZero() { InputClass inputClass = new InputClass(); string[] args = { "0", "Students.txt", "Subjects.txt" }; Assert.That(() => inputClass.ArgumentsInput(args), Throws.Exception.TypeOf <DivideByZeroException>().And.Message.EqualTo("No puede haber 0 grupos.")); }
public GraphicsClass() { this.Text = "Step1"; play = new PlayClass(this); input = new InputClass(this, play); drawingFont = new GraphicsFont("Arial", System.Drawing.FontStyle.Bold); }
public void ArgumentsInput_Argument_NumberOfGroups_IsNegative() { InputClass inputClass = new InputClass(); string[] args = { "-5", "Students.txt", "Subjects.txt" }; Assert.That(() => inputClass.ArgumentsInput(args), Throws.Exception); }
/// <summary> /// 挂号退号 /// </summary> /// <param name="visitNO">就诊号</param> /// <param name="budgeid">预算ID</param> /// <param name="invoiceNO">票据号</param> /// <returns></returns> public static bool MiRefundRegister(string visitNO, string budgeid, string invoiceNO) { InputClass input = new InputClass(); Dictionary <InputType, object> dicStr = new Dictionary <InputType, object>(); if (!string.IsNullOrEmpty(visitNO)) { dicStr.Add(InputType.SerialNO, visitNO); } if (!string.IsNullOrEmpty(budgeid)) { dicStr.Add(InputType.RegisterId, budgeid); } if (!string.IsNullOrEmpty(invoiceNO)) { dicStr.Add(InputType.InvoiceNo, invoiceNO); } input.SInput = dicStr; ResultClass resultClass = MIInterFaceFactory.MZ_CancelRegister(input); if (resultClass.bSucess) { MessageBox.Show("医保卡余额" + resultClass.sRemarks); return(true); } else { throw new Exception("异常!" + resultClass.sRemarks); } }
public void OnStickInput(InputClass inputParameters) { leftStickX = inputParameters.leftStickX; leftStickY = inputParameters.leftStickY; }
/// <summary> /// Checks the that authors file does not contain This book title. /// </summary> /// <param name="filePath">The path to the authors file.</param> /// <param name="bookTitle">Title of book to check if contained in authors file all ready..</param> /// <returns></returns> private bool CheckThatAuthorsFileDoesNotContainThisBookTitle(string filePath, string bookTitle) { this._msgBox.NameOfMethod = MethodBase.GetCurrentMethod().Name; var clsInput = new InputClass(); var bookData = clsInput.ReadAllBookTitlesFromAuthorsFile(filePath); if (!bookData.Any()) { return(false); } var titleOp = new TitlesOperationClass(); var titles = titleOp.GetBookTitleFromBookData(bookData); if (!titles.Any()) { return(false); } var valid = new ValidationClass(); // true if book title is all ready contained in authors file else false. return(valid.ValidateAuthorsFileDoesNotContainThisBookTitle(titles, bookTitle)); }
/// <summary> /// 预登记 /// </summary> /// <param name="inputClass"></param> /// <returns></returns> public ResultClass MZ_PreviewRegister(InputClass inputClass) { ResultClass resultClass = new ResultClass(); try { Action <ClientRequestData> requestAction = ((ClientRequestData request) => { request.AddData(inputClass); }); ServiceResponseData retdataMember = InvokeWcfService("MIService.Service", "MIMzController", "MZ_PreviewRegister", requestAction); resultClass.bSucess = retdataMember.GetData <bool>(0); resultClass.sRemarks = retdataMember.GetData <string>(1); if (resultClass.bSucess) { Dictionary <string, string> resultDic = retdataMember.GetData <Dictionary <string, string> >(2); resultClass.oResult = resultDic; } } catch (Exception e) { resultClass.bSucess = false; resultClass.sRemarks = "连接医保后台服务报错:" + e.Message; } return(resultClass); }
public void ArgumentsInput_numberOfGroups_IsNull() { InputClass inputClass = new InputClass(); string[] args = { null, "Students.txt", "Subjects.txt" }; Assert.That(() => inputClass.ArgumentsInput(args), Throws.ArgumentNullException); }
/// <summary> /// 确认取消结算 todo /// </summary> /// <param name="inputClass"></param> /// <returns></returns> public ResultClass MZ_CancelChargeCommit(InputClass inputClass) { ResultClass resultClass = new ResultClass(); try { Action <ClientRequestData> requestAction = ((ClientRequestData request) => { request.AddData(inputClass); }); ServiceResponseData retdataMember = InvokeWcfService("MIService.Service", "MIMzController", "MZ_CancelChargeCommit", requestAction); resultClass.bSucess = retdataMember.GetData <bool>(0); resultClass.sRemarks = retdataMember.GetData <string>(1); if (resultClass.bSucess) { List <DataTable> objects = retdataMember.GetData <List <DataTable> >(2); resultClass.oResult = objects; } } catch (Exception e) { resultClass.bSucess = false; resultClass.sRemarks = e.Message; } return(resultClass); }
public void ArgumentsInput_FileDirectionSubjects_IsNull() { InputClass inputClass = new InputClass(); string[] args = { "5", "Students.txt", null }; Assert.That(() => inputClass.ArgumentsInput(args), Throws.ArgumentNullException); }
private async void ReportButton_Click(object sender, RoutedEventArgs e) { BlakWait.Visibility = Visibility.Visible; inputData = new InputClass(); if (learningFaces.Count < 1 || learningFaces == null) { MessageBox.Show("Error ! No data is loaded"); BlakWait.Visibility = Visibility.Collapsed; return; } if (testingFaces.Count < 1 || testingFaces == null) { MessageBox.Show("Error ! No data is loaded"); BlakWait.Visibility = Visibility.Collapsed; return; } if (inputData.ValidateInput(TBLayers.Text, TBNeuronsInLayer.Text, ActivationFunction, TBIteracje.Text, TBWspUczenia.Text, TBWspBezwladnosci.Text) == false) { BlakWait.Visibility = Visibility.Collapsed; return; } else { await PerformReportDataCreation(); } BlakWait.Visibility = Visibility.Collapsed; }
public void ArgumentsInput_All_AreNull() { InputClass inputClass = new InputClass(); string[] args = { null, null, null }; Assert.That(() => inputClass.ArgumentsInput(args), Throws.ArgumentNullException); }
public GameClass(bool startFullScreen, Size size, bool enableNetwork) { this.startFullscreen = startFullScreen; this.Size = size; this.networkEnabled = enableNetwork; this.Text = "SpaceWar3D-Step11"; statusMessageTimer = Constants.StatusMessageDisplayTime; drawingFont = new GraphicsFont("Verdana", System.Drawing.FontStyle.Regular); input = new InputClass(this); mouseInput = new MouseInput(this); this.MouseMove += new MouseEventHandler(GameClass_MouseMove); this.Cursor = Cursors.NoMove2D; camera = new Camera(); soundHandler = new SoundHandler(this); if (networkEnabled) { peer = new PlayClass(this); if (peer.IsHost) { hullColor = HullColors.Red; } } }
public void MZ_CommitTradeState(string tradeNo, string invoiceNo) { Dictionary <InputType, object> dicStr = new Dictionary <InputType, object>(); dicStr.Add(InputType.TradeNo, tradeNo); InputClass input = new InputClass(); input.SInput = dicStr; ResultClass resultClass = MIInterFaceFactory.MZ_CommitTradeState(input); if (resultClass.bSucess) { if (resultClass.sRemarks.Equals("ok")) { if (MessageBoxShowYesNo("该交易已完成是否打印?") == System.Windows.Forms.DialogResult.Yes) { MZ_RePrintInvoice(tradeNo, invoiceNo); } Mz_UpdateTradeRecord(tradeNo, true); } else //cancel { MessageBoxShowError("个人账户扣减回退成功!,请重新结算!"); Mz_UpdateTradeRecord(tradeNo, false); } } else { MessageBoxShowError("查询出错!:" + resultClass.sRemarks); } }
public override ResultClass MZ_UpdateRegister(InputClass inputClass) { ResultClass resultClass = new ResultClass(); int registerId = inputClass.SInput.ContainsKey(InputType.RegisterId) ? Tools.ToInt32(inputClass.SInput[InputType.RegisterId].ToString(), 0) : 0; string serialNO = inputClass.SInput.ContainsKey(InputType.SerialNO) ? inputClass.SInput[InputType.SerialNO].ToString() : ""; string invoiceNo = inputClass.SInput.ContainsKey(InputType.InvoiceNo) ? inputClass.SInput[InputType.InvoiceNo].ToString() : ""; try { //解析返回结果到类,保存信息 MI_Register register = hisDao.Mz_Getregister(registerId, ""); register.ValidFlag = 1; register.SerialNO = serialNO; ResultClass regResultClass = hisDao.Mz_SaveRegister(register); //更新交易信息 //解析返回结果到类,保存 MI_MedicalInsurancePayRecord medicalInsurancePayRecord = hisDao.Mz_GetPayRecord(1, registerId.ToString(), 1, 1); medicalInsurancePayRecord.FeeNO = invoiceNo; resultClass = hisDao.Mz_SavePayRecord(medicalInsurancePayRecord); if (resultClass.bSucess) { MI_MIPayRecordHead mIPayRecordHead = hisDao.Mz_GetPayRecordHead(medicalInsurancePayRecord.ID); DataTable dtPayrecordDetail = hisDao.Mz_GetPayRecordDetailForPrint(medicalInsurancePayRecord.ID); List <MI_MedicalInsurancePayRecord> result1 = new List <MI_MedicalInsurancePayRecord>(); result1.Add(medicalInsurancePayRecord); DataTable dtPayrecord = ConvertExtend.ToDataTable(result1); List <MI_MIPayRecordHead> result2 = new List <MI_MIPayRecordHead>(); result2.Add(mIPayRecordHead); DataTable dtPayrecordHead = ConvertExtend.ToDataTable(result2); List <DataTable> objects = new List <DataTable>(); objects.Add(dtPayrecord); objects.Add(dtPayrecordHead); objects.Add(dtPayrecordDetail); //返回数据到前台界面,只需金额 resultClass.bSucess = true; resultClass.sRemarks = medicalInsurancePayRecord.TradeNO; resultClass.oResult = objects; } else { resultClass.bSucess = false; resultClass.sRemarks = "更新登记信息失败!"; } } catch (Exception e) { resultClass.bSucess = false; resultClass.sRemarks = "更新中间表数据报错:" + e.Message; } return(resultClass); }
public void Validate_Aadhar_Character_Count() { InputClass inputClass = new InputClass(); string aadharNo = inputClass.InputAadhar(); Assert.IsNotNull(aadharNo); Assert.IsTrue(aadharNo.Length <= 12); }
public void ArgumentsInput_File_Not_Found() { InputClass inputClass = new InputClass(); string[] args = { "5", "Students.txt", "Subjects.txt" }; Assert.That(() => inputClass.ArgumentsInput(args), Throws.Exception.TypeOf <FileNotFoundException>()); }
public GraphicsClass() { this.Text = "Direct3DTest"; audio = new AudioClass(this); play = new PlayClass(this); input = new InputClass(this, audio, play); drawingFont = new GraphicsFont("Arial", System.Drawing.FontStyle.Bold); }
public void OnStickInput(InputClass inputParameters) { leftStickX = inputParameters.leftStickX; leftStickY = inputParameters.leftStickY; sprintHeld = inputParameters.rightTriggerHeld; leftBumper = inputParameters.leftBumperPressed; }
public void OnWallJumping (InputClass inputParameters) { jumpPressed = inputParameters.jumpPressed; jumpHeld = inputParameters.jumpHeld; jumpReleased = inputParameters.jumpReleased; leftStickX = inputParameters.leftStickX; leftStickY = inputParameters.leftStickY; }
public GameClass(bool startFullScreen, Size size, bool enableNetwork) { this.startFullscreen = startFullScreen; this.Size = size; this.networkEnabled = enableNetwork; this.Text = "SpaceWar3D-Step02"; drawingFont = new GraphicsFont( "Verdana", System.Drawing.FontStyle.Regular); input = new InputClass(this, play); if (networkEnabled) { peer = new PlayClass(this); } }
public GameClass(bool startFullScreen, Size size, bool enableNetwork) { this.startFullscreen = startFullScreen; this.Size = size; this.networkEnabled = enableNetwork; this.Text = "SpaceWar3D-Step06"; drawingFont = new GraphicsFont( "Verdana", System.Drawing.FontStyle.Regular); input = new InputClass(this); mouseInput = new MouseInput(this); this.MouseMove +=new MouseEventHandler(GameClass_MouseMove); camera = new Camera(); soundHandler = new SoundHandler(this); if (networkEnabled) { peer = new PlayClass(this); } }
public void BeforeEachTest() { _source = new ClassFiller<InputClass>().Source; }
private void Ignore_the_property_values_that_were_set_ignore(InputClass source) { _destination.DecimalProperty.ShouldNotBeEqualTo(source.DecimalProperty); }
private void MapTo_is_called_with_properties_to_ignore(InputClass source) { _destination = source.MapTo<OutputClass>(p => p.DecimalProperty); _expected = new OutputClass { BooleanProperty = source.BooleanProperty, IntegerProperty = source.IntegerProperty, StringProperty = source.StringProperty, DecimalProperty = 0, DateTimeProperty = source.DateTimeProperty, DateTimeToNullable = source.DateTimeToNullable }; }
private void Map_the_property_values(InputClass source) { var tester = new MappingTester<OutputClass>(); var result = tester.Verify(_destination, _expected); result.IsValid.ShouldBeTrue(); result.ToString().ShouldBeEqualTo(""); }
void Update() { if (freeze) return; leftStickX = player.GetAxis("Move Horizontal"); leftStickY = player.GetAxis("Move Vertical"); jumpPressed = player.GetButtonDown("FireA"); jumpHeld = player.GetButton("FireA"); jumpReleased = player.GetButtonUp("FireA"); //leftBumperPressed = (player.GetButtonUp("DpadUp") && leftBumperPressedEnabled); leftTriggerPressed = player.GetAxis("LeftTrigger") > 0f; if (leftTriggerPressed) { leftTriggerPressed = true; } leftStickX = Mathf.Abs(leftStickX) < deadZone ? 0 : leftStickX; leftStickY = Mathf.Abs(leftStickY) < deadZone ? 0 : leftStickY; rightTriggerHeld = player.GetAxis("RightTrigger"); if (leftTriggerPressed || (Input.GetMouseButtonDown(0) && playerId == 0)) { leftTriggerPressed = true; } InputClass inputClass = new InputClass(rightTriggerHeld, leftBumperPressed, jumpPressed, jumpHeld, jumpReleased, leftStickX, leftStickY); playerMoveController.OnStickInput(inputClass); //playerCamera.OnStickInput(inputClass); playerJump.OnJumping(inputClass); playerRightTriggerAction.OnPressed(rightTriggerHeld); }
private void The_desired_object_is_created(ClassFiller<InputClass> obj) { _source = obj.Source; }
public void BeforeEachTest() { _classFiller = new ClassFiller<InputClass>(); _source = _classFiller.Source; }
public GraphicsClass() { this.Text = "Step01"; input = new InputClass(this); drawingFont = new GraphicsFont( "Arial", System.Drawing.FontStyle.Bold ); }