public TimeStampDataEntity(PlotManager plotManager, DataEntityInfo dataInfo, int sampleCount) : base(plotManager, dataInfo) { _samplesInChart = 0; _singleSamplePlotMode = (sampleCount == 1); if (_singleSamplePlotMode) { _timeStamps = new List <DateTime>(dataInfo.Capacity); _blockCounts = null; _isEven = true; } else { _timeStamps = new List <DateTime>(dataInfo.Capacity / sampleCount); _blockCounts = new List <int>(dataInfo.Capacity / sampleCount); _isEven = true; } _yBuffers = new List <OverLapWrapBuffer <TDataType> >(DataInfo.LineCount); for (int i = 0; i < DataInfo.LineCount; i++) { _yBuffers.Add(new OverLapWrapBuffer <TDataType>(DataInfo.Capacity)); } _plotBuffer = new PlotBuffer <TDataType>(DataInfo.LineCount, DataInfo.Capacity); }
private async void OnEnable() { _colliders = GetComponentsInChildren <Collider>(); _link = GetComponentInParent <Link>(); _plots = PlotManager.Instance as PlotManager; await _plots.Initialized; // check if object was destroyed if (!gameObject) { return; } Observable.Merge(_link.UpstreamRx, _link.DownstreamRx) .TakeUntilDisable(this) .SampleFrame(1) .Subscribe(_ => RefreshAnchors()); RefreshAnchors(); // disable hitboxes during creation _link.CreatedByRx .TakeUntilDisable(this) .Subscribe(val => { foreach (var collider in _colliders) { collider.enabled = val < 0; } }); }
public void PlotCoordinatesTest() { Assert.AreEqual(new PlotCoordinates(1, 1), (PlotCoordinates) new BlockCoordinates(PlotWorldGenerator.RoadWidth, 0, PlotWorldGenerator.RoadWidth)); Assert.AreEqual(new PlotCoordinates(-1, -1), (PlotCoordinates) new BlockCoordinates(-1, 0, -1)); Assert.AreEqual( new BlockCoordinates(PlotWorldGenerator.RoadWidth, PlotWorldGenerator.PlotHeight, PlotWorldGenerator.RoadWidth), PlotManager.ConvertToBlockCoordinates(new PlotCoordinates(1, 1))); Assert.AreEqual( new BlockCoordinates(-PlotWorldGenerator.PlotWidth, PlotWorldGenerator.PlotHeight, -PlotWorldGenerator.PlotWidth), PlotManager.ConvertToBlockCoordinates(new PlotCoordinates(-1, -1))); //BoundingBox bbox = BoundingBox.CreateFromPoints(new[] {new Vector3(1f, 1f, 1f), new Vector3(-1f, -1f, -1f)}); //Assert.AreEqual(-1, bbox.Min.X); Vector3 offset = new BlockCoordinates(-1, 0, -1); Vector3 to = offset + (Vector3) new BlockCoordinates(PlotWorldGenerator.PlotWidth * Math.Sign(offset.X), 0, PlotWorldGenerator.PlotDepth * Math.Sign(offset.Z)); BoundingBox bbox = BoundingBox.CreateFromPoints(new[] { offset, to }); Assert.AreEqual(-PlotWorldGenerator.PlotWidth - 1, bbox.Min.X); Assert.AreEqual(-1, bbox.Max.X); }
private async void OnEnable() { _cam = Camera.main.transform; _lines = GetComponent <BezierLineRenderer>(); _lineRenderer = GetComponent <LineRenderer>(); _plots = PlotManager.Instance as PlotManager; _links = LinkManager.Instance as LinkManager; await _plots.Initialized; await _links.Initialized; _client = StreamClient.Instance; Observable.Merge( _client.SelectedTypeRx, _client.SelectedIdRx.Select(_ => "")) .BatchFrame() .TakeUntilDisable(this) .Subscribe(_ => UpdateSelection()); var cursor = FindObjectOfType <AnimatedCursor>(); if (cursor) { transform.SetParent(cursor.transform, false); } }
/// <summary> /// Update is called every frame, if the MonoBehaviour is enabled. /// </summary> void Update() { bool actOneDone = PlotManager.actIsDone(actOnePlots); bool actTwoDone = PlotManager.actIsDone(actTwoPlots); bool actThreeDone = PlotManager.actIsDone(actThreePlots); if (actOneDone) { if (actTwoDone) { if (actThreeDone) { // TODO: Roll credits } else { currentAct.setPlotValue("3"); } } else { currentAct.setPlotValue("2"); } } else { currentAct.setPlotValue("1"); } SpawnManager.UpdateNpcs(); }
protected override async void OnEnable() { _plots = PlotManager.Instance as PlotManager; await _plots.Initialized; Filter.AllRemoteChanges() .TakeUntilDisable(this) .Where(ev => ev.ChangedProperties.Contains("Origin")) .Subscribe(async ev => { await _plots.Initialized; var plot = _plots.Get(ev.Model.Origin); if (plot) { ev.Model.transform.SetParent(plot.Visualization, false); // scatter plot's position is in the middle, set position to 'origin' of scatter plot ev.Model.transform.localPosition = new Vector3(-0.5f, -0.5f, 0); } else { Debug.LogError($"Unable to find plot {ev.Model.Origin} for filter {ev.Model.Id}"); } }); base.OnEnable(); }
private void OnEnable() { _link = GetComponentInParent <Link>(); _client = StreamClient.Instance; _cam = Camera.main.transform; _plots = PlotManager.Instance as PlotManager; }
public IList <SoilDataResponse> GetSoilDetails() { IList <SoilDataResponse> dataresponse = new List <SoilDataResponse>(); try { if (HttpContext.Current.Session[ApplicationConstant.UserSession] != null) { SessionData sessionObject = (SessionData)HttpContext.Current.Session[ApplicationConstant.UserSession]; AggieGlobalLogManager.Info("PlotController :: GetSoilDetails started "); var connectionString = "AggieGlobal"; var repo = new PlotManager(connectionString); dataresponse = repo.GetSoilDetails(); repo.Dispose(); } } catch (Exception e) { SoilDataResponse det = new SoilDataResponse(); det.Status = ResponseStatus.Failed; det.Error = "Failed to retreive data"; dataresponse.Add(det); AggieGlobalLogManager.Fatal("AccountRepository :: LoginCheck failed :: " + e.Message); } return(dataresponse); }
private void OnEnable() { _cam = Camera.main.transform; _user = StreamClient.Instance; _links = LinkManager.Instance as LinkManager; _plots = PlotManager.Instance as PlotManager; _webclients = WebClientManager.Instance as WebClientManager; // use timeout when creating links Link.AllModelChange() .Where(ev => ev.Model.CreatedBy == _user.Id && ev.ChangedProperties.Contains("CreatedBy")) .Subscribe(ev => { _isCreatingLink = true; ResetProgress(); ev.Model.CreatedByRx .Where(v => v < 0) .Take(1) .Delay(TimeSpan.FromSeconds(1)) .Subscribe(v => _isCreatingLink = false, () => _isCreatingLink = false); }); _user.LookingAtIdRx .TakeUntilDisable(this) .ObserveOnMainThread() .Subscribe(_ => ResetProgress()); _user.LookingAtTypeRx .TakeUntilDisable(this) .ObserveOnMainThread() .Subscribe(_ => ResetProgress()); Link.AllModelChange() .TakeUntilDisable(this) .Where(ev => ev.Model.CreatedBy == _user.Id) .Subscribe(_ => ResetProgress()); // disable & reset progress during zen mode _user.ZenModeRx .TakeUntilDisable(this) .Where(v => v && !(_tablet && _tablet.IsVoiceActive)) .ObserveOnMainThread() .Subscribe(_ => ResetProgress()); Plot.AllModelChange() .TakeUntilDisable(this) .Where(ev => ev.ChangedProperties.Contains("BoundTo") && _tablet != null && ev.Model.BoundTo == _tablet.Id) .Subscribe(_ => ResetProgress()); WebClient.AllModelChange() .TakeUntilDisable(this) .Where(ev => ev.ChangedProperties.Contains("Owner")) .Subscribe(ev => SearchCurrentTablet()); Observable.Merge(WebClient.ModelCreated(), WebClient.ModelDestroyed()) .TakeUntilDisable(this) .Subscribe(m => SearchCurrentTablet()); }
static void Main(string[] args) { PlotManager manager = new PlotManager(); manager.LoadDb(@"URI=file:D:\compact.db"); //manager.LoadDb(@"URI=file:D:\archeagev5.db"); manager.AnalyzePlot(2169); }
public static PlotManager GetInstance() { if (instance == null) { instance = new PlotManager(); } return(instance); }
void Awake() { if (instance != null) { Debug.LogWarning("More than one of instance of PlotManager found!"); return; } instance = this; }
// Use this for initialization void Start() { Instance = this; allChildRenderers = this.GetComponentsInChildren <Renderer>(); foreach (Renderer R in allChildRenderers) { R.enabled = false; } }
public IEnumerable <PlotDetailResponse> GetPlotDetailsById(string plotid) { plotid = plotid.Replace("+", "%20"); plotid = System.Net.WebUtility.UrlDecode(plotid); plotid = plotid.Replace(" ", "+"); bool res = default(bool); IList <PlotDetailResponse> responsedata = new List <PlotDetailResponse>(); IEnumerable <PlotDetail> internalPlots = null; try { if (HttpContext.Current.Session[ApplicationConstant.UserSession] != null) { SessionData sessionObject = (SessionData)HttpContext.Current.Session[ApplicationConstant.UserSession]; AggieGlobalLogManager.Info("PlotController :: CreateUpdatePlot started "); var connectionString = "AggieGlobal"; var repo = new PlotManager(connectionString); internalPlots = repo.GetPlotDetailsById(plotid); if (internalPlots != null && internalPlots.Count() > default(int)) { foreach (PlotDetail det in internalPlots) { PlotDetailResponse resdata = new PlotDetailResponse(); resdata.PlotId = EncryptionHelper.AesEncryption(Convert.ToString(det.PlotId), EncryptionKey.LOG); resdata.FarmId = EncryptionHelper.AesEncryption(Convert.ToString(det.FarmId), EncryptionKey.LOG); resdata.PlotName = det.PlotName; resdata.PlotSize = det.PlotSize; resdata.Organic = det.Organic; resdata.SoilId = Convert.ToString(EncryptionHelper.AesEncryption(det.SoilId.ToString(), EncryptionKey.LOG)); resdata.SoilPhId = Convert.ToString(EncryptionHelper.AesEncryption(det.SoilPhId.ToString(), EncryptionKey.LOG)); resdata.Notes = det.Notes; resdata.Status = ResponseStatus.Successful; responsedata.Add(resdata); } } else { PlotDetailResponse resdata = new PlotDetailResponse(); resdata.Status = ResponseStatus.Failed; resdata.Error = "Unable to retireve plot detail"; responsedata.Add(resdata); } repo.Dispose(); } } catch (Exception ex) { PlotDetailResponse resdata = new PlotDetailResponse(); resdata.Status = ResponseStatus.Failed; resdata.Error = "Unable to retireve plot details"; responsedata.Add(resdata); AggieGlobalLogManager.Fatal("PlotController :: CreateUpdatePlot failed :: " + ex.Message); } return(responsedata); }
public StringDataEntity(PlotManager plotManager, DataEntityInfo dataInfo) : base(plotManager, dataInfo) { _xBuffer = new OverLapStrBuffer(DataInfo.Capacity); _yBuffers = new List <OverLapWrapBuffer <TDataType> >(DataInfo.LineCount); for (int i = 0; i < DataInfo.LineCount; i++) { _yBuffers.Add(new OverLapWrapBuffer <TDataType>(DataInfo.Capacity)); } _plotBuffer = new PlotBuffer <TDataType>(DataInfo.LineCount, DataInfo.Capacity); }
private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(this); } EventCenter.AddListener(EventType.NextRound, UpdateVariable); }
public void PlotManager_AddLineSeriesV2_AddsCorrectLineSeries() { PlotManager manager = new PlotManager(); List <float> TestList = new List <float>(); TestList.Add(1); TestList.Add(2); manager.AddLineSeries(TestList, "Test", 2); Assert.AreEqual("Test", manager.Series.ElementAt(0).Title); Assert.AreEqual(new DataPoint(0, 1), manager.Series.ElementAt(0).Points.ElementAt(0)); Assert.AreEqual(new DataPoint(2, 2), manager.Series.ElementAt(0).Points.ElementAt(1)); }
public void PlotManager_GetPlotModel_CreatesPlotModel() { PlotManager manager = new PlotManager(); List <float> TestList = new List <float>(); TestList.Add(1); TestList.Add(2); manager.AddLineSeries(TestList, "Test", OxyColors.Aqua, 2); PlotModel model = manager.GetPlotModel("Model").Result; Assert.AreEqual("Model", model.Title); Assert.AreEqual("Test", model.Series.ElementAt(0).Title); }
public IndexDataEntity(PlotManager plotManager, DataEntityInfo dataInfo) : base(plotManager, dataInfo) { _plotManager = plotManager; this._startIndex = _plotManager.StartIndex; this._nextIndex = _plotManager.StartIndex; this._plotBuffer = new PlotBuffer <TDataType>(DataInfo.LineCount, DataInfo.Capacity); _yBuffers = new List <OverLapWrapBuffer <TDataType> >(DataInfo.LineCount); for (int i = 0; i < DataInfo.LineCount; i++) { _yBuffers.Add(new OverLapWrapBuffer <TDataType>(DataInfo.Capacity)); } }
public void PlotCoordinatesTest() { var plotManager = new PlotManager(); Assert.AreEqual(new PlotCoordinates(1, 1), plotManager.ConvertToPlotCoordinates(new BlockCoordinates(PlotWorldGenerator.RoadWidth, 0, PlotWorldGenerator.RoadWidth))); Assert.AreEqual(new PlotCoordinates(-1, -1), plotManager.ConvertToPlotCoordinates(new BlockCoordinates(-1, 0, -1))); Assert.AreEqual( new BlockCoordinates(PlotWorldGenerator.RoadWidth, PlotWorldGenerator.PlotHeight, PlotWorldGenerator.RoadWidth), plotManager.ConvertToBlockCoordinates(new PlotCoordinates(1, 1))); Assert.AreEqual( new BlockCoordinates(-PlotWorldGenerator.PlotAreaWidth, PlotWorldGenerator.PlotHeight, -PlotWorldGenerator.PlotAreaWidth), plotManager.ConvertToBlockCoordinates(new PlotCoordinates(-1, -1))); }
public override void generate(World world, int depth) { PlotManager pm = world.plotManager; int structureX = Random.Range( 5, pm.plotDiameter - 5) + ((pm.plotCount / 2) * pm.plotDiameter); foreach (Prebuilt p in this._areas) { Random.InitState(world.seed); Position pos = new Position(structureX + p.position.x, p.position.y, depth); p.area.placeIntoWorld(world, pos); } }
// Update is called once per frame void Update() { if (playerMoved.valueIsNotZero()) { fadeIn(actOne); } if (PlotManager.actIsComplete(1)) { fadeIn(actTwo); } if (PlotManager.actIsComplete(2)) { fadeIn(actThree); } }
public PlotDetailResponse CreateUpdatePlot([FromBody] PlotDetailResponse det) { string str = Newtonsoft.Json.JsonConvert.SerializeObject(det); bool res = default(bool); if (det.PlotName == string.Empty && det.PlotSize <= default(int) && det.FarmId == string.Empty) { det.Error = "Failed to create or update farm request structure invalid"; det.Status = ResponseStatus.Failed; return(det); } try { if (HttpContext.Current.Session[ApplicationConstant.UserSession] != null) { SessionData sessionObject = (SessionData)HttpContext.Current.Session[ApplicationConstant.UserSession]; PlotDetail resdata = new PlotDetail(); resdata.PlotName = det.PlotName; resdata.PlotSize = det.PlotSize; resdata.Organic = det.Organic; resdata.SoilId = string.IsNullOrEmpty(det.SoilId) == true?default(int):Convert.ToInt32(EncryptionHelper.AesDecryption(det.SoilId, EncryptionKey.LOG)); resdata.SoilPhId = string.IsNullOrEmpty(det.SoilPhId) == true ? default(int) : Convert.ToInt32(EncryptionHelper.AesDecryption(det.SoilPhId, EncryptionKey.LOG)); resdata.Notes = det.Notes; resdata.FarmId = Convert.ToInt32(EncryptionHelper.AesDecryption(det.FarmId, EncryptionKey.LOG)); resdata.PlotId = !string.IsNullOrEmpty(det.PlotId) ? Convert.ToInt32(EncryptionHelper.AesDecryption(det.PlotId, EncryptionKey.LOG)) : 0; resdata.UserID = sessionObject._userId; AggieGlobalLogManager.Info("PlotController :: CreateUpdatePlot started "); var connectionString = "AggieGlobal"; var repo = new PlotManager(connectionString); res = repo.CreateUpdatePlot(resdata); det.Status = ResponseStatus.Successful; det.PlotId = EncryptionHelper.AesEncryption(resdata.PlotId.ToString(), EncryptionKey.LOG); repo.Dispose(); } } catch (Exception ex) { det.Error = "Failed to create or update farm"; det.Status = ResponseStatus.Failed; AggieGlobalLogManager.Fatal("PlotController :: CreateUpdatePlot failed :: " + ex.Message); } return(det); }
public String ExportAllPlots() { String output = ""; using (PlotManager pManager = new PlotManager()) { List <Plot> plotList = new List <Plot>(); plotList = pManager.Repo.Get().ToList(); foreach (var plot in plotList) { String Line = plot.Id + ";" + plot.PlotId + ";" + plot.GeometryType + ";" + plot.Coordinate + ";" + plot.CoordinateType + ";" + plot.Latitude + ";" + plot.Longitude + ";" + plot.Status + "\n"; output += Line; } return(output); } }
public static bool actIsComplete(int act) { if (act == 1) { return(PlotManager.actIsDone(instance.actOnePlots)); } else if (act == 2) { return(PlotManager.actIsDone(instance.actTwoPlots)); } else if (act == 3) { return(PlotManager.actIsDone(instance.actThreePlots)); } return(false); }
/// <summary> /// This is the constructor of the VelocityGraphViewModel /// </summary> /// <param name="dataProvider">A DataProvider object to read the data from</param> public VelocityGraphViewModel(DataProvider dataProvider) { _data = dataProvider; PlotManager manager = new PlotManager(); manager.AddLineSeries(_data.Velocity, "Vel [kt]", OxyColors.IndianRed); data = manager.GetPlotModel("Velocity").Result; blank = new PlotModel(); blank.Title = "Velocity"; Plot = data; MainWindow.OnResizeStartEvent += MainWindow_OnResizeStartEvent; MainWindow.OnResizeEndEvent += MainWindow_OnResizeEndEvent; }
public void BuildAHouse() { if (!CanBuild()) { return; } PlotManager pm = plotManager.GetComponent <PlotManager>(); BasePlot plot = pm.listPlot.Find((x) => x.plotID == cur_location); if (plot is Plot_House) { Plot_House plot_house = (plot as Plot_House); if (plot_house.owner != this && plot_house.owner != null) { return; } else if (plot_house.owner == this) { UpgradeAHouse(plot_house); return; } if (gold.amount < (plot as Plot_House).cost) { Debug.LogWarning("Not enough money"); return; } BuildingPoint bp = plot.GetComponent <BuildingPoint>(); if (bp != null) { if (name == "A") { bp.Build(1); } else { bp.Build(2); } (plot as Plot_House).owner = this; Builded = true; gold.amount -= (plot as Plot_House).cost; } } }
/// <summary> /// This is the constructor for the HeightViewModel page /// </summary> /// <param name="dataProvider">A DataProvider object to read the data from</param> public HeightViewModel(DataProvider dataProvider) { _data = dataProvider; slMaximum = _data.Height.Count - 1; if (slMaximum < 1000) { slTickFrequency = 2; } if (slMaximum > 1000 && slMaximum < 10000) { slTickFrequency = 10; } if (slMaximum > 10000 && slMaximum < 1000000) { slTickFrequency = 500; } if (slMaximum > 1000000) { slTickFrequency = 2000; } if (_data.Height.Count != 0) { slValueChanged(0); HeightMaxL = HeightMaxR = _data.Height.Max() + 10; } else { HeightText = "Height"; HeightMaxR = HeightMaxL = 10; } PlotManager manager = new PlotManager(); manager.AddLineSeries(_data.Height, "Height [ft]", OxyColors.Coral); data = manager.GetPlotModel("Height").Result; blank = new PlotModel(); blank.Title = "Height"; Plot = data; MainWindow.OnResizeStartEvent += MainWindow_OnResizeStartEvent; MainWindow.OnResizeEndEvent += MainWindow_OnResizeEndEvent; }
/// <summary> /// Awake is called when the script instance is being loaded. /// </summary> void Awake() { //Check if instance already exists if (instance == null) { //if not, set instance to this instance = this; //If instance already exists and it's not this: } else if (instance != this) { //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager. Destroy(gameObject); } //Sets this to not be destroyed when reloading scene DontDestroyOnLoad(gameObject); }
/// <summary> /// This is the constructor for the AngleGraphViewModel /// </summary> /// <param name="dataProvider">A DataProvider object to read the data from</param> public AngleGraphViewModel(DataProvider dataProvider) { _data = dataProvider; PlotManager manager = new PlotManager(); manager.AddLineSeries(_data.Roll, "Roll [°]", OxyColors.Blue); manager.AddLineSeries(_data.Pitch, "Pitch [°]", OxyColors.Chartreuse); manager.AddLineSeries(_data.Yaw, "Yaw [°]", OxyColors.Gold); data = manager.GetPlotModel("Angle").Result; blank = new PlotModel(); blank.Title = "Angle"; Plot = data; MainWindow.OnResizeStartEvent += MainWindow_OnResizeStartEvent; MainWindow.OnResizeEndEvent += MainWindow_OnResizeEndEvent; }
void Awake() { instance = this; }