示例#1
0
  def __init__(self, master):
    global c1, c2, c3, c4, c5, c6, c7, iClassifier
    global TRAIN_NUM, POS_WEIGHT, NEG_WEIGHT, Tkinter
    
    frame = Frame(master, width=700, height=600, bd=1, background ="black")
    frame.pack()

    # Add a title
    temp.iTitle = title.theTitle(frame,TOP)

    # Add setting option
  #  temp.iSetting = setting.theSetting(frame,BOTTOM)




    iFrame = Frame(frame, width=700, height=600, bd=1, background ="black")
    iFrame.pack(side=TOP)

    # User Input Image
    temp.usrInput = display.theDisplay(iFrame,"User Input Image",LEFT)
    
    # Input and weight Overlap
    temp.inputWeight = display.theDisplay(iFrame,"Input and Weight Overlap",LEFT)
    
    # Current Weight
    temp.currentWeight = display.theDisplay(iFrame,"Current weight",LEFT)


    iFrame = Frame(frame, width=700, height=600, bd=1, background ="black")
    iFrame.pack(side=TOP)
    
    # Control panel
    temp.iControl = control.theControl(iFrame,LEFT)

    # Current Weight
    temp.weightChange = display.theDisplay(iFrame,"Weight Change",LEFT)

    # System Output Frame
    temp.iOutput = output.theOutput(iFrame,LEFT)

    # Add a log list
    temp.LOG_LIST = log.theLog(iFrame,BOTTOM)
    
    # Select classifier
    temp.iClassifier = perceptron.PerceptronClassifier()
示例#2
0
          result[i][j] = '+'
        elif i > 0 and result[i-1][j] == '#':
          result[i][j] = '+'
        elif j < 27 and result[i][j+1]== '#':
          result[i][j] = '+'
        elif j > 0 and result[i][j-1] == '#':
          result[i][j] = '+'
      TEMP += result[i][j]
      text_file.write(result[i][j])
    if len(temp.text) != 0:
        temp.usrInput.canvas.delete(temp.text[i])
    tempText.append(temp.usrInput.canvas.create_text(120, count, text=TEMP, fill="#3cecff", justify=CENTER, font=('courier', 10)))
    count += 10
    if i < 27:
      text_file.write("\n")
    if i == 27:
      text_file.write(" ")
  temp.text = tempText[:]
  text_file.close()
  temp.LOG_LIST.insertItem("Loading completed.")
  temp.LOG_LIST.insertItem("==================")

# Test Module
if __name__=="__main__":
  root = Tk()
  frame = Frame(root)
  frame.pack()
  temp.c3 = Canvas(frame)
  temp.LOG_LIST = log.theLog(frame)
  loadImage()
        exit()

    def modBG(self, item):
        item["background"] = "blue"
        item["fg"] = "#FFF"
        for i in self.button:
            if self.button[i] != item:
                self.button[i]["background"] = "black"
                self.button[i]["fg"] = "#3cecff"


# Test code
if __name__ == "__main__":
    root = Tk()
    frame = Frame(root)
    temp.LOG_LIST = log.theLog(frame, TOP)
    iControl = theControl(root, TOP)

    temp.iClassifier = perceptron.PerceptronClassifier()

    temp.iTitle = title.theTitle(frame, TOP)

    # Add setting option
    #temp.iSetting = setting.theSetting(frame,TOP)

    # Add a log list
    temp.LOG_LIST = log.theLog(frame, TOP)

    # User Input Image
    temp.iDisplay = display.theDisplay(frame, "hi", TOP)