initial commit lets start

This commit is contained in:
Adrian Zuercher
2026-08-28 17:59:35 +02:00
commit 3ba5a189f3
48 changed files with 100075 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
package models
import (
"encoding/xml"
"schema"
)
type Data struct {
XMLName xml.Name `xml:"data"`
Name string `xml:"name,attr"`
HandleUnknown string `xml:"handleUnknown,attr"`
ProjectInformation *ProjectInformation `xml:"ProjectInformation,omitempty"`
Resource *Resourse `xml:"resource,omitempty"`
TaskSettings *TaskSettings `xml:"TaskSettings,omitempty"`
Attributes *Attributes `xml:"Attributes,omitempty"`
InterfaceAsPlainText *InterfaceAsPlainText `xml:"InterfaceAsPlainText,omitempty"`
ObjectId *ObjectId `xml:"ObjectId,omitempty"`
}
func NewData(name, handleUnknown string) *Data {
return &Data{
Name: name,
HandleUnknown: handleUnknown,
}
}
func (d *Data) AddResources(proj *schema.Project) error {
for _, device := range proj.Devices {
res := d.AddResource(device.Name)
err := res.AddTasks(device)
if err != nil {
return err
}
}
return nil
}
func (d *Data) AddResource(name string) *Resourse {
d.Resource = &Resourse{
Name: name,
}
return d.Resource
}