nasa/fpp #1097, open (implements nasa/fprime#5697). A code generator change in F Prime's FPP toolchain (Scala). It adds a generated parameterLoaded(id, validity) hook that by default calls parameterUpdated when the parameter loaded successfully (valid or default, via FW_PARAM_OK); the hook is invoked from the load path as each parameter is loaded, and parametersLoaded stays a do-nothing notifier that components can still override. The new behavior required a tandem F Prime change (nasa/fprime#5877), now merged, so the Comp test component accepts valid and default. Verified with the Scala unit tests, the fpp-to-cpp reference tests, and a full F Prime integration test (FppTest, 19/19). The issue it implements (nasa/fpp#1098) is on the v3.4.0 milestone.
nasa/fpp #1097, açık (nasa/fprime#5697'yi uyguluyor). F Prime'ın FPP araç zincirinde (Scala) bir kod üreteci değişikliği. Üretilen bir parameterLoaded(id, geçerlilik) hook'u ekliyor; bu hook varsayılan olarak parametre başarıyla yüklendiğinde (geçerli veya varsayılan, FW_PARAM_OK ile) parameterUpdated çağırıyor. Hook, her parametre yüklenirken yükleme yolundan çağrılıyor; parametersLoaded ise component'lerin override edebileceği, varsayılan olarak bir şey yapmayan bir bildirici olarak kalıyor. Yeni davranış, Comp test component'inin geçerli ve varsayılanı kabul etmesi için tandem bir F Prime değişikliği (nasa/fprime#5877) gerektirdi; o değişiklik artık merge edildi. Scala birim testleri, fpp-to-cpp referans testleri ve tam bir F Prime entegrasyon testiyle (FppTest, 19/19) doğrulandı. Uyguladığı issue (nasa/fpp#1098) v3.4.0 milestone'una eklendi.
Where the work actually lived
İşin gerçekte yaşadığı yer
Components in F Prime do not hand-write their parameter handling. A compiler written in Scala reads the model files and generates the C++ base class, including the code that loads parameters at startup. The generated hook that runs after loading did nothing, so a component that centralises its handling in one place had to iterate over every parameter by hand. Finding that out meant learning a new repository, a new language and a new build system before writing a line.
F Prime'daki bileşenler parametre yönetimini elle yazmıyor. Scala ile yazılmış bir derleyici model dosyalarını okuyup C++ temel sınıfını üretiyor, parametreleri açılışta yükleyen kod dahil. Yüklemeden sonra çalışan üretilmiş hook hiçbir şey yapmıyordu, bu yüzden yönetimi tek yerde toplayan bir bileşen her parametre üzerinde elle dönmek zorundaydı. Bunu anlamak, tek satır yazmadan önce yeni bir depo, yeni bir dil ve yeni bir derleme sistemi öğrenmek demekti.
Four rounds with the compiler author
Derleyicinin yazarıyla dört tur
Rob Bocchino, who wrote the compiler, reviewed it himself. The shape changed across four rounds: a guard so only successfully loaded parameters notify, then the macro that accepts defaults too, then a new hook that receives the parameter id and its validity so no information is lost, then moving the call into the load path so it fires as each parameter arrives rather than in a block at the end. Every round regenerated twenty five reference outputs that the compiler's own tests compare against.
Derleyiciyi yazan Rob Bocchino review'u bizzat yaptı. Şekil dört tur boyunca değişti: önce sadece başarıyla yüklenen parametrelerin bildirim yapması için bir koruma, sonra varsayılanları da kabul eden makro, sonra parametre kimliğini ve geçerliliğini alan ve böylece bilgi kaybetmeyen yeni bir hook, sonra çağrının yükleme yoluna taşınması, yani sondaki blokta değil her parametre geldikçe tetiklenmesi. Her tur, derleyicinin kendi testlerinin karşılaştırdığı yirmi beş referans çıktıyı yeniden üretti.
A bug my own keyboard almost shipped
Neredeyse kendi klavyemin gönderdiği hata
The generator uppercases identifiers. On a Turkish system locale, uppercasing the letter i produces a dotted capital, so every generated reference output came out subtly corrupted. Nothing failed loudly; the diff just looked odd. Forcing an English locale in the launcher fixed it. Checking the diff line by line before committing is now part of the routine rather than an afterthought.
Üreteç tanımlayıcıları büyük harfe çeviriyor. Türkçe sistem yerel ayarında i harfini büyütmek noktalı büyük harf üretiyor, bu yüzden üretilen her referans çıktısı sessizce bozuldu. Hiçbir şey yüksek sesle hata vermedi, sadece diff tuhaf görünüyordu. Başlatıcıda İngilizce yerel ayarı zorlamak sorunu çözdü. Commit öncesi diff'i satır satır kontrol etmek artık rutinin parçası, sonradan akla gelen bir şey değil.
Open on GitHub
GitHub'da aç