// Start is called before the first frame update void Start() { ToggleButton(); logger = gameObject.GetComponent <CSVLogger>(); sM = gameObject.GetComponent <SetupManager>(); //InvokeRepeating("click",1,1); }
/// <summary> /// Creates multiple timers acording to the needed measurement frequencies. /// </summary> private void MeasurementPreProcessing() { if (Configuration.AnalogPins.Count > 0) { #region Build Logger MeasurementCSVLogger = new CSVLogger( Configuration.GetCSVLogName(), new List <string> (), true, false, Configuration.CSVSaveFolderPath ); MeasurementCSVLogger.CultureInfo = CultureInfo.GetCultures(CultureTypes.AllCultures).Single(o => o.EnglishName == Configuration.ValueFormatCultur); MeasurementCSVLogger.Mapping = Configuration.CreateMapping(); MeasurementCSVLogger.Separator = SeparatorOptions.GetOption(Configuration.Separator); MeasurementCSVLogger.EmptySpaceFilling = Configuration.EmptyValueFilling; MeasurementCSVLogger.DateTimeFormat = FormatOptions.GetFormat(Configuration.TimeFormat); MeasurementCSVLogger.WriteHeader(MeasurementCSVLogger.Mapping.Keys.ToList <string> ()); MeasurementCSVLogger.Start(); #endregion if (MeasurementTimer != null) { MeasurementTimer.Dispose(); } } }
// CSV logging and early stopping call backs: // The early stopping parameters are not fully developed and could use improvement private static Callback[] GetCallbacks(bool isEarlyStop, string logname) { CSVLogger csv_logger = new CSVLogger(logname); return(isEarlyStop ? new Callback[] { csv_logger, new EarlyStopping(monitor: "val_accuracy", 0, 50, 1, mode: "max", 1) } : new Callback[] { csv_logger }); }
public override float eventStart() { foreach (var buff in owner.effectList) { if (buff.modificator != null) { buff.modificator.owner = owner; buff.modificator.target = target; buff.modificator.updateMakingDamage(ability); } } foreach (var buff in target.effectList) { if (buff.modificator != null) { buff.modificator.owner = target; buff.modificator.target = owner; buff.modificator.updateGettingDamage(ability); } } float value = target.damage(ability); owner.statistics.damageDealed += value; owner.updateAgro(owner.agro + 1); target.updateAgro(target.agro - 1); logEvent(" deal " + value + " to " + target.name + "[" + target.health + "/" + target.maxHealth + "]"); if (value > 0) { if (ability.hasAttribute(EffectAttribures.MAGIC_SHIELD)) { target.personController.magicShieldTrigger(); } else if (ability.hasAttribute(EffectAttribures.BLOCK)) { target.personController.blockTrigger(); } else { target.personController.hittenTrigger(); } return(eventDuration); } if (!target.isAlive) { logEvent(" kill " + target.name); CSVLogger.log(eventTime, owner.name, GetType().ToString(), owner.name + " kill " + target.name); } return(0.0f); }
private static void verify_initialization() { if (mSelfReference == null) { File.WriteAllText(@"mage_logs.csv", string.Empty); file = new StreamWriter(@"mage_logs.csv"); string output = "real time" + "," + "time" + "," + "Person" + "," + "Event Type" + "," + "Message"; file.WriteLine(output); file.Flush(); mSelfReference = new CSVLogger(); } }
public override void Enter() { base.Enter(); Instance = this; Random = new Random(0); Setup(); ChangeState(new LoadingState()); #if BETA_RELEASE dtimeLog = new CSVLogger("dtimes", "DTime"); #endif Program.Instance.ProgramEvent += new ProgramEventHandler(Instance_ProgramEvent); }
public void OnEnable() { csvLog = OpenWindowListener.GetLogger(); SceneView.onSceneGUIDelegate += OnSceneGUI; inventoryController = new InventoryController(width, height); activePage = inventoryController.GetActivePage(); rightClickedBoxId = -1; leftClickedBoxId = -1; dragStartedInWindow = false; dragStartedAt = -1; csvLog.WriteRow(new List <string>(new string[] { "Enable Inventory Window" })); }
public static void OnSceneGUI(SceneView view) { Event e = Event.current; switch (e.type) { case EventType.keyDown: { if (e.keyCode == (KeyCode.I)) { e.Use(); if (windowOpen == false) { InventoryWindow.ShowWindow(); windowOpen = true; } else { EditorWindow.GetWindow <InventoryWindow>().Close(); windowOpen = false; } } if (e.control && e.keyCode == KeyCode.RightArrow) { csvLog.NextTask(); e.Use(); } if (e.control && e.keyCode == KeyCode.Delete) { csvLog.Dispose(); csvId++; csvLog = new CSVLogger("testCSV" + csvId + ".csv"); InventoryWindow.setCSVLogger(csvLog); } break; } } }
// Update is called once per frame void Update() { base.Update(); if (isActive) { if (PartiesSingleton.hasWinner()) { CSVLogger.log(EventQueueSingleton.queue.nextEventTime, "FightController", "FightController", "Result"); foreach (var hero in PartiesSingleton.heroes.getLivePersons()) { CSVLogger.log(EventQueueSingleton.queue.nextEventTime, "FightController", "FightController", hero.name + "has " + hero.health); } foreach (var hero in PartiesSingleton.enemies.getLivePersons()) { CSVLogger.log(EventQueueSingleton.queue.nextEventTime, "FightController", "FightController", hero.name + "has " + hero.health); } isFinished = true; openFightResult(); } else { if (!EventQueueSingleton.queue.fastFight) { string result = EventQueueSingleton.queue.startEvent(Time.fixedTime); if (result.Length > 0) { eventLog.GetComponent <Text>().text = result; displayEvents(EventQueueSingleton.queue.events); } } } } }
/// <summary> /// Creates multiple timers acording to the needed measurement frequencies. /// </summary> private void MeasurementPreProcessing() { if (Configuration.AnalogPins.Count > 0) { #region Build Logger MeasurementCSVLogger = new CSVLogger ( Configuration.GetCSVLogName (), new List<string> (), true, false, Configuration.CSVSaveFolderPath ); MeasurementCSVLogger.CultureInfo = CultureInfo.GetCultures (CultureTypes.AllCultures).Single (o => o.EnglishName == Configuration.ValueFormatCultur); MeasurementCSVLogger.Mapping = Configuration.CreateMapping (); MeasurementCSVLogger.Separator = SeparatorOptions.GetOption (Configuration.Separator); MeasurementCSVLogger.EmptySpaceFilling = Configuration.EmptyValueFilling; MeasurementCSVLogger.DateTimeFormat = FormatOptions.GetFormat (Configuration.TimeFormat); MeasurementCSVLogger.WriteHeader (MeasurementCSVLogger.Mapping.Keys.ToList<string> ()); MeasurementCSVLogger.Start (); #endregion if (MeasurementTimer != null) { MeasurementTimer.Dispose (); } } }
public void userLogEvent(string message) { CSVLogger.log(eventTime, "user", GetType().ToString(), message); }
public void logEvent(string message) { CSVLogger.log(eventTime, owner.name, GetType().ToString(), message); }
public static void setCSVLogger(CSVLogger csv) { csvLog = csv; }