I am using DataGridPro(#mui/x-data-grid-pro": "^4.0.2") to display the data from SignalR, I can see that data-grid delay 2-3 seconds before display the result but if I click at checkbox header(Select all). Result will be displayed correctly. Any suggestion ?
Related
Is there any way one can know the time remaining until Anylogic model completes it's execution in real time using traceln.
I am trying to trigger an anylogic model jar file using vba & want to show a progress bar displaying the Progress of experiment & time remaining until model execution is completed.
I think you want to know the real time that the model execution will take and us that to show a progress bar.
Felipe showed how to calculate the simulation time based on starttime and endtime set in the sim experiment and the current simulation time.
I don't think there is an easy way to do what you want. based on trial and error you could insert some traceln inside your model and use that to time the progress bar. Though it would change based on your inputs. Even the progress bars you see on microsoft apps / installations are not too accurate so thats never easy.
double remaingTimeSeconds=getEngine().getStopTime(SECOND)-time(SECOND);
traceln(remaingTimeSeconds);
in a more general way, if your model doesnt start at t=0, then you can do the following to get the remaing progress:
double totalSimTimeSeconds=getEngine().getStopTime(SECOND)-getEngine().getStartTime(SECOND);
double timeSinceStartSeconds=time(SECOND)-getEngine().getStartTime(SECOND);
double remaingingTimeSeconds=totalSimTimeSeconds-timeSinceStartSeconds;
double fractionRemaining=remaingingTimeSeconds/totalSimTimeSeconds;
traceln(fractionRemaining*100+"%");
I have created a UI page for user to input the delay duration in edit boxes for certain activities at the simulation screen. The input values should update the database value and amend the delay duration. However, while the database does get updated, the delay block in the main screen keeps capturing the non-updated database value (eg. initial database value is 100, then a user inputs 200. The database value updates to 200, however, my delay block still captures 100.) Is this an issue with AnyLogic database or am I using it wrongly?
You need to specify in the unique result formula that you do not want to make use of the cached result.
(This image is from the local AnyLogic help, you can search for "uniqueResult". I could not find it on the new online help.
The default value is to use true, i.e. use the previous value that was retrieved from the DB for the same query
Simply add false as the first argument in your uniqueResult() code.
I'm building a Grafana dashboard with some Stat panels that show average, minimum, and maximum time values (see below) for specific fields in my database. I'm storing the data in seconds and setting the value's units to seconds after which the panel displays the time in weeks, days, hours, etc. For the sake of consistency, I would like everything to be shown in days but I haven't been able to find a way to force units for the output value. If it's possible to do this, could someone please point me to some docs, or something that could show me which configurations to make in my panels?
So far, I've tried (without success):
Configure each panel to use units of days
The result of this was that everything showed up in years, etc.
Configure each panel to create a new field by performing a binary calculation where I converted from seconds to days and then I updated the units to be days
The result was that the values were not changed at all -> instead of showing X days, or whatever, it just showed the value in seconds without the units. I'm not sure what I messed up there, but it didn’t change anything.
I found this link that discusses setting a time range for queries
This didn’t end up being useful for what I was trying to do because it was actually geared towards changing the query to a specific date range rather than the output.
I looked through the transformations documentation, stat panel documentation, and a few other panel documentation pages in an effort to see if there was any information on how to do it but I was unable to find anything on forcing the output value to use a specific unit.
Edit:
So I kept messing around with the dashboard and got a solution that works - i.e. it's a "good-enough" solution (see below) - but, now, I'm curious if it's possible to show the units along with the value without it converting it to some other unit. Does anyone have any ideas about this?
One thing to note is that the data for this image is different than the data for the previous one so I'm expecting an inexact conversion to days.
You can use a custom unit. It is a bit tricky to enter the unit in the UI because of the automatic selection but if you enter i.e. "days" (without the quotes) in the Unit field ans instead of leving the field with tab or mouse click use the scrollbar of the combobox and select the last entry "Custom Unit: days".
Hope it helps. And for the record: I am using Garafana 7.1.4
I've created a function to calculate time difference between current time and time recorded as StartTime. All calculations are perfect but my "StopWatch" won't update every second. Is there a way of updating it, so it can display every second elapsed since start point?
Window refreshing script isn't an option really.
Short answer: no.
There is nothing in Filemaker that will happen as a result of merely time passing - except for a script paused for a duration or installed on a timer.
To show a live, ticking clock, your best option would be to use a web viewer - see an example file here: http://fmforums.com/forums/topic/71934-calculating-elapsed-time-realtime/?do=findComment&comment=340205
When you bind to a Kendo UI Grid with MVVM, databound will fire once and all is well. If you need to update that data after the fact, every time you change one piece of data on any viewmodel (or child viewmodel), the entire grid re-databinds. Thus, if you had some cell in the grid that is bound to a template and you have to change 2 or 3 properties on the viewmodel from some external ajax source, Databound will fire 2 or 3 times for each model that is changed, causing the entire viewable area to rebind. How can we update lots of data at once and only have databound fire once?
How exactly you rebind the Grid? Basically if you change some of the models like this:
dataItem.set('SomeField','new value');
dataItem.set('someOtherField','other value');
This way the Grid will be indeed bound two times because of the MVVM. The change event is triggered each time you call set.
However if you update the values like this:
dataItem.SomeField='new value';
dataItem.someOtherField= 'other value';
The Grid wont react to the change and wont rebind re-read the values from the models you can force the Grid to do it through the refresh method.
$('#gridName').data().kendoGrid.refresh()
I'm not sure if there is some way to temporarily tell the grid to stop listening to events and then at the end, re-sync once. If there is, please give that answer here! Otherwise, what I did instead is I didn't go through .set() for each item. Instead, I updated the data for all the rows by setting the data directly to the property. Then when I got to the very last row I was updating, I called .set() on the last property that needed to be updated. This will cause databound to fire only once and the entire grid will refresh itself with all the data that was changed. If you don't do it this way, then the more rows displayed on the page, the longer it takes to process. (It could take 20+ seconds before the user can do anything again.)
It looks like the dataBinding event is where you can prevent a rebind on the grid.
Telerik Online Docs