2021-01-26 17:07:34 +08:00
|
|
|
from module.os.config import OSConfig
|
|
|
|
|
from module.os.map_operation import OSMapOperation
|
2021-04-05 18:15:16 +08:00
|
|
|
from module.os.operation_siren import OperationSiren
|
2021-01-26 17:07:34 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class OSCampaignRun(OSMapOperation):
|
2021-04-05 18:15:16 +08:00
|
|
|
campaign: OperationSiren
|
|
|
|
|
|
|
|
|
|
campaign_loaded = False
|
2021-01-26 17:07:34 +08:00
|
|
|
|
|
|
|
|
def load_campaign(self):
|
2021-04-05 18:15:16 +08:00
|
|
|
if self.campaign_loaded:
|
|
|
|
|
return False
|
|
|
|
|
|
2021-01-26 17:07:34 +08:00
|
|
|
config = self.config.merge(OSConfig())
|
2021-04-05 18:15:16 +08:00
|
|
|
self.campaign = OperationSiren(config=config, device=self.device)
|
|
|
|
|
|
|
|
|
|
self.campaign_loaded = True
|
|
|
|
|
return True
|
2021-01-26 17:07:34 +08:00
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
|
self.load_campaign()
|
|
|
|
|
self.campaign.run()
|