private DatabaseModule() { try { string storeDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Data"); if (Directory.Exists(storeDir) == false) { Directory.CreateDirectory(storeDir); } string F1 = storeDir; if (Directory.Exists(F1) == false) { Directory.CreateDirectory(F1); } string analogDir = Path.Combine(F1, "Analog"); if (Directory.Exists(analogDir) == false) { Directory.CreateDirectory(analogDir); } string curveDir = Path.Combine(F1, "Curve"); if (Directory.Exists(curveDir) == false) { Directory.CreateDirectory(curveDir); } CurveManager.GetInstance().StoreDir = curveDir; AnalogDataManager.GetInstance().StoreDir = analogDir; } catch (Exception ex) { } }
public HHDeviceProperty Bind(string bindName) { HHDeviceProperty prop = new HHDeviceProperty(); prop.DataSrc = this.DataSrc; prop.DisplayName = this.DisplayName; prop.Name = this.Name; prop.Type = this.Type; prop.GroupIndex = this.GroupIndex; prop.GroupCount = this.GroupCount; if (string.IsNullOrEmpty(bindName) == false) { switch (this.Type) { case "模拟量": prop.Analog = AnalogManager.GetInstance().GetAnalog(this.DataSrc, bindName); if (prop.Analog != null) { prop.IsBind = true; } break; case "曲线": prop.Curves = CurveManager.GetInstance().GetCurves(this.DataSrc, bindName); if (prop.Curves != null) { prop.IsBind = true; } break; } } return(prop); }
public bool Exit() { AnalogDataManager.GetInstance().Stop(); CurveManager.GetInstance().Stop(); return(true); }
public bool Start() { CurveManager.GetInstance().Start(); AnalogDataManager.GetInstance().Start(); return(true); }
private void Awake() { if (CurveManager.instance != null) { Debug.LogError("Multiple instances of CurveManager singleton!"); Destroy(this); return; } CurveManager.instance = this; }
void Awake() { // 將輪胎裡面的 Curve 給進去 curveM = this.GetComponent <CurveManager>(); for (int i = 0; i < wheels.Length; i++) { wheels[i].CurveM = curveM; } Application.targetFrameRate = 30; QualitySettings.vSyncCount = 0; }
void Start() { CurveManager cm = this.GetComponent <CurveManager>(); CarController cc = this.GetComponent <CarController>(); EngineTorque = cm.gear; ForwardMaxSpeed = cc.ForwardMaxSpeed; BackwardMaxSpeed = cc.BackwardMaxSpeed; NitrousUpSpeed = cc.NitrousUpSpeed; SpeedLevel = this.GetComponent <CarController>().SpeedLevel; AccelLevel = this.GetComponent <CarController>().AccelLevel; MaxLevel = this.GetComponent <CarController>().MaxLevel; }
private void yieldTestBtn_Click(object sender, RoutedEventArgs e) { //Excel_irCurveSymbolViewModel test = new Excel_irCurveSymbolViewModel(); //test.Symbol_ = "111000"; //DataBaseConnectManager.DBConnection_ // = DataBaseConnectManager.ConnectionFactory(EnvironmentVariable.MarketDataDBFile_,"RMS"); //test.dataLoad(new DateTime(2014, 10, 24)); CurveManager cm = new CurveManager(); cm.load("111000", ProgramVariable.ReferenceDate_); //QLNet.YieldTermStructure ts = cm.yieldTS(); QLNet.YieldTermStructure ts = cm.yieldTSBuild(); double[] sumY = Enumerable.Repeat <double>(0.0, 100).ToArray <double>(); double[] x = Enumerable.Range(0, 200).Select(i => i / 100.0).ToArray(); double[] y = new double[x.Length]; for (int i = 0; i < x.Length; i++) { y[i] = ts.zeroRate(x[i], QLNet.Compounding.Compounded).value(); } ChartPlotter cp = new ChartPlotter(); var xData = x.AsXDataSource(); var yData = y.AsYDataSource(); CompositeDataSource compositeDataSource = xData.Join(yData); LineGraph lineG = new LineGraph(compositeDataSource); lineG.Description = new PenDescription("합계"); cp.Children.Add(lineG); //this.chartGrid_.Children.Add(cp); Window w = new Window(); w.Content = cp; w.ShowDialog(); }
// The onSceneLoaded function is where you are going to do most of the data pushing from scene to scene. void onSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode) { if (instance == this) { currentSceneName = scene.name; if (scene.name == mainMenuSceneName) { if (playerJoinManager == null) { playerJoinManager = GameObject.FindGameObjectWithTag("player-join-manager").GetComponent <PlayerJoinManager>(); } } else if (scene.name != mainMenuSceneName) // WE ARE ASSUMING ANYTHING THAT ISN'T THE MAIN MENU IS A LEVEL. THIS IS CLEARLY NOT GOING TO BE THE CASE AT ALL TIMES, SO UPDATE THIS AS NEEDED. { if (players == null) { Debug.LogWarning("GameManager did not recieve players from main menu, defaulting to 4 players on, This is correct if starting editor from game scene"); SetUpPlayers(new bool[] { true, true, true, true }, new int[] { 0, 1, 2, 3 }); // Set up players if game is not started in main menu StartCoroutine(UpdateGame()); } } if (countdownText == null) { countdownText = GameObject.FindGameObjectWithTag("countdown"); } if (audioManager == null) { audioManager = Instantiate(audioManagerPrefab).GetComponent <AudioManager>(); audioManager.gameObject.name = "AudioManager"; //I don't like it being named "Clone" DontDestroyOnLoad(audioManager); if (scene.name == mainMenuSceneName) { GameManager.instance.audioManager.Play("Main Menu"); } } if (curveManager == null && scene.name != mainMenuSceneName && scene.name != winnerSceneName) { curveManager = GameObject.FindGameObjectWithTag("ghost-curve").GetComponent <CurveManager>(); //This will be destroyed on load because a different scene might have a different curve manager } } }
public ISyncScenarioItem GetExplosionItem(float duration) { List <ISyncScenarioItem> items = new List <ISyncScenarioItem>(); var moveCurve = CurveManager.GetCurve(curveVisualizer.GetCurveModel(true)); items.Add( new CompositeItem( new MoveByCurveTween(moveCurve, gameObject, duration, EaseType.Linear), circle.GetExplosionItem(0.1f) )); return(new SyncScenario( items, (scenario, interrupted) => { circle.Prepare().Play(); new MoveTween(gameObject, Vector3.zero, TweenSpace.Local).Play(); })); }
private void Start() { // 將輪胎裡面的 Curve 給進去 curveM = this.GetComponent <CurveManager>(); for (int i = 0; i < wheels.Length; i++) { wheels[i].CurveM = curveM; } Application.targetFrameRate = 30; QualitySettings.vSyncCount = 0; // 拿東西 if (centerOfMass != null) { this.GetComponent <Rigidbody>().centerOfMass = centerOfMass.localPosition; } this.GetComponent <Rigidbody>().inertiaTensor *= inertiaFactor; drivetrain = this.GetComponent <Drivetrain>(); // 拿 NN Manager NNManger = this.GetComponent <NeuralNetworkManager>(); }
public void AddCurve(CurveGroup cg) { CurveManager manager = CurveManager.GetInstance(); manager.AddCurve(cg); }
public void Stop() { CurveManager.GetInstance().Stop(); AnalogDataManager.GetInstance().Stop(); }
public List <StationCurve> QueryCurveHistory(int curveType, int index, DateTime time) { return(CurveManager.GetInstance().QueryCurveHistory(curveType, index, time)); }
public List <DateTime> QueryCurveTimeList(int curveType, int index) { return(CurveManager.GetInstance().QueryCurveTimeList(curveType, index)); }
private void button2_Click(object sender, EventArgs e) { CurveManager.GetInstance(); }
public void AddCurve(int type, int index, DateTime time, int sampleRate, float[] data) { CurveGroup grp = new CurveGroup(type, index, time, sampleRate, data); CurveManager.GetInstance().AddCurve(grp); }