public void updateBar() { DateTime timeBegin = Playback.timeBegin; DateTime timeEnd = Playback.timeEnd; int i = 0; foreach(var text in texts) { string camName = text.Text; bars[i] = new Bars(); bars[i].FileName = camName; if (!text.Text.Equals("")) { bars[i].motions = engine.getMotionOfCamAsPeriod(timeBegin, timeEnd, camName); Dictionary<int, VsMotion> dic = new Dictionary<int, VsMotion>(); foreach (var v in bars[i].motions) { dic.Add((int)v.timeBegin.TimeOfDay.TotalSeconds, v); } data[i] = dic; } bars[i].goodData = true; // bars[i].FileID =camName; bars[i].FilePath = ""; double dd = 184.9920088; bars[i].Duration = dd; bars[i].FileLength = (float)dd; bars[i].FPS = 0; bars[i].startSeconds = 0; bars[i].endSeconds = (float)bars[i].startSeconds + (float)bars[i].FileLength; float duration = (float)bars[i].endSeconds - (float)bars[i].startSeconds; bars[i].startRatio = bars[i].startSeconds / (float)86400.000000; bars[i].endRatio = bars[i].endSeconds / (float)86400.000000; i++; } //{ // string camName = textBox2.Text; // int i = 1; // bars[i] = new Bars(); // bars[i].FileName = camName; // if (!textBox2.Text.Equals("")) // { // bars[i].motions = engine.getMotionOfCamAsPeriod(timeBegin, timeEnd, camName); // Dictionary<int, VsMotion> dic = new Dictionary<int, VsMotion>(); // foreach (var v in bars[i].motions) // { // dic.Add((int)v.timeBegin.TimeOfDay.TotalSeconds, v); // } // data[i] = dic; // } // bars[i].goodData = true; // // bars[i].FileID =camName; // bars[i].FilePath = ""; // double dd = 184.9920088; // bars[i].Duration = dd; // bars[i].FileLength = (float)dd; // bars[i].FPS = 0; // bars[i].startSeconds = 0; // bars[i].endSeconds = (float)bars[i].startSeconds + (float)bars[i].FileLength; // float duration = (float)bars[i].endSeconds - (float)bars[i].startSeconds; // bars[i].startRatio = bars[i].startSeconds / (float)86400.000000; // bars[i].endRatio = bars[i].endSeconds / (float)86400.000000; //} //{ // string camName = textBox3.Text; // int i = 2; // bars[i] = new Bars(); // bars[i].FileName = camName; // if (!textBox3.Text.Equals("")) // { // bars[i].motions = engine.getMotionOfCamAsPeriod(timeBegin, timeEnd, camName); // Dictionary<int, VsMotion> dic = new Dictionary<int, VsMotion>(); // foreach (var v in bars[i].motions) // { // dic.Add((int)v.timeBegin.TimeOfDay.TotalSeconds, v); // } // data[i] = dic; // } // bars[i].goodData = true; // // bars[i].FileID =camName; // bars[i].FilePath = ""; // double dd = 184.9920088; // bars[i].Duration = dd; // bars[i].FileLength = (float)dd; // bars[i].FPS = 0; // bars[i].startSeconds = 0; // bars[i].endSeconds = (float)bars[i].startSeconds + (float)bars[i].FileLength; // float duration = (float)bars[i].endSeconds - (float)bars[i].startSeconds; // bars[i].startRatio = bars[i].startSeconds / (float)86400.000000; // bars[i].endRatio = bars[i].endSeconds / (float)86400.000000; //} //{ // string camName = textBox4.Text; // int i = 3; // bars[i] = new Bars(); // bars[i].FileName = camName; // if (!textBox4.Text.Equals("")) // { // bars[i].motions = engine.getMotionOfCamAsPeriod(timeBegin, timeEnd, camName); // Dictionary<int, VsMotion> dic = new Dictionary<int, VsMotion>(); // foreach (var v in bars[i].motions) // { // dic.Add((int)v.timeBegin.TimeOfDay.TotalSeconds, v); // } // data[i] = dic; // } // bars[i].goodData = true; // // bars[i].FileID =camName; // bars[i].FilePath = ""; // double dd = 184.9920088; // bars[i].Duration = dd; // bars[i].FileLength = (float)dd; // bars[i].FPS = 0; // bars[i].startSeconds = 0; // bars[i].endSeconds = (float)bars[i].startSeconds + (float)bars[i].FileLength; // float duration = (float)bars[i].endSeconds - (float)bars[i].startSeconds; // bars[i].startRatio = bars[i].startSeconds / (float)86400.000000; // bars[i].endRatio = bars[i].endSeconds / (float)86400.000000; //} }
public void LoadBarsFromDataSet(Bars[] b) { _barCount = b.Length; // bars = new Bars[_barCount]; bars = b; Invalidate(); m_default_rect = m_data_rect; CalcMinMax(); }
public void LoadBarsFromDataSet() { int i = -1; _barCount = 4; bars = new Bars[_barCount]; try { { i++; bars[i] = new Bars(); bars[i].goodData = true; //bars[i].FileID = Convert.ToInt32(row["FileID"].ToString()); bars[i].FileName = "[Tama-sub]Katanagatari Promo.avi"; bars[i].FilePath = ""; double dd = 184.9920088; bars[i].Duration = dd; bars[i].FileLength = (float)dd; bars[i].FPS = 0; bars[i].startSeconds = 0; bars[i].endSeconds = (float)bars[i].startSeconds + (float)bars[i].FileLength; float duration = (float)bars[i].endSeconds - (float)bars[i].startSeconds; bars[i].startRatio = bars[i].startSeconds / (float)86400.000000; bars[i].endRatio = bars[i].endSeconds / (float)86400.000000; } { i++; bars[i] = new Bars(); bars[i].goodData = true; //bars[i].FileID = Convert.ToInt32(row["FileID"].ToString()); bars[i].FileName = "[Tama-sub]Katanagatari Promo.avi"; bars[i].FilePath = ""; double dd = 184.9920088; bars[i].Duration = dd; bars[i].FileLength = (float)dd; bars[i].FPS = 12; bars[i].startSeconds = 100; bars[i].endSeconds = (float)bars[i].startSeconds + (float)bars[i].FileLength; float duration = (float)bars[i].endSeconds - (float)bars[i].startSeconds; bars[i].startRatio = bars[i].startSeconds / (float)86400.000000; bars[i].endRatio = bars[i].endSeconds / (float)86400.000000; } { i++; bars[i] = new Bars(); bars[i].goodData = true; //bars[i].FileID = Convert.ToInt32(row["FileID"].ToString()); bars[i].FileName = "[Tama-sub]Katanagatari Promo.avi"; bars[i].FilePath = ""; double dd = 184.9920088; bars[i].Duration = dd; bars[i].FileLength = (float)dd; bars[i].FPS = 12; bars[i].startSeconds = 100; bars[i].endSeconds = (float)bars[i].startSeconds + (float)bars[i].FileLength; float duration = (float)bars[i].endSeconds - (float)bars[i].startSeconds; bars[i].startRatio = bars[i].startSeconds / (float)86400.000000; bars[i].endRatio = bars[i].endSeconds / (float)86400.000000; } { i++; bars[i] = new Bars(); bars[i].goodData = true; //bars[i].FileID = Convert.ToInt32(row["FileID"].ToString()); bars[i].FileName = "[Tama-sub]Katanagatari Promo.avi"; bars[i].FilePath = ""; double dd = 184.9920088; bars[i].Duration = dd; bars[i].FileLength = (float)dd; bars[i].FPS = 12; bars[i].startSeconds = 100; bars[i].endSeconds = (float)bars[i].startSeconds + (float)bars[i].FileLength; float duration = (float)bars[i].endSeconds - (float)bars[i].startSeconds; bars[i].startRatio = bars[i].startSeconds / (float)86400.000000; bars[i].endRatio = bars[i].endSeconds / (float)86400.000000; } } catch (Exception e2) { //bars[i].goodData = false; } Invalidate(); m_default_rect = m_data_rect; CalcMinMax(); }
public void LoadBarsFromDataSet(object[] data) { if (data == null) { bars = new Bars[] { }; return; } bars = new Bars[] { }; DateTime now = DateTime.Now; DataSet ds = new DataSet(); object[] state = (object[])data; ds = (DataSet)state[0]; _barCount = ds.Tables[0].Rows.Count; bars = new Bars[_barCount]; int i = -1; foreach (DataRow row in ds.Tables[0].Rows) { i++; try { bars[i] = new Bars(); bars[i].goodData = true; //bars[i].FileID = Convert.ToInt32(row["FileID"].ToString()); bars[i].FileName = row["FileName"].ToString(); bars[i].FilePath = row["FilePath"].ToString(); double dd = (double)Convert.ToDouble(row["Duration"].ToString()); bars[i].Duration = dd; bars[i].FileLength = (float)dd; bars[i].FPS = (double)Convert.ToDouble(row["FPS"].ToString()); bars[i].startSeconds = (float)0.00f; bars[i].endSeconds = (float)bars[i].startSeconds + (float)bars[i].FileLength; float duration = (float)bars[i].endSeconds - (float)bars[i].startSeconds; bars[i].startRatio = bars[i].startSeconds / (float)86400.000000; bars[i].endRatio = bars[i].endSeconds / (float)86400.000000; } catch (Exception e2) { //bars[i].goodData = false; } } // Bill SerGio: Dispose of DataSet ds.Dispose(); Invalidate(); m_default_rect = m_data_rect; CalcMinMax(); // Don't allow user to scroll beyond display bounds //BTN_MoveLeft.Enabled = !this.AtMinX(); //BTN_MoveRight.Enabled = !this.AtMaxX(); //BTN_MoveUp.Enabled = !this.AtMinY(); //BTN_MoveDown.Enabled = !this.AtMaxY(); }