Simulation mode

First of all, thanks for your amazing work! I have started working with your sila2 implementations last week and it has been a remarkably smooth ride to create my sila drivers. However, my experience with sila2 is based on the predecessor sila2lib where simulation implementations are elemental parts of each driver (and my software development workflow relies on these simulation implementations). For the time being, I have implemented a simple simulation mode as follows:

    def GetpHpH0(self, BarNumber: int, *, metadata: MetadataDict) -> GetpHpH0_Responses:
        if self.is_simulation_mode == False:
            get_ph0_command ='cmpc?\r'
            connection = self.ser[BarNumber] # get the connection based on the count of the bars 
            connection.write(str.encode(get_ph0_command, "ascii"))
            response  =str(bytes.decode(connection.readline().rstrip(), "ascii", "replace")).replace('\n','').replace('\r','') # this should be the echo
            response  =str(bytes.decode(connection.readline().rstrip(), "ascii", "replace")).replace('\n','').replace('\r','') # this is the actual answer
            ph0 = (int(response))/100
            time.sleep(0.25)
            return GetpHpH0_Responses(PHpH0=ph0)

        if self.is_simulation_mode == True:
            return GetpHpH0_Responses(PHpH0 = 7.5)

The simulation mode is an attribute of the server and its implementations (gets passed from server to implementations). Are there any plans to implement simulation modes in the codegenerator? Or is it implemented and I am overlooking something?

Assignee Loading
Time tracking Loading