Keyboard Shortcuts
Likes
- Crestron
- Messages
Search
Memory management in Simpl#
#bestpractices
#simplsharp
Hi all,
I would like to ask a couple of questions about memory management in Simpl# and the best practices related to it. I will be grateful for any tips or pointing out mistakes in my thinking! Below I am pasting the shortened code of the library that I am writing to make it easier for me to present my doubts and form any questions.
?
1) For the first method I am requesting a JSON file and then creating on its basis a list of objects of type 'Station', to which the references are stored in the '_allStations' global variable. Everything is (I guess) okay if I call this method once, but what if it will be called automatically e.g. every 30 seconds? I understand that each time a new list of objects will be created and each time the global variable '_allStations' will hold a reference to the new list of objects, right? But what will happen to the lists of objects from the previous calls? Since no variable holds references to them, will GC take care of them? Or maybe this 'taking care' should be included in the code somehow?
?
2) In the second case, the situation at the beginning is similar - using the globar variable '_allStations' I am creating a new list of 'Station' objects that meet the given condition. Then I convert this list to array and send this through the delegate to Simpl+. And here is another question - if I also called this method very often, a new list of objects would be created each time (situation as above). Additionally, however, I also have a local variable 'array' here. And what actually happens with it after leaving the function? Does GC take care of it after exiting the function? Or maybe, since a reference to it is passed by a delegate to a function in Simpl+ then the 'array' remains in memory till the next call of this function?
?
I will be grateful for any help!
Best regards, Wojciech ?
namespace PJPUtility
{
? ? (...)
? ? public class PJP
? ? {
? ? ? ? (...)
? ? ? ? private List<Station> _allStations;
? ? ? ? private List<Station> _specificStations;
?
? ? ? ? public string CityName { get; set; }
? ? ? ? public FindSpecificMeasuringStationsDelegate FindSpecificMeasuringStationsCallback { get; set; }
?
? ? ? ? public void FindAllMeasuringStations() <--- Question 1
? ? ? ? {
? ? ? ? ? ? var response = _client.Get("http://api.gios.gov.pl/pjp-api/rest/station/findAll");
? ? ? ? ? ? _allStations = JsonConvert.DeserializeObject<List<Station>>(response);
? ? ? ? }
?
? ? ? ? public void FindSpecificMeasuringStations() <--- Question 2
? ? ? ? {
? ? ? ? ? ? (...)
? ? ? ? ? ? _specificStations = _allStations.FindAll(x => x.City.Name.Contains(CityName));
?
? ? ? ? ? ? var array = _specificStations.ToArray();
? ? ? ? ? ? OnFindSpecificMeasuringStationsCallback(new StationsInfo { Count = (ushort)_specificStations.Count, Elements = array });
? ? ? ? }
? ? (...)
? ? }
} |
Re: DM-MD16X16 Specs
¿ªÔÆÌåÓýThe ganged cards was more of an aesthetic change than anything else ¨C the chassis didn¡¯t change in any substantive way and you can use single cards in an original switcher more or less just as easily as you can use the ganged cards in a brand new switcher. ? Even with the CPU3 card nothing really changed except the card in the CPU slot ¨C you can order a CPU3 card for your original switcher if you want. Same thing with back and forwards compatibility of the 4KZ cards ¨C in many ways the DM architecture is one of the best examples of a long-lived, serviceable, and incrementally upgradable tech product in the AV world. ? At some point (~2015/16, IIRC) the power supplies (number, configuration, and internal orientation) got changed and there are relatively minor differences as far as airflow go (the ¡°original¡± design, at least for the 16x16 uses perforated side panels while the ¡°new¡± design has punched fan openings with circular metal grilles added after the fact. (Learned this partially because the 30A 12V PSU in my first DM-MD16X16 failed and it wound up being significantly cheaper to just buy a new-to-me 16x16 via secondary sources than order the replacement from the PSU OEM) ? Lincoln ? -- Lincoln King-Cliby, CTS, DMC-E-4K/T/D ? From: [email protected] [mailto:[email protected]]
On Behalf Of Bob Baxter via groups.io
Sent: Monday, March 01, 2021 8:38 AM To: [email protected] Subject: [crestron] DM-MD16X16 Specs ? I have a client with a DM-MD16x16 from 2009. ?The product was made end of life in 2019 with the replacement CPU3. ?Over the 10 year period (2009-2019), were there any substantive changes to the DM-MD16x16 other than the cards being updated to 4kz. ?Specifically, did the hardware of the switcher change over the 10 years? ? ?I know the older models used multi gang output cards. ?Any other changes? ? |
DM-MD16X16 Specs
I have a client with a DM-MD16x16 from 2009. ?The product was made end of life in 2019 with the replacement CPU3. ?Over the 10 year period (2009-2019), were there any substantive changes to the DM-MD16x16 other than the cards being updated to 4kz. ?Specifically, did the hardware of the switcher change over the 10 years? ? ?I know the older models used multi gang output cards. ?Any other changes? ?
|
Re: Adagio internal power supply
toggle quoted message
Show quoted text
|
Epiphan Pearl 2 RS-232
Does anyone have experience controlling an Epiphan Pearl 2 via RS-232 for more than just starting and stopping recording?? I have one site where I can use the application market module (which is still somewhat buggy in my opinion) but I have another site where the AV cannot be on the client network. I can start and stop recordings and change layouts.? My issue is with starting and stopping streams.
The following command will start the first configured stream on channel 3. SET.3.publish_enabled=on? ?.? The following command will stop the same stream, SET.3.publish_enabled=off.? From what I can tell, there is no API command to access the 2nd,3rd, 4th etc streams set up on a channel.? Has anyone done this via rs-232?.? The functionality is there on the IP module so I would assume it is do-able via rs-232.? I've enabled verbose mode on the ip module to see if I can glean any information on how it is done there but it hasn't been helpful.? Thanks in advance.? |
Re: Certified Drivers
On Sun, Feb 28, 2021 at 01:40 AM, Oliver Hall wrote:
The CCD evolution has resulted in a ton of dependencies that make a change like swappable components - well - impossible.I should've touched on this in more detail myself, since I figure most people wouldn't intuitively understand how AppDomains would help with this. I had an interesting idea just now though, which might allow for the existing infrastructure to allow more hot-swappable components at runtime (only on 4-series though). -- ?
Crestron Service Provider - TBD Enterprises Inc.
|
Re: QSC Q-SYS Dialer Module
#programming
Thank you for all of your suggestions and help with this!
I am a Biamp expert, but QSC took some effort on the Crestron side. |
Re: Certified Drivers
I don¡¯t know what¡¯s on and off topic here any more, so bear with me...
Troy¡¯s idea is nice, and the technical benefits would be cool. ?However, that¡¯s just one piece of a much bigger jigsaw. ?The CCD evolution has resulted in a ton of dependencies that make a change like swappable components - well - impossible. ?At least not without a fresh look across the board, and I think Crestron have become too entrenched in what they have to pivot now. ?A trivial example is the dependency on the Json data file - there¡¯s a big chunk of ¡°hard coded¡± transport config data there. Yes - there are solutions to everything... I¡¯m just suggesting the current architecture doesn¡¯t lend itself to micro-improvements. Most drivers (at least the ones I¡¯ve come across - quite a lot) aren¡¯t quite as ¡°switchable¡± on transport as one would hope either. ?There are a few where the transport is transparent to the protocol, but many more have subtle differences - packet wrapping, authentication, timing, delimiters and so on. ?It¡¯s never as simple as we¡¯d hope! ;) |
Re: Certified Drivers
Fair enough!
I think on the topic of CCD's, another thing I'd say is that their method is antiquated. They'd rather provide backwards compatibility instead of leveraging the real power that comes with 4-series and subsequently the full .NET framework without any sandbox. The concept is great, but now is in dire need of an upgrade! What I'm referring to is the use of separate AppDomains more specifically, and the ability to change the transport at runtime... Off the top of my head, I can't see there being an issue with marshalling the communication over to allow a driver to send data that talks with the hardware, and IP communication would never have to be serialized. I know many people might not realize the benefit of having the transport switchable at runtime, but there's one massive benefit IMHO... The ability to switch the transport without a recompile! Imagine having gone through user acceptance training initially, then a couple months later they switch to a new model of a device that doesn't have IP communication and you have to switch over to serial. If you can isolate the change in code to a separate DLL, then you also mitigate the chance that a different compile of your program introduces bugs from a different version of the Crestron database. Who knows if different versions of SIMPL have bugs that would affect the recompile in an inadvertent way as well...) I've had issues with CCD's and broken database versions in the past (affecting the wrapper symbols)... Other than that, the only other source of any bugs would be within the driver framework itself, or the driver itself. -- ?
Crestron Service Provider - TBD Enterprises Inc.
|
Re: Where to Sell Crestron Gear?
I've been doing a basement cleanout of older Crestron for a couple of months now on Fleabay and it's been OK. I'd suggest looking at sold item pricing for the units you want to move to see if they're bringing enough money to make it worth it when you figure in the time you spend listing - packing - shipping and the percentage eBay and Paypal hit you up for. And be careful using their shipping calculator, they don't seem to factor in dimensional weight and can sadly undercharge the buyer for the shipping cost on any larger box and you'll end up eating the difference.
Selling at auction with a low start price will usually sell though not bring top dollar. A Buy It Now in the mid-range of what things seem to bring might get you more dough but sometimes the stuff will sit for a while before it moves. |
Re: Certified Drivers
My ¡°let¡¯s keep it on topic¡± post had nothing to do with your post, Troy. ?In fact, yours was completely and appreciatively on topic.
My comments were directed at the post regarding Crestron¡¯s lawyers and marketing team holding a knife to people¡¯s throats. That kind of stuff is unwarranted and doesn¡¯t help any discussion regarding CCDs. |
Re: Certified Drivers
On Fri, Feb 26, 2021 at 01:09 PM, Brian Matson wrote:
However, they probably support their products better than most manufacturers in this industry, without requiring a service contract.I've had great support from many other manufacturers personally. There are a few cases where I've found Crestron to be the lacking for support, and other days they've been incredible. It isn't a generalization since there's many different people that work in support; and sometimes it depends on who you get, and whether they've had a bad day or not prior to answering your ticket. However, It's neither productive or beneficial to ignore or discourage feedback we can provide Crestron to allow them to improve in my opinion. Every business model will also differ.. If people want to provide the ability for a client to change things more frequently, they should be able to attempt to accommodate that without saying "no, Crestron has these bugs in firmware/module/hardware, you'll have to wait 3/6/9 months". That's a comparatively slow turnaround in the software world, which has transitioned to being mostly agile these days. If we can lessen the amount of things we have to remember to AVOID issues like this without having to encounter them out of surprise, I see that as a win for Crestron, us integrators, and the end-users. To your idea that every product has its issues, this is true. All companies should appreciate and accept the feedback however; good or bad. This is the only way these things will ever get noticed. The first step to having anything improve is to acknowledge that there is a problem. I'd encourage constructive criticism and feedback any day. This post was about Certified Drivers however, so please let's keep on topic here... I gave valid feedback on CCD's based on my previous experience using (and creating) them (mentioning that there was a database issue that "broke" them at one point) in order to educate people here. This isn't being negative, as some of the people in this group rely on feedback like this to be successful in the industry with their business operations. ? -- ?
Crestron Service Provider - TBD Enterprises Inc.
|
Re: Compile SIMPL module as CH
¿ªÔÆÌåÓýOK, that?s what i was assuming¡ Thanks for the quick response. ? Cheers, Thorsten ? Von: [email protected] <[email protected]> Im Auftrag von Nathan Durfee ? That just wont work. Crestron Home "modules" are written entirely in C# and follow a lot of rules.? |
Compile SIMPL module as CH
¿ªÔÆÌåÓýHi, i?m currently developing a driver for an IP controlled device and the customer is asking if I can also provide it as a Crestron Home module. I?m doing the module in SIMPL+. Can somebody tell me what needs to be done to compile it as CH driver? From what i?ve read so far, it?s more than just recompile¡ ? Cheers, Thorsten |
Re: IR Pulsing for a certain time & NVRAM
#simplwindows
#crestron
#programming
#lighting
#lutron
All:
? ?When I had an AMX system controlling the same Lutron Spacer, I had 6 scenes and buttons for on, off, 25%, 50%, 75% and 100%. First, I timed how long it took to go from full off to full on and I took that value & divided it by 4, giving me the time interval for 25%, 50%, 75% & 100% and I made a variable named Brightness. If Brightness = 100 and I pressed the button for 50%, the If, Then, Else statements I made checked the Brightness value and dimmed the lights pulsing the IR and Brightness was set to 50. So, how do I do this same thing with Crestron? dsmithp233 |
Re: Certified Drivers
I was just getting tired of every discussion about a problem turning into a rant on how much Crestron sucks.
It definitely does some of the time, and they like to make our jobs difficult by enticing us with updates. However, they probably support their products better than most manufacturers in this industry, without requiring a service contract. I agree that there's a major difference between 2 series and 3 or 4 series. With the most installs, new ones included, when a system has been debugged and running for a while, it is very stable. Also, in the majority of our residential installations, devices aren't being added regularly. Services being added to a streaming device (Roku, Apple TV, Autonomic, Sonos, etc.) don't require any update to the system. In our case at least, systems that have been installed and running for several months are typically rock solid for many years. That being said, I do turn off all of the Crestron cloud services, auto updates, etc. When an update does happen, I don't install the latest database or firmware unless it has been released for at least 3 months. The only exception to this is when we require the features included in the update (NVX AES67 audio for example). Regarding this topic, I have yet to install anything that required a CCD for serial or IP communication, so maybe I am just lucky. I do have some systems with IR and CEC CCDs and haven't had a single problem with them. |
Re: Certified Drivers
On Fri, Feb 26, 2021 at 09:42 AM, Brian Matson wrote:
That means not using CCDs, and don't update a working system.You can't avoid this, and they're pushing certified drivers on all of their other platforms. Also, a lot has changed since the 90's, you can't compare the 2-series platform to 3-series and 4-series issues. There's more requirements to have secured devices, secure communication, and IP control is becoming more prevalent (and in some cases, is the only option). Also, when the Sonos debacle happened recently, our Crestron Home systems still worked or at least were the first to get a resolution.It's possible.. However, in some cases with firmware, you need to upgrade for many different reasons. Simply avoiding it in many scenarios is also not an option. Database versions require firmware updates, bugs with certain features, etc... And while you're upgrading firmware, you have the potential to introduce new bugs that require future firmware updates. In practice, there are a lot of considerations. ? -- ?
Crestron Service Provider - TBD Enterprises Inc.
|