private void testForm_Load(object sender, EventArgs e) { bool ret = m_motion.IsInit; if (!ret) { MessageBox.Show("运动模块初始化失败,请关闭软件!"); this.Close(); } else { statusLabel.Text = "运动模块初始化成功!"; } m_timer = new System.Windows.Forms.Timer(); m_timer.Tick += timer_tick; m_timer.Interval = 100; m_timer.Start(); fs = new FileStream("log.txt", FileMode.Create); sw = new StreamWriter(fs); sw.WriteLine("Go"); BtnSetSpeed((int)velType.lowVel); m_moveType = mType.JOG; //disable_moveBtn(); button_Home.Enabled = true; }
public string GetClassStr(string fileName, mType mtype) { object[] results = this.Invoke("GetClassStr", new object[] { fileName, mtype }); return((string)(results[0])); }
public bool Delete(string classMemberObj, string fileName, mType mtype) { object[] results = this.Invoke("Delete", new object[] { classMemberObj, fileName, mtype }); return((bool)(results[0])); }
public bool UploadClassStr(string fileName, string fileClassStr, mType mtype) { object[] results = this.Invoke("UploadClassStr", new object[] { fileName, fileClassStr, mtype }); return((bool)(results[0])); }
/// <remarks/> public void GetClassStrAsync(string fileName, mType mtype, object userState) { if ((this.GetClassStrOperationCompleted == null)) { this.GetClassStrOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetClassStrOperationCompleted); } this.InvokeAsync("GetClassStr", new object[] { fileName, mtype }, this.GetClassStrOperationCompleted, userState); }
/// <remarks/> public void DeleteAsync(string classMemberObj, string fileName, mType mtype, object userState) { if ((this.DeleteOperationCompleted == null)) { this.DeleteOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOperationCompleted); } this.InvokeAsync("Delete", new object[] { classMemberObj, fileName, mtype }, this.DeleteOperationCompleted, userState); }
public bool Delete(string classMemberObj, string fileName, mType mtype) { bool bl = false; try { bl = serv.Delete(classMemberObj, fileName, mtype); } catch (Exception ex) { ++retry; if (retry < 3) { this.Delete(classMemberObj, fileName, mtype); } EchoHelper.EchoException(ex); } return(bl); }
public bool UploadClassStr(string fileName, string fileClassStr, mType mtype) { bool bl = false; try { bl = serv.UploadClassStr(fileName, fileClassStr, mtype); } catch (Exception ex) { ++retry; if (retry < 3) { this.UploadClassStr(fileName, fileClassStr, mtype); } EchoHelper.EchoException(ex); } return(bl); }
public string GetClassStr(string filename, mType ty) { string str = ""; try { str = serv.GetClassStr(filename, ty); } catch (Exception ex) { ++retry; if (retry < 3) { this.GetClassStr(filename, ty); } EchoHelper.EchoException(ex); } return(str); }
public void loadMovieID(string Name) { string URL = "http://api.themoviedb.org/3/search/movie?api_key=" + movieDbApiKey + "&query=" + Name; string Response = HTTP.DoGET(URL); JObject videoObject = JObject.Parse(Response); JToken totalResults = videoObject.SelectToken("total_results"); string total_results = totalResults.ToString(); if (total_results != "0") { JToken movieToken = videoObject.SelectToken("results").First; //tv show not found found // isMovie = true; // themoviedb = true; imdb_number = movieToken.SelectToken("id").ToString(); Image = base_url + "w780" + movieToken.SelectToken("poster_path").ToString(); movieType = mType.themoviedbMovie; IncrementNumber(); } }
private void rBtn_pos_CheckedChanged(object sender, EventArgs e) { m_moveType = mType.POS; }
/// <remarks/> public void DeleteAsync(string classMemberObj, string fileName, mType mtype) { this.DeleteAsync(classMemberObj, fileName, mtype, null); }
private void rBtn_step_CheckedChanged(object sender, EventArgs e) { m_moveType = mType.STEP; }
/// <remarks/> public void GetClassStrAsync(string fileName, mType mtype) { this.GetClassStrAsync(fileName, mtype, null); }
private void rBtn_jog_CheckedChanged(object sender, EventArgs e) { m_moveType = mType.JOG; }
/// <remarks/> public void UploadClassStrAsync(string fileName, string fileClassStr, mType mtype) { this.UploadClassStrAsync(fileName, fileClassStr, mtype, null); }
public bool loadTvShowID(string Name) { /* string URL = "http://api.themoviedb.org/3/search/movie?api_key=" + movieDbApiKey + "&query=" + Name; string Response = HTTP.DoGET(URL); videoObject = JObject.Parse(Response); JToken totalResults = videoObject.SelectToken("total_results"); string total_results = totalResults.ToString(); if (total_results == "0") { */ //Might be a TV show series string URL = "http://api.themoviedb.org/3/search/tv?api_key=" + movieDbApiKey + "&query=" + Name; string Response = HTTP.DoGET(URL); JObject tvObject = JObject.Parse(Response); string total_results = tvObject.SelectToken("total_results").ToString(); if (total_results != "0") { JToken tvToken = tvObject.SelectToken("results").First; Image = base_url + "w780" + tvToken.SelectToken("poster_path").ToString(); movieType = mType.themoviedbTV; // isMovie = false; if (tvToken != null) { imdb_number = tvToken.SelectToken("id").ToString(); IncrementNumber(); /* //search again using ID URL = "http://api.themoviedb.org/3/tv/" + ID + "/season/" + Season + "/episode/" + Episode + "?api_key=" + movieDbApiKey; Response = http.DoGET(URL); JToken finalObject = JToken.Parse(Response); Description = finalObject.SelectToken("overview").ToString(); TheEpisodeTitle = finalObject.SelectToken("name").ToString(); TheAirDate = finalObject.SelectToken("air_date").ToString(); Season = finalObject.SelectToken("episode_number").ToString(); theYear = Convert.ToInt16(TheAirDate.Substring(0, 4)); number = finalObject.SelectToken("id").ToString(); string ybrResponse = YouTube.SearchYouTube(Name + " trailer"); if (ybrResponse.Length <= 30) Trailers = ybrResponse; */ return true; } }//end of second total results return false; }
/// <remarks/> public void ReNameAsync(string classMemberObj, string fileName, string fileNewName, mType mtype) { this.ReNameAsync(classMemberObj, fileName, fileNewName, mtype, null); }
//function: //generate a monster from the ent private void gene_A_Monster(int ent, mType type) { // ent = 5; Vector3 positon = new Vector3(-7.5f, -5, 0); Vector3 Scale; float tmpX, tmpY; if (type == mType.mNorm) { tmpMonster = Instantiate(monsterN, positon, Quaternion.identity); } else if (type == mType.mPlus) { tmpMonster = Instantiate(monsterP, positon, Quaternion.identity); } else if (type == mType.mFat) { tmpMonster = Instantiate(monsterF, positon, Quaternion.identity); } Scale = tmpMonster.transform.localScale; //the original monster is face left //0-Left+Up clockwise switch (ent) { case 0: //Mirror! No rotation 左上 positon.x = Random.Range(-6.5f, -7f); positon.y = Random.Range(0f, 5.2f); Scale.x = -Scale.x; tmpMonster.transform.position = positon; tmpMonster.transform.localScale = Scale; break; case 1: //Mirror! Z rotate: mNorm -30˚ mPlus -15˚上左 positon.x = Random.Range(-8f, 0f); positon.y = Random.Range(8f, 10f); Scale.x = -Scale.x; tmpMonster.transform.position = positon; tmpMonster.transform.localScale = Scale; if (type == mType.mNorm) { tmpMonster.transform.Rotate(0, 0, -30); } else if (type == mType.mPlus) { tmpMonster.transform.Rotate(0, 0, -15); } break; case 2: //Not Mirror! Z rotate: mNorm 30˚ mPlus 15˚ 上右 positon.x = Random.Range(0f, 8f); positon.y = Random.Range(5.3f, 6f); tmpMonster.transform.position = positon; if (type == mType.mNorm) { tmpMonster.transform.Rotate(0, 0, 30); } else if (type == mType.mPlus) { tmpMonster.transform.Rotate(0, 0, 15); } break; case 3: //Not Mirror! No rotation 右上 positon.x = Random.Range(6.5f, 7f); positon.y = Random.Range(0f, 5.2f); tmpMonster.transform.position = positon; break; case 4: //Not Mirror! No rotation 右下 positon.x = Random.Range(8f, 10f); positon.y = Random.Range(-5.2f, 0); tmpMonster.transform.position = positon; break; case 5: //Not Mirror! Z rotate: mNorm -30˚ mPlus -15˚下右 positon.x = Random.Range(0f, 8f); positon.y = Random.Range(-5f, -4f); tmpMonster.transform.position = positon; if (type == mType.mNorm) { tmpMonster.transform.Rotate(0, 0, -30); } else if (type == mType.mPlus) { tmpMonster.transform.Rotate(0, 0, -15); } break; case 6: //Mirror! Z rotate: mNorm 30˚ mPlus 15˚ positon.x = Random.Range(-8f, 0f); positon.y = Random.Range(-5f, -4f); Scale.x = -Scale.x; tmpMonster.transform.position = positon; tmpMonster.transform.localScale = Scale; if (type == mType.mNorm) { tmpMonster.transform.Rotate(0, 0, 30); } else if (type == mType.mPlus) { tmpMonster.transform.Rotate(0, 0, 15); } break; case 7: //Mirror! No rotation positon.x = Random.Range(-6.5f, -7f); positon.y = Random.Range(-5.2f, 0); Scale.x = -Scale.x; tmpMonster.transform.position = positon; tmpMonster.transform.localScale = Scale; break; default: break; } }