#! /usr/bin/python3 from solo.patch import patch class hetept94(patch): def assemble(self, T, **aa): self.OH_C = T if self.config is None: raise ValueError("Please provide a config=") self.scratch(subversion=4) self.ppss_oh = self.config.ppss.find_flags("OPHEATER")[0] OH_DC_ESTIMATE = 60 OH_SHIFT = 0 OH_DCMAX = 70 def send(self, msg): self.send_scratch(msg) self.config.ppss.set_opheater_setpoint( msg = msg, T = self.OH_C, dcmax = self.OH_DCMAX *192//100, dc_estimate=self.OH_DC_ESTIMATE *192//100, shift = self.OH_SHIFT ) self.send_ping(msg) def revert(self, msg): self.ppss_oh(msg) self.send_ping(msg) def main(self, fmts=["xml", "msg"]): for fmt in fmts: fn = "hetept%s_v0009_patch4.%s" % (self.config.unit[-1], fmt) self.emit(f=fn, fmt=fmt) fn = "hetept%s_v0009_revert4.%s" % (self.config.unit[-1], fmt) self.emit(f=fn, fmt=fmt, revert=True) import solo.hetept.config patch1 = hetept94(name="fm1", T=-6.0, config=solo.hetept.config.fm1(config_page=0x10000, patch=3)) patch2 = hetept94(name="fm2", T=-1.0, config=solo.hetept.config.fm2(config_page=0x10000, patch=3)) def main(): patch1.main() patch2.main()