// Use this for initialization void Start() { // synthesizer = GameObject.FindObjectOfType<BroadcastSynthesizer> (); synthesizer = GetComponent <BroadcastSynthesizer>(); plotter = GameObject.FindObjectOfType <GraphPlotter> (); showLines = new List <bool> (); if (plotter != null) { plotter.AddList(); plotter.AddList(); plotter.AddList(); plotter.AddList(); plotter.AddList(); plotter.AddList(); plotter.AddList(); showLines.Add(true); showLines.Add(false); showLines.Add(true); showLines.Add(false); showLines.Add(true); showLines.Add(false); showLines.Add(true); } startTime = Time.time; position = new Vector3(0f, 0.54f, 0f); kalman = GameObject.FindObjectsOfType <Kalman> (); // GameObject.FindObjectOfType<TestValve> ().enabled = true; }
private void PlotSignalBTN_Click(object sender, EventArgs e) { if (Data.Signal != null) { GraphPlotter.PlotGraph(Data.Signal); } }
public ShellViewModel(GraphPlotter graphPlotter, Context context, IWindowManager windowManager) { _graphPlotter = graphPlotter; _context = context; _windowManager = windowManager; _context.MicStatusUpdatedEvent += OnMicStatusUpdatedEvent; }
public override void StartJob() { var AlgoInputList = new List <Signal>(); foreach (var inpComponent in InputComponents) { AlgoInputList.Add(ComponentUtility.GetSignalFromComponentAttributes(inpComponent.Data)); } GraphPlotter.PlotGraph(AlgoInputList); }
void loadGraph(int index) { GameObject obj = Data.objects[index]; GraphPlotter gp; Graph graph = obj.GetComponent <Graph>(); MainObject mo = obj.GetComponent <MainObject>(); if (graph.gp != null) { graph.gp.reset(); //tb = rc.tb; } gp = new GraphPlotter(obj); gp.generate(mo.script); graph.gp = gp; }
void compile() { Compiler.setCode(currentCode); Data.output = ""; if (Compiler.compile()) { Debug.Log("compilation succesfull"); GameObject obj = Data.objects[Data.activeObj]; if (obj.tag == "animal") { } else if (obj.tag == "train") { TrackBuilder tb; RollerCoaster rc = obj.GetComponent <RollerCoaster>(); MainObject mo = obj.GetComponent <MainObject>(); if (rc.tb != null) { rc.tb.reset(); //tb = rc.tb; } tb = new TrackBuilder(obj);; tb.setModel(mo.model); tb.setType(0); tb.generate(mo.script); rc.tb = tb; } else if (obj.tag == "wall") { WallBuilder wb; Wall wall = obj.GetComponent <Wall>(); MainObject mo = obj.GetComponent <MainObject>(); if (wall.wb != null) { wall.wb.reset(); //tb = rc.tb; } wb = new WallBuilder(obj); wb.setModel(mo.model); wb.generate(mo.script); wall.wb = wb; } else if (obj.tag == "graph") { GraphPlotter gp; Graph graph = obj.GetComponent <Graph>(); MainObject mo = obj.GetComponent <MainObject>(); if (graph.gp != null) { graph.gp.reset(); //tb = rc.tb; } gp = new GraphPlotter(obj); gp.generate(mo.script); graph.gp = gp; } } else { Debug.Log("compilation error:" + Compiler.getError()); Data.output += Compiler.getError() + "\n"; } }
// Use this for initialization void Start() { // Set Current ID to 0 _iCurID = 0; _fCurrentY = fStartY + (fAddNewHeight/2.0f); // Find tagged objects in scene _gobPlotterObject = GameObject.FindGameObjectWithTag ("PLOTTER"); _gobCanvas = GameObject.FindGameObjectWithTag ("CANVAS"); _gobOrigin = GameObject.FindGameObjectWithTag("ORIGIN"); // Get components attached to objects _pltPlotter = _gobPlotterObject.GetComponent<HUD_LinePlotter> () as HUD_LinePlotter; _pltGraph = _gobOrigin.GetComponent<GraphPlotter>() as GraphPlotter; }
// Use this for initialization void Start() { // Get tagged objects _gobPlotManager = GameObject.FindGameObjectWithTag("ADDER"); _gobOrigin = GameObject.FindGameObjectWithTag("ORIGIN"); // Get GraphPlotter component attached to _pltPlotter _pltPlotter = _gobOrigin.GetComponent<GraphPlotter>() as GraphPlotter; // Get HUD_PlotterManager component attached to _gobPlotManager _mngPlotManager = _gobPlotManager.GetComponent<HUD_PlotterManager>() as HUD_PlotterManager; }
public void AddGraphPlotter(IAnalogyPlotting plotter) => GraphPlotter.Add(plotter);
/// <summary> /// The constructor. /// </summary> /// <param name="plotter">Plotter draws graph.</param> /// <param name="processes">Processes to be shown.</param> public Form1(GraphPlotter plotter, List <Process> processes) { InitializeComponent(); _plotter = plotter; _processes = processes; }
void Init() { SetGraphShapeType(GraphPlotter.GraphShapeType.Grid); m_UpdateSpectrum = false; m_PlayState = RadioManager.SoundPlayState.Stop; m_LerpT = 0f; m_StartTime = Time.realtimeSinceStartup; m_Plotter = new GraphPlotter(); m_Plotter.TextureWidth = m_SpectrumWidth; m_Plotter.TextureHeight = m_SpectrumHeight; m_TopNextCol = m_RandomCols[0]; m_BottomNextCol = m_RandomCols[1]; m_SpectrumTopCol = m_TopNextCol; m_SpectrumBottomCol = m_BottomNextCol; m_PlayingSlider.sliderValue = 0f; m_VolumeSlider.sliderValue = 1f; m_UpdatePlayProgress = true; m_PlayModePL.items.Clear(); m_PlayModeDic = new Dictionary <string, RadioManager.SoundPlayMode>(); m_PlayModeDic[PELocalization.GetString(8000972)] = RadioManager.SoundPlayMode.Single; m_PlayModeDic[PELocalization.GetString(8000973)] = RadioManager.SoundPlayMode.SingleLoop; m_PlayModeDic[PELocalization.GetString(8000974)] = RadioManager.SoundPlayMode.Order; m_PlayModeDic[PELocalization.GetString(8000975)] = RadioManager.SoundPlayMode.ListLoop; m_PlayModeDic[PELocalization.GetString(8000976)] = RadioManager.SoundPlayMode.Random; m_PlayModePL.items.AddRange(m_PlayModeDic.Keys.ToArray()); m_PlayModePL.selection = PELocalization.GetString(8000975); m_PlayModePL.onSelectionChange = (item) => { if (m_PlayModeDic.ContainsKey(item)) { RadioManager.Instance.PlayMode = m_PlayModeDic[item]; } }; string str = PELocalization.GetString(8000970); m_Shape0Lb.text = string.Format("{0} 1", str); m_Shape1Lb.text = string.Format("{0} 2", str); m_Shape2Lb.text = string.Format("{0} 3", str); m_ListItemPools = new Queue <UIListItem>(); m_CurListItems = new List <UIListItem>(); if (null != m_UISpectrumTex) { m_SpectrumTex2d = new Texture2D(m_SpectrumWidth, m_SpectrumHeight, TextureFormat.ARGB32, false); m_UISpectrumTex.transform.localScale = new Vector3(m_SpectrumWidth, m_SpectrumHeight, 1); m_SpectrumTex2d.wrapMode = TextureWrapMode.Clamp; m_SpectrumTex2d.filterMode = FilterMode.Point; m_SpectrumTex2d.anisoLevel = 0; m_UISpectrumTex.mainTexture = m_SpectrumTex2d; m_SpectrumTexClos = m_SpectrumTex2d.GetPixels32(); } UIEventListener.Get(m_StartOrPauseBtn.gameObject).onClick = (go) => { if (null != RadioManager.Instance) { if (m_PlayState == RadioManager.SoundPlayState.Playing) { RadioManager.Instance.PauseCurSound(); } else { RadioManager.Instance.ContinueCurSound(); } } }; UIEventListener.Get(m_NextBtn.gameObject).onClick = (go) => { if (null != RadioManager.Instance) { RadioManager.Instance.PlayNextSound(); } }; UIEventListener.Get(m_PreviousBtn.gameObject).onClick = (go) => { if (null != RadioManager.Instance) { RadioManager.Instance.PlayPreviousSounds(); } }; m_VolumeSlider.onValueChange += (val) => { if (null != RadioManager.Instance) { RadioManager.Instance.SetVolume(m_VolumeSlider.sliderValue); } ; }; UIEventListener.Get(m_PlayingSlider.gameObject).onPress += (go, isPress) => { if (isPress) { m_UpdatePlayProgress = false; } else { RadioManager.Instance.SetTime(Mathf.Clamp01(m_PlayingSlider.sliderValue) * RadioManager.Instance.TotalTime); m_UpdatePlayProgress = true; } }; UIEventListener.Get(m_PlayingSlider.thumb.gameObject).onPress += (go, isPress) => { if (isPress) { m_UpdatePlayProgress = false; } else { RadioManager.Instance.SetTime(Mathf.Clamp01(m_PlayingSlider.sliderValue) * RadioManager.Instance.TotalTime); m_UpdatePlayProgress = true; } }; m_OpenBgMusicCK.startsChecked = true; m_OpenBgMusicCK.onStateChange = (isCheck) => { RadioManager.Instance.SetBgMusicState(isCheck); }; RadioManager.Instance.PlayErrorEvent = null; }