Ejemplo n.º 1
0
class RubbishAPI:
    csvMap = {}
    dirpath = ""
    fileName = "mst/keywordCSV.csv"

    def __init__(self, window_w, window_h, title, dirpath):
        self.dirpath = dirpath
        self.fileName = dirpath + "/" + self.fileName

        # CSV読み込み
        self.csvMap = self.importCSV()

        # MainFrame呼び出し
        self.mainFrame = MainFrame(window_w, window_h, title, self.csvMap,
                                   self.dirpath)

    def show(self):
        self.mainFrame.run()

    ###
    # CSVを読込み辞書化する
    #
    ###
    def importCSV(self):
        try:
            file = open(self.fileName, encoding='utf-8')
            lines = file.readlines()
            for line in lines:
                words = line.split(',')

                # おしゃべり辞書作成
                if len(words) == 3:
                    csv = {
                        'img_name': words[1].rstrip('\n'),
                        'answer': words[2].rstrip('\n')
                    }
                    self.csvMap[words[0].rstrip('\n')] = csv

                # ERROR(かな以外エラー)設定
                if 'ERROR' not in self.csvMap:
                    csv = {'img_name': "000", 'answer': "すべて「かな」で かいてください"}
                    self.csvMap['ERROR'] = csv

                # NOTHING(辞書不在エラー)設定
                if 'NOTHING' not in self.csvMap:
                    csv = {'img_name': "000", 'answer': "たんごが とうろく されていません"}
                    self.csvMap['NOTHING'] = csv

                # FIRST(初回表示文言)設定
                if 'FIRST' not in self.csvMap:
                    csv = {'img_name': "000", 'answer': "きーわーどを いれてください"}
                    self.csvMap['FIRST'] = csv

        except Exception as e:
            print(e)
        finally:
            file.close()

        return self.csvMap
Ejemplo n.º 2
0
def main():
    """
    Creates App class instance, then initiates the main 
    frame where all other modules are loaded.
    Runs the main loop
    """
    app = wx.App()
    frame = MainFrame()
    frame.Show()
    app.MainLoop()
Ejemplo n.º 3
0
    def __init__(self, window_w, window_h, title, dirpath):
        self.dirpath = dirpath
        self.fileName = dirpath + "/" + self.fileName

        # CSV読み込み
        self.csvMap = self.importCSV()

        # MainFrame呼び出し
        self.mainFrame = MainFrame(window_w, window_h, title, self.csvMap,
                                   self.dirpath)
Ejemplo n.º 4
0
    def loadFrame(self, frame_id, pos, cache):
        """
		"""
        if frame_id == self.login_frame_id:
            return LoginFrame(None, frame_id, pos, self.main_frame_id,
                              self.callback_function, cache)
        elif frame_id == self.main_frame_id:
            return MainFrame(None, frame_id, pos, self.login_frame_id,
                             self.callback_function, cache)
def control():
    root = Toplevel()
    root.wm_title("Monitoreo de temperatura y luminosidad")
    root.iconbitmap("UNT.ico")
    app = MainFrame(root)
    app.mainloop()
Ejemplo n.º 6
0
 def OnInit(self):
     mainFrame = MainFrame()
     mainFrame.Show(True)
     return True
Ejemplo n.º 7
0
def main():
    root = Tk()
    root.wm_title("Sensores y Actuadores - Arduino")
    app = MainFrame(root)
    app.mainloop()
Ejemplo n.º 8
0
    '[P3]: Add a config frame with all bgm.ini option',
    '[P3]: add shadow to text element',
    '[P1]: replace cache mcasnism for template: add an option for force reload in get or getitem in templatedirectory',
    '[P2]: replace image progrid loader to have mask feature & cropping / resize feature like MSE',
    '[P2]: find a way to distingate between game/style property and new property',
]

for t in todos:
    print "[BGM]:", t

from mainFrame import MainFrame

if __name__ == '__main__':
    app = wx.PySimpleApp()
    wx.InitAllImageHandlers()
    frame = MainFrame(None)
    START = True
    if '--debug' in sys.argv:
        frame.OnPyShell(None)
        sys.argv.remove('--debug')
    if len(sys.argv) > 1:  #filename of a deck ?? load it !
        name = sys.argv[1]
        if name.endswith('.dck') or name.endswith('.csv'):
            print 'Loading Deck ', name
            frame.LoadDeck(sys.argv[1])
        elif name.endswith('.py') or name.endswith('.tmpl') or name.endswith(
                'bgp'):
            print 'Loading Script/Template', name
            #This fire the callback =>load the file
            frame.LoadTemplate(name, select=True)
    if '--print' in sys.argv:
Ejemplo n.º 9
0
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created by: PyQt5 UI code generator 5.10.1
#
# WARNING! All changes made in this file will be lost!

from PyQt5 import QtWidgets
from mainFrame import MainFrame

if __name__ == '__main__':
    app = QtWidgets.QApplication([])
    window = MainFrame()
    window.show()
    app.exec_()
Ejemplo n.º 10
0
import numpy as np
import cv2
import math
import collections
import os
import shutil
from nn_setup import CNNValue
from nn_setup_duration import CNNDuraiton

from mainFrame import MainFrame

try:
    CNNValue.reloadModel()
    print('nn setup reload')
    CNNDuraiton.reloadModel()
    print('nn duration reload')
except:
    pass
print('hi')
window = MainFrame()