from pyrois import RoIS_Service, RoIS_HRI
from pyrois.RoIS_Common import Component_Status
from pyrois.RoIS_Service import Completed_Status
from pyRoIS_higashi import HRI_Engine_client_sample, Service_Application_IF_sample, HRI_Engine_sample

import logging
import queue
import threading
import time
import enum
import xmlrpc
from termcolor import colored
from transitions import Machine
import sys


class Task(enum.Enum):
    Init        = 'Init'
    GetUserPos  = 'GetUserPos'
    NaviToUser  = 'NaviToUser'
    ListenDest  = 'ListenDest'
    NaviToGuide = 'NaviToGuide'
    End         = 'End'


class test1(HRI_Engine_client_sample.IF): #vscode上ではクラス名が白文字のまま HRI_Engine_sampleも同様 多段階継承になるかどうか？
    def __init__(self, uri="http://127.0.0.1:8000", logger=None):
        HRI_Engine_client_sample.IF.__init__(self, uri=uri, logger=None, event_queue=None)
        # buid state machine

class test2(Service_Application_IF_sample.Service_Application_IF): #緑字になる
    def __init__(self, uri="http://127.0.0.1:8000", logger=None):
        Service_Application_IF_sample.Service_Application_IF.__init__(self, uri=uri, logger=None, event_queue=None)
        # buid state machine


class Service: #継承しなければうまくいく
    def __init__(self, uri="http://127.0.0.1:8000", logger=None):
        self.test = HRI_Engine_client_sample.IF(uri=uri, logger=None, event_queue=None)
        # buid state machine

    def run(self):
        self.test.connect()
        self.test.get_profile("")
        # self.search("")
        # self.bind('urn:x-rois:def:HRIComponent:Kyutech:main:Navigation')
        # self.bind('urn:x-rois:def:HRIComponent:Kyutech:main:SystemInformation')
        # self.bind('urn:x-rois:def:HRIComponent:Kyutech:main:SpeechRecognition')
        # self.bind('urn:x-rois:def:HRIComponent:Kyutech:main:PersonLocalization')

        # self.get_parameter('urn:x-rois:def:HRIComponent:Kyutech:main:SystemInformation')

        
        time.sleep(10)


if __name__ == '__main__':
    service = Service()
    print("Starting service..")
    service.run()
